POST
/
project
/
{id}
/
share
/
token
curl -X POST \
  'https://api.chartbrew.com/project/123/share/token' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "share_policy": {
      "params": [
        {
          "key": "userId",
          "value": "12345"
        },
        {
          "key": "region",
          "value": "us-east"
        }
      ],
      "allow_params": true
    },
    "exp": "2024-12-31T23:59:59Z"
  }'
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOnsidHlwZSI6IlByb2plY3QiLCJpZCI6MTIzfSwiaWF0IjoxNjQyNDQwMDAwLCJleHAiOjE3MDM5NzYwMDB9.example_signature",
  "url": "https://app.chartbrew.com/b/my-dashboard?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOnsidHlwZSI6IlByb2plY3QiLCJpZCI6MTIzfSwiaWF0IjoxNjQyNDQwMDAwLCJleHAiOjE3MDM5NzYwMDB9.example_signature"
}
This endpoint generates a JWT token for accessing a dashboard with a SharePolicy. The token can include custom parameters, expiration dates, and URL parameter permissions.

Parameters

id
string
required
The ID of the dashboard/project

Body Parameters

share_policy
object
Share policy configuration to update before generating token
exp
string
Token expiration date and time in ISO 8601 format (e.g., “2024-12-31T23:59:59Z”)

Response

token
string
The generated JWT access token for dashboard access
url
string
The complete shareable URL with the access token included

Example

curl -X POST \
  'https://api.chartbrew.com/project/123/share/token' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "share_policy": {
      "params": [
        {
          "key": "userId",
          "value": "12345"
        },
        {
          "key": "region",
          "value": "us-east"
        }
      ],
      "allow_params": true
    },
    "exp": "2024-12-31T23:59:59Z"
  }'
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOnsidHlwZSI6IlByb2plY3QiLCJpZCI6MTIzfSwiaWF0IjoxNjQyNDQwMDAwLCJleHAiOjE3MDM5NzYwMDB9.example_signature",
  "url": "https://app.chartbrew.com/b/my-dashboard?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOnsidHlwZSI6IlByb2plY3QiLCJpZCI6MTIzfSwiaWF0IjoxNjQyNDQwMDAwLCJleHAiOjE3MDM5NzYwMDB9.example_signature"
}

Usage Notes

  • Prerequisites: A SharePolicy must exist for the project before generating tokens. Use the “Create Dashboard Share Policy” endpoint first.
  • Token Expiration: If no expiration is specified, the token will have a very long expiration (99999 days).
  • Parameters: Parameters defined in the share policy will be passed as variables to the dashboard’s charts.
  • URL Parameters: If allow_params is true, additional parameters can be passed via URL query parameters and will override policy parameters.
  • Security: Always use HTTPS when sharing URLs containing access tokens.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

ID of the project

Body

application/json

Response

200
application/json

Generated share token and URL

The response is of type object.