---
title: "Apply proposed contact-to-company links"
method: POST
path: "/directory/contact-company-links"
tags: ["directory"]
---

# Apply proposed contact-to-company links

`POST /directory/contact-company-links`

## Request

- Base URL: `https://api.cogram.com/v1`
- URL: `https://api.cogram.com/v1/directory/contact-company-links`
- Auth: HTTP bearer

Set the company on contacts that have none, from their email domain.

Applies the proposal `GET /directory/contact-company-links` returns, or the
part of it named by `contact_ids`. Read that first: a company carrying a
consumer domain such as `gmail.com` claims every personal address in the
organization, and this endpoint cannot tell that apart from a real firm.

The proposal is recomputed here rather than carried over from the `GET`, so
`contact_ids` chooses contacts, not companies: if the company that won a
contested domain is archived in between, the runner-up wins this call. The
`applied` list names the company each contact actually got, so compare it
against what you reviewed.

Keep the `applied` list the response returns. It names every contact this
call gave a company to, and nothing else records which contacts had none
beforehand — so it is what a bad run has to be reversed from.

A contact that already has a company is never touched, whether it had one
all along or gained one between the read and this call. Safe to repeat —
a second call with nothing left to do links nothing.

## Request body

- ContactCompanyLinkApplyV1: Which of the proposed links to write.
  - `contact_ids` string[], nullable: Apply only the proposed links for these contacts. Omit to apply every one. Ids that are not currently proposed are ignored, so a list built from an earlier `GET` cannot link a contact whose company has since been set. The 1000-id ceiling bounds the request body, not the write: omitting the field still applies the whole proposal.

## Response `200`

Successful Response

- ContactCompanyLinkApplyResultV1: What the write did.
  - `applied` AppliedLinkV1[], required: Every link this call wrote, contact by contact. Keep it: it names the contacts that held no company before the call, and it is therefore the only way to reverse a run that linked the wrong company — Cogram cannot tell a firm's domain from a consumer one.
    - `contact_id` string, required
    - `company_id` string, required
  - `linked` integer, required: Contacts given a company by this call.
  - `skipped` integer, required: Proposed links this call did not write, because the contact gained a company between the read and the write. An existing company is never overwritten.

## Other responses

- `401`: Unauthorized
- `422`: Validation error
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/cogram/apis/cogram-api.md) · [All operations](https://skmtc.dev/cogram/apis/cogram-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cogram/apis/cogram-api/revisions/5a3c9c40fca5?raw)
