# Add a company

```http
POST https://trydimmi.com/api/v1/companies
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `contacts:write`.

## Query parameters

- `upsert` (string): true to find or add by external id, then domain. A plain create needs a name.

## Body

- `custom_attributes` (object): The company's custom attribute values, as an object of attribute key to value, with keys as GET /attribute-definitions defines them for companies. When the company already exists they are merged over the ones it has. Such as {"plan": "enterprise"}.
- `domain` (string): The company's domain name, at most 255 characters, such as acme.com. When a company is looked up (a contact's company, or an upsert), it is found by external_id first, then by this; a contact's company needs one of the two.
- `external_id` (string): Your own system's id of the company, 1 to 255 characters, such as org_512. When a company is looked up (a contact's company, or an upsert), it is found by this first, then by domain; a new one is added when none matches.
- `name` (string): The company's name, 1 to 255 characters, such as Acme Inc.

## Response 201 (Created)

- `data` (object, required)
  - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `custom_attributes` (any, required): The company's custom attributes as an object of names and values, such as {"plan": "pro"}. An empty object when it has none.
  - `domain` (string | null, required): The company's web domain, such as acme.com, used to match it when it has no external id. Null when unknown.
  - `external_id` (string | null, required): The company's id in your own system, unique within the workspace. Null when none was given.
  - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
  - `name` (string, required): The company's name.
  - `notes` (string | null, required): Free-text notes the team keeps about the company. Null when there are none.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `people_count` (integer): How many contacts belong to the company. Given only in lists; absent when one company is read.
  - `tags` (object[] | null, required): The tags on the company, each with its id and name.
    - `color` (string | null, required): The tag's color as a hex value, such as #ff5500, kept as the workspace wrote it; null when it has none.
    - `icon` (string | null, required): Name of the tag's icon; null when it has none.
    - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
    - `name` (string, required): The tag's name.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `updated_at` (string, required): When it last changed, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
- `meta` (object)
  - `possible_duplicates` (object[] | null): Other contacts that may be the same person, such as a lead who only typed the same email address, for a teammate to judge. Left out when there are none.
    - `avatar_url` (string | null, required): URL of the contact's picture. Null when they have none.
    - `email` (string | null, required): The contact's email address. Null when unknown.
    - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
    - `kind` (string, required): How well the contact is known: user when your app identified them, lead for anyone else.
    - `name` (string | null, required): The contact's name. Null when unknown.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
    - `timezone` (string | null, required): The contact's IANA time zone, such as Europe/Berlin, for reading times in their local time. Null when unknown.
  - `upserted` (string, required): Whether the request added the record or changed an existing one: created or updated.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request POST \
  --url 'https://trydimmi.com/api/v1/companies' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "custom_attributes": {
    "<key>": null
  },
  "domain": "<string>",
  "external_id": "<string>",
  "name": "<string>"
}'
```

## Example response

```json
{
  "data": {
    "created_at": "2026-11-01T09:30:00Z",
    "custom_attributes": null,
    "domain": "<string>",
    "external_id": "<string>",
    "id": "<string>",
    "name": "<string>",
    "notes": "<string>",
    "object": "<string>",
    "people_count": 123,
    "tags": [
      {
        "color": "<string>",
        "icon": "<string>",
        "id": "<string>",
        "name": "<string>",
        "object": "<string>"
      }
    ],
    "updated_at": "2026-11-01T09:30:00Z"
  },
  "meta": {
    "possible_duplicates": [
      {
        "avatar_url": "<string>",
        "email": "<string>",
        "id": "<string>",
        "kind": "<string>",
        "name": "<string>",
        "object": "<string>",
        "timezone": "<string>"
      }
    ],
    "upserted": "<string>"
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
