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.
| Field | Description |
|---|---|
namerequired | string · 1–100 characters |
scopes | array of "send" | "read" · default ["send","read"] |
workspaceId | string |
{ "name": "Production backend", "scopes": [ "send", "read" ]}Response
201 — Created
| Field | Description |
|---|---|
idrequired | string |
workspaceIdrequired | string |
namerequired | string |
prefixrequired | string First characters of the key, for recognising it. |
scopesrequired | array of "send" | "read" |
createdBy | string | null |
createdAtrequired | string · date-time |
lastUsedAt | string | null · date-time |
keyrequired | string |
{ "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.
| Status | error | When |
|---|---|---|
| 400 | bad_request | Invalid body |
| 401 | unauthorized | Missing or invalid API key / session |
| 403 | forbidden | API key lacks the required scope |
| 404 | not_found | Workspace not found |
| 500 | internal | Internal 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.
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"]}'const res = await fetch("https://api.simline.dev/v1/keys", { method: "POST", headers: { Cookie: `simline_session=${process.env.SIMLINE_SESSION}`, "Content-Type": "application/json" }, body: JSON.stringify({ "name": "Production backend", "scopes": [ "send", "read" ] })})if (!res.ok) { const err = await res.json() throw new Error(`${res.status} ${err.error}: ${err.message}`)}console.log(await res.json())import os
import requests
r = requests.post( "https://api.simline.dev/v1/keys", cookies={"simline_session": os.environ["SIMLINE_SESSION"]}, json={ "name": "Production backend", "scopes": ["send", "read"], }, timeout=15,)if not r.ok: err = r.json() raise RuntimeError(f"{r.status_code} {err['error']}: {err['message']}")print(r.json())