Service tokens
Create 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.
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.
POST
/v1/workspaces/{workspaceId}/service-tokensAuthorizationBearer <token>
OAuth2 authentication
In: header
Scope: workspace:admin, offline_access
Path Parameters
workspaceId*string
Match
^(wksp_)?([cC][^\s-]{8,}|[a-z0-9]+)$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.prisma.io/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"
}
}{
"error": {
"code": "string",
"message": "string",
"hint": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"hint": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"hint": "string"
}
}