Skip to content

Create a new API-only service account with specified permissions

Request

Security
JWTAuthorizer
Bodyapplication/jsonrequired
namestring
policyIdsArray of strings
curl -i -X POST \
  https://apidocs.trustgrid.io/_mock/v2/service-user \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string",
    "policyIds": [
      "string"
    ]
  }'

Responses

Service user created

Bodyapplication/json
namestring

Service account name (used as identifier)

statusstring

Whether the service account is active

Enum:"active""inactive"
clientIdstring

Client ID used for API authentication (present after token generation)

policyIdsArray of strings

Named policy IDs attached to this service account

Example:
[ "builtin-tg-monitor" ]
tokenCreatedinteger

Unix epoch timestamp (seconds) when the API token was last generated

orgIdstring

Organization ID

Response
{ "name": "string", "status": "active", "clientId": "string", "policyIds": [ "builtin-tg-monitor" ], "tokenCreated": 0, "orgId": "string" }