Skip to content

Update sub-account

View .md
PATCH

Update sub-account. Requires a parent project API key; sub-account API keys receive HTTP 403.

Authorization

  • Authorizationheaderrequired

    Bearer YOUR_API_KEY. Create a key in the dashboard.

Path parameters

  • idstringrequired

    Sub-account ID.

Body

application/json

  • namestring
  • externalIdstring
  • creditLimitintegernullable
    Limitsmin 0
  • metadataobject
  • statusstring

    active and inactive are set with PATCH. pending_deletion is read-only: the sub-account was deactivated with DELETE, its API keys are revoked, and it is removed after 14 days.

    One ofactiveinactivepending_deletion

Responses

200Sub-account updated.
  • subAccountobjectrequired
    9 properties
    • idstringrequired
    • namestringrequired
    • externalIdstringnullable

      External reference ID set by the parent account.

    • statusstringrequired

      active and inactive are set with PATCH. pending_deletion is read-only: the sub-account was deactivated with DELETE, its API keys are revoked, and it is removed after 14 days.

      One ofactiveinactivepending_deletion
    • totalSpentintegerrequired

      Total amount spent by this sub-account in cents.

    • creditLimitintegernullable

      Spending cap in cents. When reached, messages from this sub-account will be blocked.

    • metadataobjectnullable
    • apiKeystring

      API key for the sub-account. Only returned on creation.

    • createdAtstring<date-time>required
400Invalid request.
  • codestringrequired
  • messagestringrequired
  • detailsobject
401Unauthorized.
  • codestringrequired
  • messagestringrequired
  • detailsobject
403Forbidden. Sub-account API keys cannot manage sub-accounts.
  • codestringrequired
  • messagestringrequired
  • detailsobject
404Sub-account not found.
  • codestringrequired
  • messagestringrequired
  • detailsobject
409Another sub-account in the team already has this `externalId`.
  • codestringrequired
  • messagestringrequired
  • detailsobject