Skip to content

Create an API key

POST/v1/keysDashboard session

Create an API key (session only). The key is returned once.

Authentication

Dashboard session only (the simline_session cookie). API keys can't call this endpoint: manage keys at app.simline.dev → Developers.

Request body

application/json, required.

FieldDescription
name
required
string · 1–100 characters
scopesarray of "send" | "read" · default ["send","read"]
workspaceIdstring
Example body
{
"name": "Production backend",
"scopes": [
"send",
"read"
]
}

Response

201 — Created

FieldDescription
id
required
string
workspaceId
required
string
name
required
string
prefix
required
string
First characters of the key, for recognising it.
scopes
required
array of "send" | "read"
createdBystring | null
createdAt
required
string · date-time
lastUsedAtstring | null · date-time
key
required
string
201 example (values are illustrative)
{
"id": "key_Q1w2E3r4T5y6U7i8O9p0Aa",
"workspaceId": "ws_9yLm2Qx7Rk3sTb6Vh1Nc0A",
"name": "Production backend",
"prefix": "sl_live_Ab3d",
"scopes": [
"send"
],
"createdBy": "createdBy",
"createdAt": "2026-11-28T09:13:57.390Z",
"lastUsedAt": "2026-11-28T09:13:57.390Z",
"key": "sl_live_Ab3dK9mQ2xR7sT1bV6hN3cYw0pL5zE8u"
}

Errors

Errors are JSON: {"error": "<code>", "message": "<a sentence>"}. Branch on error, show message. Every code is explained in Errors.

StatuserrorWhen
400bad_requestInvalid body
401unauthorizedMissing or invalid API key / session
403forbiddenAPI key lacks the required scope
404not_foundWorkspace not found
500internalInternal error

Examples

This endpoint is for the dashboard. The examples use the session cookie for completeness; in practice, create and revoke keys at app.simline.dev → Developers → API keys.

Terminal window
curl -X POST "https://api.simline.dev/v1/keys" \
-H "Cookie: simline_session=$SIMLINE_SESSION" \
-H "Content-Type: application/json" \
-d '{"name":"Production backend","scopes":["send","read"]}'