Create an API token
View as MarkdownPOST
/v1/workspaces/{workspaceId}/api-tokensCreates a personal API token for one workspace. The secret is returned once; send it as Authorization: Bearer <secret> to /v1 operation routes or /mcp. It acts as you, limited to this workspace and the given scopes (default: read and write).
curl -X POST "https://api.lydie.co/v1/workspaces/01JCQ3TZ0WJ8K4M2X7T9R6N1PA/api-tokens" \
-H "Authorization: Bearer $LYDIE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Sync script",
"scopes": [
"docs:read"
]
}'Path parameters
Body
Default
["docs:read","docs:write"]
Response
{
"token": {
"id": "string",
"workspaceId": "01JCQ3TZ0WJ8K4M2X7T9R6N1PA",
"name": "Notes",
"prefix": "string",
"scopes": [
"docs:read"
],
"createdAt": "string",
"lastUsedAt": null,
"expiresAt": null
},
"secret": "string"
}Errors use one envelope for every endpoint. See Errors and versions.