POST
/
project
/
{project_id}
/
chart
/
{id}
/
share
/
policy
curl -X POST \
  'https://api.chartbrew.com/project/123/chart/456/share/policy' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json'
{
  "id": 2,
  "entity_type": "Chart",
  "entity_id": 456,
  "visibility": "private",
  "params": [],
  "allow_params": false,
  "password": null,
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}
This endpoint creates a new SharePolicy for a chart, which enables advanced sharing and embedding features including:
  • Signed URL generation with expiration dates
  • Parameter passing to chart variables
  • Control over URL parameter allowance
  • Enhanced security for embedded charts

Parameters

project_id
string
required
The ID of the project containing the chart
id
string
required
The ID of the chart

Response

id
integer
The unique identifier of the created share policy
entity_type
string
The type of entity this policy applies to (always “Chart” for charts)
entity_id
integer
The ID of the chart this policy applies to
visibility
string
The visibility setting for the share policy:
  • public: Anyone can view
  • private: Can be viewed with signed URL
  • password: Anyone can view with a password
  • disabled: The share policy is disabled
params
array
Array of parameter objects that will be passed to chart variables
allow_params
boolean
Whether to allow parameters to be passed via URL query parameters
password
string
Password for password-protected sharing (if applicable)
createdAt
string
ISO 8601 timestamp of when the share policy was created
updatedAt
string
ISO 8601 timestamp of when the share policy was last updated

Example

curl -X POST \
  'https://api.chartbrew.com/project/123/chart/456/share/policy' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json'
{
  "id": 2,
  "entity_type": "Chart",
  "entity_id": 456,
  "visibility": "private",
  "params": [],
  "allow_params": false,
  "password": null,
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}