Skip to content

Accounts ​

Accounts ​

An account is the tenancy boundary: it owns workspaces, members, invitations, and billing. Every route below requires the authenticated user to be a member of the account, except POST /accounts (creating a brand new account, which has no members yet).

GET /accounts/me ​

Get the current authenticated user's account profile.

Authentication: JWT Bearer token

Request ​

No path or query parameters. The account is resolved from the authenticated session.

Response ​

Response Example ​
json
{
  "data": {
    "id": "acc-1234-5678",
    "slug": "alices-team",
    "legalName": "Alice's Team, Inc.",
    "displayName": "Alice's Team",
    "status": "active",
    "website": "https://alicesteam.example.com",
    "industry": "Software",
    "billingEmail": "billing@alicesteam.example.com",
    "defaultTimezone": "America/New_York",
    "avatarUrl": null,
    "createdAt": "2026-01-15T08:00:00.000Z",
    "updatedAt": "2026-03-10T14:30:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​
FieldTypeDescription
idstringAccount ID
slugstringURL-safe account identifier, unique
legalNamestringLegal/organisation name
displayNamestring | nullDisplay name shown in UI, falls back to legalName when unset
statusstring | nullactive, suspended, closed, deletion_approved, or hard_deleted
websitestring | nullOrganisation website URL
industrystring | nullFree-text industry label
billingEmailstring | nullEmail address used for billing notices
defaultTimezonestring | nullIANA timezone used for scheduling defaults
avatarUrlstring | nullAccount avatar/logo URL
createdAtstring | nullISO 8601 timestamp of account creation
updatedAtstring | nullISO 8601 timestamp of last update

Code Examples ​

curl "https://api.chainabit.com/api/v1/accounts/me" \
  -H "Authorization: Bearer $TOKEN"

POST /accounts ​

Create a new organisation account owned by the authenticated user. Unlike every other route in this section, this one has no membership requirement -- there is no account yet to be a member of. The response includes the id of a workspace created for you by default, so a client always has somewhere to land immediately after creation.

Authentication: JWT Bearer token

Request ​

FieldTypeRequiredConstraintsDescription
slugstringYes3-64 chars, ^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$URL-safe account identifier, unique
legalNamestringYes2-180 chars after normalization, plain text onlyLegal/organisation name. See Organisation names
displayNamestringNoMax 180 charsDisplay name shown in UI
websitestringNoValid URLOrganisation website
industrystringNoMax 120 charsFree-text industry label
billingEmailstringNoValid emailEmail address used for billing notices
defaultTimezonestringNoMax 120 charsIANA timezone used for scheduling defaults
avatarUrlstringNoValid URLAccount avatar/logo URL

There is deliberately no status field: a newly created account always starts active.

Response ​

Response Example ​
json
{
  "data": {
    "id": "acc-1234-5678",
    "slug": "alices-team",
    "legalName": "Alice's Team, Inc.",
    "displayName": "Alice's Team",
    "status": "active",
    "website": null,
    "industry": null,
    "billingEmail": null,
    "defaultTimezone": null,
    "avatarUrl": null,
    "accountType": "organization",
    "defaultWorkspaceId": "wksp-0001",
    "ownerChainerId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "createdAt": "2026-03-17T11:00:00.000Z",
    "updatedAt": "2026-03-17T11:00:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​

All fields from the account object above, plus:

FieldTypeDescription
accountTypestringType of account created: always organization for this route
defaultWorkspaceIdstringID of the workspace created by default for this account
ownerChainerIdstringUser ID of the account owner (the authenticated caller)

Code Examples ​

curl -X POST "https://api.chainabit.com/api/v1/accounts" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "alices-team",
    "legalName": "Alice'"'"'s Team, Inc."
  }'

GET /accounts/:id ​

Get an account by ID. The authenticated user must be a member of the account.

Authentication: JWT Bearer token (must be an account member)

Request ​

Use the account id from GET /accounts/me -- don't copy the example value below.

The account returned is always the one the caller is actually a member of, never an arbitrary account looked up by the id you pass. Passing an id you are not a member of returns a 403 rather than someone else's account data.

Response ​

Response Example ​
json
{
  "data": {
    "id": "acc-1234-5678",
    "name": "Alice's Team",
    "slug": "alices-team",
    "role": "owner",
    "createdAt": "2026-01-15T08:00:00.000Z",
    "updatedAt": "2026-03-10T14:30:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​
FieldTypeDescription
idstringAccount ID
namestringAccount display name
slugstringURL-safe account identifier
rolestringAuthenticated user's role in this account (owner, admin, member)
createdAtstringISO 8601 timestamp of account creation
updatedAtstringISO 8601 timestamp of last update

Code Examples ​

curl "https://api.chainabit.com/api/v1/accounts/$ACCOUNT_ID" \
  -H "Authorization: Bearer $TOKEN"

PATCH /accounts/:id ​

Update an account's name. Requires owner or admin role.

Authentication: JWT Bearer token + Owner/Admin role required

Request ​

All fields are optional; send only what changes.

FieldTypeRequiredConstraintsDescription
slugstringNo3-64 chars, ^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$URL-safe account identifier
legalNamestringNo2-180 chars after normalization, plain text onlyLegal/organisation name. See Organisation names
displayNamestringNoMax 180 charsDisplay name shown in UI. Trimmed and whitespace-collapsed like legalName
statusstringNo"active" or "suspended" onlyAccount status. Terminal states (closed, deletion_approved, hard_deleted) cannot be set here -- they belong to the account deletion flow
websitestringNoValid URLOrganisation website
industrystringNoMax 120 charsFree-text industry label
billingEmailstringNoValid emailEmail address used for billing notices
defaultTimezonestringNoMax 120 charsIANA timezone used for scheduling defaults
avatarUrlstringNoValid URLAccount avatar/logo URL

Response ​

Response Example ​
json
{
  "data": {
    "id": "acc-1234-5678",
    "slug": "alices-team",
    "legalName": "Alice and Team, Inc.",
    "displayName": "Alice and Team",
    "status": "active",
    "website": null,
    "industry": null,
    "billingEmail": null,
    "defaultTimezone": null,
    "avatarUrl": null,
    "createdAt": "2026-01-15T08:00:00.000Z",
    "updatedAt": "2026-03-17T11:00:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​

Same shape as the account object returned by GET /accounts/me.

Code Examples ​

curl -X PATCH "https://api.chainabit.com/api/v1/accounts/$ACCOUNT_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "displayName": "Alice and Team"
  }'

DELETE /accounts/:id ​

Suspend an account (soft delete). The account's status becomes suspended; no data is erased. Once the account is suspended, its members, including owners, lose access to it, and its API keys are refused. Requires owner role.

This route does not permanently delete an account. See Current limitations.

Authentication: JWT Bearer token + Owner role required

Request ​

No path or query parameters beyond the account id.

Response ​

Response Example ​
json
{
  "data": {
    "id": "acc-1234-5678",
    "slug": "alices-team",
    "legalName": "Alice's Team, Inc.",
    "displayName": "Alice's Team",
    "status": "suspended",
    "website": null,
    "industry": null,
    "billingEmail": null,
    "defaultTimezone": null,
    "avatarUrl": null,
    "createdAt": "2026-01-15T08:00:00.000Z",
    "updatedAt": "2026-03-17T11:00:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​

The account object above, with status set to suspended.

Code Examples ​

curl -X DELETE "https://api.chainabit.com/api/v1/accounts/$ACCOUNT_ID" \
  -H "Authorization: Bearer $TOKEN"

Organisation names ​

When you update a name with PATCH /accounts/:id, legalName and displayName have leading and trailing whitespace removed and every run of whitespace collapsed to a single space before they are stored, and legalName is also normalized to Unicode NFC. Sending " Acme Labs\t" stores "Acme Labs".

After normalization, legalName must be 2 to 180 characters of plain text. A legalName that contains control characters (for example U+0007), invisible format characters (for example the zero-width space U+200B or the right-to-left override U+202E), or only whitespace is refused with 400 and enterprise_organization_name_invalid (Organization name must be 2 to 180 characters of plain text). A legalName shorter than 2 or longer than 180 characters is refused with 400 and bad_request. POST /accounts refuses the same invalid legalName values with the same codes.

curl -X PATCH "https://api.chainabit.com/api/v1/accounts/$ACCOUNT_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"legalName": "Acme  Labs "}'

The response's data.legalName is "Acme Labs".


Account Members ​

An account member is a chainer who already has a Chainabit user account and has been attached directly to this account. To bring in someone by email address who may not have a Chainabit account yet, use Account Invitations instead -- accepting an invitation is what creates the membership these endpoints operate on.

Assignable roles are admin, analyst, billing, viewer, member. owner cannot be assigned through these endpoints -- ownership transfer requires a dedicated flow.

GET /accounts/:accountId/members ​

List all members of an account. Any member can view the roster, not just owner/admin.

Authentication: JWT Bearer token (must be an account member)

Request ​

ParameterTypeRequiredDescription
limitnumberNoPage size, up to 500
offsetnumberNoNumber of results to skip

Response ​

Response Example ​
json
{
  "data": [
    {
      "accountId": "acc-1234-5678",
      "chainerId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "role": "owner",
      "status": "active",
      "email": "alice@example.com",
      "fullName": "Alice Johnson",
      "username": "alice_j",
      "avatarUrl": null,
      "invitedBy": null,
      "joinedAt": "2026-01-15T08:00:00.000Z"
    },
    {
      "accountId": "acc-1234-5678",
      "chainerId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "role": "member",
      "status": "active",
      "email": "bob@example.com",
      "fullName": "Bob Smith",
      "username": "bob_dev",
      "avatarUrl": null,
      "invitedBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "joinedAt": "2026-02-20T10:00:00.000Z"
    }
  ],
  "meta": {
    "total": 2
  },
  "error": null
}
Response Fields ​
FieldTypeDescription
accountIdstringAccount ID
chainerIdstringMember's user ID
rolestringMember's role (owner, admin, analyst, billing, viewer, member)
statusstringinvited, active, or suspended. Pending invitations do not occupy paid seats; an active Business membership still needs a confirmed licensed seat before billable usage.
emailstring | nullMember's sign-in email address
fullNamestring | nullMember's full name
usernamestring | nullMember's username
avatarUrlstring | nullMember's avatar URL
invitedBystring | nullUser ID of whoever added this member, null for the account owner
joinedAtstring | nullISO 8601 timestamp of when the member joined

Code Examples ​

curl "https://api.chainabit.com/api/v1/accounts/$ACCOUNT_ID/members" \
  -H "Authorization: Bearer $TOKEN"

POST /accounts/:accountId/members ​

Attach an existing chainer to an account by their chainerId. Requires owner or admin role. This is not an email invite -- the caller must already know the target's chainerId (e.g. from a prior workspace or a shared organisation). To bring in someone by email address, use POST /accounts/:accountId/invitations instead.

Authentication: JWT Bearer token + Owner/Admin role required

Request ​

FieldTypeRequiredConstraintsDescription
chainerIdstringYesUUIDUser ID of the chainer to add
rolestringNoOne of the assignable roles above, defaults to memberRole to assign
billingConsentIdstringFor BusinessReviewed consent IDFinancial approval for this member addition in the selected Business workspace

For Business, first review the matching add action in Business billing. Set CHAINER_ID to the person being added and BILLING_CONSENT_ID to the returned billingConsentId; the approval is specific to that action and person. Select the same account and workspace when committing it. An active membership alone does not prove a paid seat: Business access waits for confirmed billing and seat activation.

Response ​

Response Example ​
json
{
  "data": {
    "accountId": "acc-1234-5678",
    "chainerId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "role": "member",
    "status": "active",
    "email": "carol@example.com",
    "fullName": "Carol Nguyen",
    "username": "carol_n",
    "avatarUrl": null,
    "invitedBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "joinedAt": "2026-03-17T11:00:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​

Same shape as the member object above.

Code Examples ​

curl -X POST "https://api.chainabit.com/api/v1/accounts/$ACCOUNT_ID/members" \
  -H "Authorization: Bearer $TOKEN" \
  -H "x-account-id: $ACCOUNT_ID" \
  -H "x-workspace-id: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d "{\"chainerId\":\"$CHAINER_ID\",\"role\":\"member\",\"billingConsentId\":\"$BILLING_CONSENT_ID\"}"

PATCH /accounts/:accountId/members/:chainerId ​

Update a member's role in an account. Requires owner or admin role.

Authentication: JWT Bearer token + Owner/Admin role required

Request ​

chainerId is the member's user ID, returned as chainerId in the GET /accounts/:accountId/members response -- not the literal value shown below.

FieldTypeRequiredConstraintsDescription
rolestringYesOne of the assignable roles aboveNew role for the member

Response ​

Response Example ​
json
{
  "data": {
    "accountId": "acc-1234-5678",
    "chainerId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "role": "admin",
    "status": "active",
    "email": "bob@example.com",
    "fullName": "Bob Smith",
    "username": "bob_dev",
    "avatarUrl": null,
    "invitedBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "joinedAt": "2026-02-20T10:00:00.000Z"
  },
  "meta": null,
  "error": null
}
Response Fields ​

Same shape as the member object above.

Code Examples ​

curl -X PATCH "https://api.chainabit.com/api/v1/accounts/$ACCOUNT_ID/members/$CHAINER_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "role": "admin"
  }'

DELETE /accounts/:accountId/members/:chainerId ​

Remove a member from an account. Requires owner or admin role. Also revokes the enterprise API keys the member created in this account and removes their memberships of this account's workspaces.

Removal affects only this account. The person is not signed out: their session keeps working for their personal account and for any other account they belong to. Their access to this account ends from their next request; a request that still selects this account or one of its workspaces (with the x-account-id or x-workspace-id header) is refused with 403, not 401.

Authentication: JWT Bearer token + Owner/Admin role required

Request ​

ParameterTypeRequiredDescription
billingConsentIdstringFor BusinessQuery parameter containing the reviewed remove approval for this member and workspace
releaseSeatbooleanNoAccepted for compatibility. Business member removal always revokes seat access and queues quantity reconciliation, whether this parameter is omitted or true; it cannot opt out of billing changes.

Review the matching remove action in Business billing and use its returned ID as BILLING_CONSENT_ID. Removal has no JSON body. If the API returns a recent-authentication challenge for a protected removal, complete that action's challenge before retrying.

Response ​

Response Example ​
json
{
  "data": {
    "accountId": "acc-1234-5678",
    "chainerId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "role": "member",
    "status": "active",
    "email": "bob@example.com",
    "fullName": "Bob Smith",
    "username": "bob_dev",
    "avatarUrl": null,
    "invitedBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "joinedAt": "2026-02-20T10:00:00.000Z",
    "revokedApiKeys": [
      { "id": "key-01", "name": "CI deploy key", "keyPrefix": "cb_live_", "lastFour": "a1b2" }
    ],
    "removedWorkspaceMemberships": 3,
    "revokedSessions": 0,
    "seatRelease": { "status": "queued" }
  },
  "meta": null,
  "error": null
}
Response Fields ​

Member fields as in GET /accounts/:accountId/members, plus:

FieldTypeDescription
revokedApiKeysarrayEnterprise API keys owned by this member that were revoked as part of removal (id, name, keyPrefix, lastFour)
removedWorkspaceMembershipsnumberCount of workspace memberships removed along with this account membership
revokedSessionsnumberAlways 0. Removal does not end the person's sessions. Kept for compatibility.
seatRelease.statusstringqueued means the membership-driven seat change is durable and awaiting reconciliation. The removal response does not confirm a provider quantity or invoice amount.

The removed member loses Business access immediately. Confirmed decreases update the subscription quantity for the next renewal without a mid-period refund; paid-through license capacity can remain available to eligible replacements. See Business billing.

Removing a member does not cancel the subscription. Reviewed Business subscription cancellation stops renewal once the provider confirms it, without an automatic refund or conversion of the workspace. Independently verified paid access remains available through its paid-through date. Other independently subscribed Business workspaces and Personal contexts remain separate.

Code Examples ​

curl -X DELETE "https://api.chainabit.com/api/v1/accounts/$ACCOUNT_ID/members/$CHAINER_ID?billingConsentId=$BILLING_CONSENT_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "x-account-id: $ACCOUNT_ID" \
  -H "x-workspace-id: $WORKSPACE_ID"

Account Audit Logs ​

GET /accounts/:id/logs ​

This route is not part of the supported public API contract. Do not build an integration on it or on any earlier pagination or response examples for it.


Current limitations ​

  • Permanent deletion is available only for personal accounts. An account deletion request permanently erases a personal account and is accepted only from that account's holder. A deletion request for an Organization account (every account created with POST /accounts) is refused with 403 and error code ORGANIZATION_DELETION_UNSUPPORTED. A request from anyone other than the holder of a personal account is refused with 403 and DELETION_REQUESTER_NOT_HOLDER. Suspending an account with DELETE /accounts/:id does not erase it.
  • An approved deletion locks the account. A deletion request can be cancelled until it is approved. Once it is approved, the account is locked, its holder is signed out and cannot sign in, the request can no longer be cancelled through the API, and the account is permanently erased after a retention period.

Built with purpose. chainabit.com