Crm companies

Get a CRM company

Returns the company with its tags and custom field values. Archived companies and ids from another company return 404. A company shared with you through a chain lead comes back with `sharedViaChain` set.

GET
/crm/companies/{id}

Returns the company with its tags and custom field values. Archived companies and ids from another company return 404. A company shared with you through a chain lead comes back with sharedViaChain set.

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}$

Response Body

application/json

curl -X GET "https://example.com/crm/companies/string"
{  "accountingCustomerId": "string",  "archiveBatchId": "string",  "archivedAt": "2019-08-24T14:15:22Z",  "companyId": "string",  "createdAt": "2019-08-24T14:15:22Z",  "customFields": [    {      "fieldId": "string",      "iconName": "string",      "key": "string",      "label": "string",      "options": [        {          "colorHex": "string",          "id": "string",          "label": "string",          "order": 0        }      ],      "type": "Checkbox",      "values": [        "string"      ]    }  ],  "dedupOrgNumber": "string",  "deletedAt": "2019-08-24T14:15:22Z",  "id": "string",  "isExample": true,  "itxCorporateId": "string",  "itxLastSyncedAt": "2019-08-24T14:15:22Z",  "lastActivityActorId": "string",  "lastActivityAt": "2019-08-24T14:15:22Z",  "lastWebhookOccurredAt": "2019-08-24T14:15:22Z",  "metadata": {    "itx": {      "snapshot": {        "active": true,        "contactEmails": [          "string"        ],        "corpId": 0,        "deliveryAddresses": [          {            "apartment": "string",            "country": "string",            "countryCode": "string",            "floor": 0,            "line1": "string",            "line2": "string",            "postBox": "string",            "postalCity": "string",            "postalCode": "string",            "street": "string",            "streetNumber": "string"          }        ],        "faxNumbers": [          "string"        ],        "id": 0,        "invoiceAddresses": [          {            "apartment": "string",            "country": "string",            "countryCode": "string",            "floor": 0,            "line1": "string",            "line2": "string",            "postBox": "string",            "postalCity": "string",            "postalCode": "string",            "street": "string",            "streetNumber": "string"          }        ],        "invoiceEmails": [          "string"        ],        "landLineNumbers": [          "string"        ],        "mainAddresses": [          {            "apartment": "string",            "country": "string",            "countryCode": "string",            "floor": 0,            "line1": "string",            "line2": "string",            "postBox": "string",            "postalCity": "string",            "postalCode": "string",            "street": "string",            "streetNumber": "string"          }        ],        "mobileNumbers": [          "string"        ],        "officeNumbers": [          "string"        ],        "postalAddresses": [          {            "apartment": "string",            "country": "string",            "countryCode": "string",            "floor": 0,            "line1": "string",            "line2": "string",            "postBox": "string",            "postalCity": "string",            "postalCode": "string",            "street": "string",            "streetNumber": "string"          }        ],        "switchboardNumbers": [          "string"        ],        "visitAddresses": [          {            "apartment": "string",            "country": "string",            "countryCode": "string",            "floor": 0,            "line1": "string",            "line2": "string",            "postBox": "string",            "postalCity": "string",            "postalCode": "string",            "street": "string",            "streetNumber": "string"          }        ],        "property1": null,        "property2": null      },      "snapshotAt": "string"    }  },  "naceCode": "string",  "naceDescription": "string",  "name": "string",  "number": 0,  "orgForm": "string",  "orgNumber": "string",  "orgNumberVerified": true,  "registeredAddress": "string",  "registryRefreshedAt": "2019-08-24T14:15:22Z",  "registryStatus": "string",  "sharedViaChain": true,  "sharedViaChainName": "string",  "tags": [    {      "colorHex": "string",      "label": "string",      "optionId": "string"    }  ],  "updatedAt": "2019-08-24T14:15:22Z"}

Create a CRM company POST

Creates a business customer. When another company already has the org number, nothing is created and the response has `status` `duplicate` with the matches. Send `force: true` to create it anyway; both are then flagged as possible duplicates.

List CRM companies GET

Returns one page of the business customers in your CRM, sorted by name unless `sortBy` says otherwise. Archived companies are left out by default. Query parameters: - `search`: matches the name ignoring case, the org number, or the company number when the term is a whole number. - `registryStatus`: only companies with this registry status, for example `Active`. - `naceCode`: only companies with this industry code, for example `43.210`. - `page`: page number, starting at 1. Defaults to 1. - `limit`: companies per page, 1 to 100. Defaults to 50. - `sortBy`: `name` (default), `createdAt` or `lastActivityAt`. - `sortDir`: `asc` or `desc`. Defaults to `asc`, and to `desc` when sorting by `lastActivityAt`. - `includeArchived`: `true` adds archived companies to the list. - `archivedOnly`: `true` returns only archived companies. Wins over `includeArchived`. - `createdFrom`, `createdTo`: ISO 8601 date-times. Only companies created within the range, both ends included. - `chainRecordId`: a record assigned to you through your chain. Lists the companies of the chain company that owns it instead of your own. - `chainScope`: what kind of record `chainRecordId` is: `Deal` (default), `Contact`, `Company` or `Order`.