ClientSphereDocs
API reference/Accounts

Update account

Updates an account by its id and returns the updated record. Responds 404 if no account with that id exists in the authenticated company. Setting externalId here is how accounts that predate your integration get their id; a value already on another live account is a 409.

PUT
/accounts/{id}

Authorization

AuthorizationRequiredBearer <token>

API key as Bearer token: Authorization: Bearer sk_live_.... Use sk_live_ prefixed keys for production data and sk_test_ prefixed keys for sandbox/test data.

In: header

X-API-Key<token>

API key via header: X-API-Key: sk_live_.... Use sk_live_ prefixed keys for production data and sk_test_ prefixed keys for sandbox/test data.

In: header

Request Body

application/jsonRequired
externalIdstring

Your own id for the organisation — a customer or tenant id from your system. Send it on every create and the endpoint becomes find-or-create: if a live account in this workspace already carries this id, that account is returned with 200 and nothing is created or changed. Otherwise the account is created with 201.

Name is never used for matching. Two organisations with the same name and different ids are two accounts, on purpose — matching on name would attach one customer's signup to another customer's record. Omit the field and the endpoint always creates.

namestring
websitestring
industrystring
sizestring
Value in: "small" | "medium" | "large" | "enterprise"
phonestring
addressstring
extraInformationstring
statusstring
Default: "active"Value in: "active" | "inactive" | "prospect" | "customer" | "churned"
tagsarray<string>

Path Parameters

idRequiredstring

Resource ID

Format: "uuid"
curl -X PUT "https://clientsphere.io/api/v1/accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "externalId": "org_8f2c1",
    "name": "Acme Corp",
    "website": "https://acme.com",
    "industry": "Technology",
    "size": "small",
    "phone": "string",
    "address": "string",
    "extraInformation": "VIP customer; renewal in Q3.",
    "status": "active",
    "tags": [
      "enterprise",
      "priority"
    ]
  }'

Updated account

{
  "data": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
    "name": "string",
    "website": "string",
    "industry": "string",
    "size": "small",
    "phone": "string",
    "address": "string",
    "extraInformation": "string",
    "status": "active",
    "assignedTo": 0,
    "ownerId": 0,
    "tags": [
      "string"
    ],
    "externalId": "org_8f2c1",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}