Skip to main content
POST
/
api
/
v2
/
service-accounts
Create service account
curl --request POST \
  --url https://api.example.com/api/v2/service-accounts \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "organizationalRole": "Admin",
  "workspaceAssignments": [
    {
      "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "role": "Owner"
    }
  ],
  "expirationDate": "2023-11-07T05:31:56Z",
  "scopes": [
    "<string>"
  ]
}
'
{
  "data": {
    "clientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "clientSecret": "<string>",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "description": "<string>",
    "isActive": true,
    "organizationalRole": "Admin",
    "clientSecretPrefix": "<string>",
    "credentialExpirationDate": "2023-11-07T05:31:56Z",
    "workspaceAssignments": [
      {
        "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "workspaceName": "<string>",
        "role": "Owner"
      }
    ],
    "credentials": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "clientSecretPrefix": "<string>",
        "status": "Active",
        "expirationDate": "2023-11-07T05:31:56Z",
        "lastUsedAt": "2023-11-07T05:31:56Z",
        "createdAt": "2023-11-07T05:31:56Z",
        "scopes": [
          "<string>"
        ]
      }
    ],
    "lastUsedAt": "2023-11-07T05:31:56Z",
    "createdAt": "2023-11-07T05:31:56Z",
    "lastModifiedAt": "2023-11-07T05:31:56Z"
  },
  "meta": {
    "requestId": "<string>",
    "timestamp": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.contraforce.com/llms.txt

Use this file to discover all available pages before exploring further.

Body

application/json
name
null | string
description
null | string
organizationalRole
enum<string>
Available options:
Admin,
UserAdmin,
WorkspaceAdmin,
AgentAdmin,
Member
workspaceAssignments
null | object[]
expirationDate
null | string<date-time>
scopes
null | string[]

The granular API scopes granted to the initial credential.

Response

Created

Standard v2 API response envelope for single-item responses.

data
object

Returned only on service account creation. Contains the plaintext client secret which is shown once.

meta
object