Accounts

Provision a client account

POST /api/v1/accounts

Provision a client account

Requires accounts:write and an active parent account. Creates a client under the authenticated parent without creating users or OAuth connections. Use the exact JEX company_id claim as externalId. Repeated requests return the same account without renaming it. Pass its id as accountId to POST /api/v1/agents, then enable company identification separately. Later SSO logins reuse the account.

Request body

object

Field Type Description
name * string
externalId * string

Responses

Status Schema Description
200 Account

Existing account

201 Account

Account created

400 Error

Invalid request body

401 Error

Invalid bearer token

403 Error

Missing accounts:write scope or ineligible parent account

409 Error

Account is deleted; restore it before provisioning

Example 200 response
{
    "id": 1,
    "externalId": "string",
    "name": "string",
    "parentId": 1
}
Example 201 response
{
    "id": 1,
    "externalId": "string",
    "name": "string",
    "parentId": 1
}
Example 400 response
{
    "error": "string",
    "message": "string"
}
Example 401 response
{
    "error": "string",
    "message": "string"
}
Example 403 response
{
    "error": "string",
    "message": "string"
}
Example 409 response
{
    "error": "string",
    "message": "string"
}