# Companies

Company records with firmographics, pipeline rollups and attribution, whether or not a CRM is connected.

Source: https://sourceloop.ai/help/api/companies/

---

| Endpoint | Method | Path | Permission |
| --- | --- | --- | --- |
| List companies | GET | `/v1/companies` | `companies:read` |
| Get company | GET | `/v1/companies/{id}` | `companies:read` |
| Update company | PATCH | `/v1/companies/{id}` | `companies:write` |
| Get company journey | GET | `/v1/companies/{id}/journey` | `companies:read` |

Base URL: `https://app.sourceloop.ai/api/v1`

## List companies

`GET /v1/companies`

Companies, with firmographics, pipeline rollups and attribution

Requires scope: `companies:read`

Unlike deals, this does NOT require a CRM. A company record comes either from a
connected CRM or from our own domain resolution off a captured lead email, and
`source` on each row says which. So this answers "which companies are on my
site" even with no CRM at all.

Personal email domains (gmail and similar) are excluded by default: they are one
person, not a company. Pass include_personal=true to keep them.

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `website` | string | no | Website domain, e.g. acme.com. Required only when the key covers more than one. |
| `domain` | string | no |  |
| `industry` | string | no |  |
| `country` | string | no |  |
| `lifecycle_stage` | string | no |  |
| `has_deals` | boolean | no |  |
| `has_open_deals` | boolean | no |  |
| `channel` | string | no | First-touch channel. |
| `include_personal` | boolean | no |  |
| `sort` | string | no |  |
| `cursor` | string | no |  |
| `limit` | integer | no |  |
| `total_count` | boolean | no | Include meta.total_count, the exact number of matching rows. Off by default because counting scans every match while the page itself reads one page, so on a large workspace the count costs far more than the rows. Paginate with has_more and next_cursor unless you are rendering "70 of 366". |

### Responses

- `200` Companies
- `429` Too many requests for this workspace in the current minute. Wait Retry-After seconds and repeat the request unchanged.

### Example (cURL)

```bash
curl -s -X GET "https://app.sourceloop.ai/api/v1/companies?website=acme.com" \
  -H "Authorization: Bearer $SOURCELOOP_API_KEY"
```

### Example (Node)

```javascript
const res = await fetch(
  "https://app.sourceloop.ai/api/v1/companies?website=acme.com",
  {
    method: "GET",
    headers: {
      Authorization: `Bearer ${process.env.SOURCELOOP_API_KEY}`,
    },
  },
);

const data = await res.json();
```

### Example (Python)

```python
import os, requests

res = requests.get(
    "https://app.sourceloop.ai/api/v1/companies?website=acme.com",
    headers={"Authorization": f"Bearer {os.environ['SOURCELOOP_API_KEY']}"},
)
data = res.json()
```

## Get company

`GET /v1/companies/{id}`

One company, with its deals and its people

Requires scope: `companies:read`

The account-based view: firmographics, pipeline rollups, attribution, every deal attached to the company, and the people from it aggregated so the same person is not counted twice.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes |  |

### Responses

- `200` Company detail
- `404` Something was wrong with the request or the credential.
- `429` Too many requests for this workspace in the current minute. Wait Retry-After seconds and repeat the request unchanged.

### Example (cURL)

```bash
curl -s -X GET "https://app.sourceloop.ai/api/v1/companies/{id}" \
  -H "Authorization: Bearer $SOURCELOOP_API_KEY"
```

### Example (Node)

```javascript
const res = await fetch(
  "https://app.sourceloop.ai/api/v1/companies/{id}",
  {
    method: "GET",
    headers: {
      Authorization: `Bearer ${process.env.SOURCELOOP_API_KEY}`,
    },
  },
);

const data = await res.json();
```

### Example (Python)

```python
import os, requests

res = requests.get(
    "https://app.sourceloop.ai/api/v1/companies/{id}",
    headers={"Authorization": f"Bearer {os.environ['SOURCELOOP_API_KEY']}"},
)
data = res.json()
```

## Update company

`PATCH /v1/companies/{id}`

Correct a company's firmographics

Requires scope: `companies:write`

Most companies here were discovered from traffic and identity stitching rather
than imported from a CRM, so nobody else owns them and this is a plain local
write. When a company IS linked to a CRM connection the write still lands and
the response carries a `warning` saying the next sync will overwrite it.

Engagement counts, deal rollups and every first_*/latest_* attribution column
are computed by Sourceloop and are refused rather than ignored.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes |  |

### Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | no |  |

### Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `company_name` | string | no |  |
| `industry` | string | no |  |
| `size_range` | string | no |  |
| `employee_count` | integer | no |  |
| `annual_revenue` | number | no |  |
| `country` | string | no |  |
| `region` | string | no |  |
| `city` | string | no |  |
| `website_url` | string | no |  |
| `description` | string | no |  |
| `linkedin_url` | string | no |  |

### Responses

- `200` Updated, or unchanged
- `403` Something was wrong with the request or the credential.
- `404` Something was wrong with the request or the credential.
- `429` Too many requests for this workspace in the current minute. Wait Retry-After seconds and repeat the request unchanged.

### Example (cURL)

```bash
curl -s -X PATCH "https://app.sourceloop.ai/api/v1/companies/{id}" \
  -H "Authorization: Bearer $SOURCELOOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "industry": "Logistics",
    "employee_count": 240
  }'
```

### Example (Node)

```javascript
const res = await fetch(
  "https://app.sourceloop.ai/api/v1/companies/{id}",
  {
    method: "PATCH",
    headers: {
      Authorization: `Bearer ${process.env.SOURCELOOP_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "industry": "Logistics",
      "employee_count": 240
    }),
  },
);

const data = await res.json();
```

### Example (Python)

```python
import os, requests

res = requests.patch(
    "https://app.sourceloop.ai/api/v1/companies/{id}",
    headers={"Authorization": f"Bearer {os.environ['SOURCELOOP_API_KEY']}"},
    json={
      "industry": "Logistics",
      "employee_count": 240
    },
)
data = res.json()
```

## Get company journey

`GET /v1/companies/{id}/journey`

The account journey: everyone at the company, merged

Requires scope: `companies:read`

Every session by every person at the company, ordered across all of them, because in B2B the person who first read a blog post is rarely the person who signs. people_count reports how many were merged.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes |  |

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `days` | integer | no |  |

### Responses

- `200` Journey
- `404` Something was wrong with the request or the credential.
- `429` Too many requests for this workspace in the current minute. Wait Retry-After seconds and repeat the request unchanged.

### Example (cURL)

```bash
curl -s -X GET "https://app.sourceloop.ai/api/v1/companies/{id}/journey?days=365" \
  -H "Authorization: Bearer $SOURCELOOP_API_KEY"
```

### Example (Node)

```javascript
const res = await fetch(
  "https://app.sourceloop.ai/api/v1/companies/{id}/journey?days=365",
  {
    method: "GET",
    headers: {
      Authorization: `Bearer ${process.env.SOURCELOOP_API_KEY}`,
    },
  },
);

const data = await res.json();
```

### Example (Python)

```python
import os, requests

res = requests.get(
    "https://app.sourceloop.ai/api/v1/companies/{id}/journey?days=365",
    headers={"Authorization": f"Bearer {os.environ['SOURCELOOP_API_KEY']}"},
)
data = res.json()
```
