Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

On this pageOverview

Create service token

POST/v1/workspaces/{workspaceId}/service-tokens

Creates a new service token for the given workspace. The value field is returned exactly once in this response and is never stored — copy it immediately.

AuthorizationBearer <token>

OAuth2 authentication

In: header

Scope: workspace:admin, offline_access

workspaceId*string

Match^(wksp_)?([cC][^\s-]{8,}|[a-z0-9]+)$

application/json

TypeScript Definitions

Use the request body type in TypeScript.

curl -X POST "https://example.com/v1/workspaces/string/service-tokens" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string"
  }'
{
  "data": {
    "id": "string",
    "type": "serviceToken",
    "name": "string",
    "valueHint": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "expiresAt": "2019-08-24T14:15:22Z",
    "value": "string"
  }
}
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu