Crm companies

Archive a CRM company

Archives the company. A company with active contacts or open deals needs a decision first: without `mode` the response has `status` `needs_decision` with the counts, and nothing is archived. Send again with `mode` `detach` or `cascade`. A company shared with you through your chain returns 403; only its owner can archive it.

POST
/crm/companies/{id}/archive

Archives the company. A company with active contacts or open deals needs a decision first: without mode the response has status needs_decision with the counts, and nothing is archived. Send again with mode detach or cascade. A company shared with you through your chain returns 403; only its owner can archive it.

Authorization

x-api-key
x-api-key<token>

Company API key, created under Settings > API Keys.

In: header

Path Parameters

id*string

The CRM company id.

Header Parameters

x-company-id?string

Optional with an API key or OAuth token: leave it out and the company the key or token belongs to is used. If sent, it must be that same company, otherwise the request is refused with 403 API_KEY_WRONG_COMPANY or OAUTH_WRONG_COMPANY.

Match^[0-9a-fA-F]{24}$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/crm/companies/string/archive" \  -H "Content-Type: application/json" \  -d '{}'
{  "dependents": {    "contacts": 0,    "openDeals": 0  },  "status": "needs_decision"}