Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

Create service token

POST/v1/workspaces/{workspaceId}/service-tokensCreate service token

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.

Parameters

workspaceIdstringpathrequired

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

Request body

application/json
object
namestringrequired

Display name for the service token.

maxLength 256 · minLength 1

Example request
{
  "name": "string"
}

Responses

201Created a new service token. The token value is returned once in the response body.application/json
object
dataobjectrequired
Show child attributes
createdAtstring · date-timerequired
expiresAtnull | string · date-time
idstringrequired

pattern ^(itgr_)([cC][^\s-]{8,}|[a-z0-9]+)$

namestringrequired
typestringrequired

const "serviceToken"

valuestringrequired
valueHintstringrequired
Example response
{
  "data": {
    "createdAt": "2026-06-09T00:00:00Z",
    "expiresAt": "2026-06-09T00:00:00Z",
    "id": "string",
    "name": "string",
    "type": "serviceToken",
    "value": "string",
    "valueHint": "string"
  }
}
401Missing or invalid authorization token.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
404Workspace with the given ID was not found.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
422Invalid request parameters.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
Documentation menu