# BI.P.EYE API

## Generate a signed embed URL

> Creates a signed URL that embeds a dashboard inside your product.\
> \
> Pass the returned \`url\` directly to an \`\<iframe src="...">\` in your frontend.\
> If \`expiresInDays\` is omitted, the link expires after 360 days.

````json
{"openapi":"3.0.0","info":{"title":"BI.P.EYE API","version":"1.0.0"},"servers":[{"url":"https://api.bipeye.com/v1","description":"Production"}],"security":[{"organizationApiKey":[]}],"components":{"securitySchemes":{"organizationApiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Your organization API key"}},"schemas":{"Filter":{"type":"object","properties":{"jsonPath":{"type":"string","minLength":1,"description":"JSON path to the field being filtered"},"type":{"$ref":"#/components/schemas/FiltersTypes"},"value":{"nullable":true}},"required":["jsonPath","type"]},"FiltersTypes":{"type":"string","enum":["is greater than","is less than","is greater than or equal to","is less than or equal to","is","is not","date range","multi select","days back","is exists","is not exists","includes","not includes"]}}},"paths":{"/embed/link":{"post":{"summary":"Generate a signed embed URL","description":"Creates a signed URL that embeds a dashboard inside your product.\n\nPass the returned `url` directly to an `<iframe src=\"...\">` in your frontend.\nIf `expiresInDays` is omitted, the link expires after 360 days.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","description":"The organization ID to embed"},"dashboardId":{"type":"string","format":"uuid","description":"The dashboard ID to embed"},"apiKeyName":{"type":"string","description":"An optional name for the generated API key, for easier identification in the BI.P.EYE dashboard"},"expiresInDays":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":360,"description":"How long the link is valid in days. Defaults to 360 days if omitted."},"overrideCurrency":{"type":"string","enum":["USD","EUR","GBP","ILS","JPY","AUD","DKK","CAD","$","€","£","₪","¥","A$","KR","C$"],"description":"Override the currency symbol displayed across all charts in the dashboard.\nAccepts either the ISO currency code (`USD`) or the symbol (`$`) — both resolve to the same currency.\n"},"restrictDatasetsData":{"type":"object","additionalProperties":{"type":"object","properties":{"filters":{"type":"array","items":{"$ref":"#/components/schemas/Filter"}}},"required":["filters"],"description":"**Key** = dataset UUID (e.g. `c3dcb641-72fe-458b-9fe5-1594ba69aff4`).\nEach dataset can have its own independent filter rules.\n\n```json\n{\n  \"restrictDatasetsData\": {\n    \"c3dcb641-72fe-458b-9fe5-1594ba69aff4\": {\n      \"filters\": [\n        {\n          \"jsonPath\": \"$.accountId\",\n          \"type\": \"is\",\n          \"value\": \"ac_123\"\n        }\n      ]\n    }\n  }\n}\n```"},"description":"Per-dataset row-level filters. Use dataset UUIDs as keys — each key maps to a set of filters applied to that dataset's data before rendering."}},"required":["organizationId","dashboardId"]}}}},"responses":{"200":{"description":"Signed embed URL","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"},"apiKey":{"type":"string","format":"uuid","description":"The embed API key. Pass this to the PATCH /embed/apiKey endpoint to update the key later."}},"required":["url","expiresAt","apiKey"]}}}},"400":{"description":"Validation error — check your request body"},"401":{"description":"Invalid or missing API key"},"404":{"description":"Dashboard not found or does not belong to your organization"}}}}}}
````

## List datasets for a dashboard

> Returns all datasets used by the given dashboard, along with their fields and inferred types.\
> \
> Use this to discover which \`jsonPath\` values and field types are available\
> when building \`restrictDatasetsData\` filters for the embed link endpoint.

```json
{"openapi":"3.0.0","info":{"title":"BI.P.EYE API","version":"1.0.0"},"servers":[{"url":"https://api.bipeye.com/v1","description":"Production"}],"security":[{"organizationApiKey":[]}],"components":{"securitySchemes":{"organizationApiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Your organization API key"}},"schemas":{"DashboardDatasetsResponse":{"type":"object","properties":{"datasets":{"type":"array","items":{"$ref":"#/components/schemas/Dataset"}}},"required":["datasets"]},"Dataset":{"type":"object","properties":{"datasetId":{"type":"string","format":"uuid","description":"The UUID of the dataset"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/DatasetField"}}},"required":["datasetId","fields"]},"DatasetField":{"type":"object","properties":{"jsonPath":{"type":"string","description":"JSONPath of the field within the dataset"},"type":{"$ref":"#/components/schemas/FieldType"}},"required":["jsonPath","type"]},"FieldType":{"type":"string","enum":["string","boolean","number","bigint"]}}},"paths":{"/dashboards/datasets":{"post":{"summary":"List datasets for a dashboard","description":"Returns all datasets used by the given dashboard, along with their fields and inferred types.\n\nUse this to discover which `jsonPath` values and field types are available\nwhen building `restrictDatasetsData` filters for the embed link endpoint.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","description":"The organization ID"},"dashboardId":{"type":"string","format":"uuid","description":"The dashboard ID to fetch datasets for"}},"required":["organizationId","dashboardId"]}}}},"responses":{"200":{"description":"List of datasets with their fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardDatasetsResponse"}}}},"400":{"description":"Validation error — check your request body"},"401":{"description":"Invalid or missing API key"},"404":{"description":"Dashboard not found or does not belong to your organization"}}}}}}
```

## Delete an embed API key

> Permanently deletes an embed API key.\
> \
> Once deleted, any iframe using this key will immediately lose access to the dashboard.\
> This action cannot be undone.

```json
{"openapi":"3.0.0","info":{"title":"BI.P.EYE API","version":"1.0.0"},"servers":[{"url":"https://api.bipeye.com/v1","description":"Production"}],"security":[{"organizationApiKey":[]}],"components":{"securitySchemes":{"organizationApiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Your organization API key"}},"schemas":{"DeleteApiKeyResponse":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"paths":{"/embed/apiKey":{"delete":{"summary":"Delete an embed API key","description":"Permanently deletes an embed API key.\n\nOnce deleted, any iframe using this key will immediately lose access to the dashboard.\nThis action cannot be undone.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","description":"The organization ID that owns the API key"},"dashboardId":{"type":"string","format":"uuid","description":"The dashboard ID that the API key belongs to"},"apiKey":{"type":"string","format":"uuid","description":"The embed API key to delete"}},"required":["organizationId","dashboardId","apiKey"]}}}},"responses":{"200":{"description":"API key deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteApiKeyResponse"}}}},"400":{"description":"Validation error — check your request body"},"401":{"description":"Invalid or missing API key"},"404":{"description":"API key not found or does not belong to your organization"}}}}}}
```

## Edit an existing embed API key

> Updates the configuration of an existing embed API key.\
> \
> You can update the expiry duration and/or the per-dataset row-level filters.\
> Only the fields you provide will be changed — omitted fields are left as-is.\
> If \`expiresInDays\` is omitted, expiry is reset to the default of 360 days from now.

````json
{"openapi":"3.0.0","info":{"title":"BI.P.EYE API","version":"1.0.0"},"servers":[{"url":"https://api.bipeye.com/v1","description":"Production"}],"security":[{"organizationApiKey":[]}],"components":{"securitySchemes":{"organizationApiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Your organization API key"}},"schemas":{"Filter":{"type":"object","properties":{"jsonPath":{"type":"string","minLength":1,"description":"JSON path to the field being filtered"},"type":{"$ref":"#/components/schemas/FiltersTypes"},"value":{"nullable":true}},"required":["jsonPath","type"]},"FiltersTypes":{"type":"string","enum":["is greater than","is less than","is greater than or equal to","is less than or equal to","is","is not","date range","multi select","days back","is exists","is not exists","includes","not includes"]},"EditApiKeyResponse":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"paths":{"/embed/apiKey":{"patch":{"summary":"Edit an existing embed API key","description":"Updates the configuration of an existing embed API key.\n\nYou can update the expiry duration and/or the per-dataset row-level filters.\nOnly the fields you provide will be changed — omitted fields are left as-is.\nIf `expiresInDays` is omitted, expiry is reset to the default of 360 days from now.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","description":"The organization ID that owns the API key"},"dashboardId":{"type":"string","format":"uuid","description":"The dashboard ID that the API key belongs to"},"apiKeyName":{"type":"string","description":"An optional name for the generated API key, for easier identification in the BI.P.EYE dashboard"},"apiKey":{"type":"string","format":"uuid","description":"The embed API key to edit"},"expiresInDays":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"New expiry duration in days from now. Defaults to 360 days if omitted."},"restrictDatasetsData":{"type":"object","additionalProperties":{"type":"object","properties":{"filters":{"type":"array","items":{"$ref":"#/components/schemas/Filter"}}},"required":["filters"],"description":"**Key** = dataset UUID (e.g. `c3dcb641-72fe-458b-9fe5-1594ba69aff4`).\nEach dataset can have its own independent filter rules.\n\n```json\n{\n  \"restrictDatasetsData\": {\n    \"c3dcb641-72fe-458b-9fe5-1594ba69aff4\": {\n      \"filters\": [\n        {\n          \"jsonPath\": \"$.accountId\",\n          \"type\": \"is\",\n          \"value\": \"ac_123\"\n        }\n      ]\n    }\n  }\n}\n```"},"description":"Per-dataset row-level filters. Use dataset UUIDs as keys — each key maps to a set of filters applied to that dataset's data before rendering."}},"required":["organizationId","dashboardId","apiKey"]}}}},"responses":{"200":{"description":"API key updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditApiKeyResponse"}}}},"400":{"description":"Validation error — check your request body"},"401":{"description":"Invalid or missing API key"},"404":{"description":"API key not found or does not belong to your organization"}}}}}}
````
