Create an API key
POST
The key acts as you, never with more than your own access, capped by its scope and optionally limited to some projects. The key is in this answer only.
bearerheader
AuthorizationBearer <token>An API key (opk_…) or a CLI token (opc_…).
application/json- body
name*stringWhere the key is used, such as "GitHub Actions".
Length
1 <= length <= 60scope*stringThe most the key may do: view, deploy or admin. It never does more than its creator's own access.
Value in
"view""deploy""admin"projectIds?array<>|Limit the key to these projects.
expiresAt?|nullCreate an API key
application/json- response
apiKey*key*stringThe key itself (opk_…). Shown only in this answer; store it now.
curl -X POST "https://openpanel.sh/api/v1/api-keys" \ -H "Authorization: Bearer $OPENPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "scope": "view"}'Example response
{ "apiKey": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "prefix": "string", "scope": "view", "projectIds": [ "b2d9859a-b2e9-4f49-b393-9a25d0eff2f8" ], "expiresAt": "2019-08-24T14:15:22Z", "lastUsedAt": "2019-08-24T14:15:22Z", "revokedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "createdBy": "string", "creatorName": "string", "creatorEmail": "string" }, "key": "string"}