Companies API

Manage companies — the organizations your contacts belong to.

See also: Contacts & Companies concepts

Endpoints

MethodPathDescription
POST/companiesCreate a company
GET/companiesList companies
GET/companies/:idGet a company
PATCH/companies/:idUpdate a company
DELETE/companies/:idDelete a company
GET/companies/:id/contactsList contacts at a company
GET/companies/:id/dealsList deals for a company

Create a company

POST /companies

Request body

FieldTypeRequiredDescription
namestringyesCompany name
domainstringnoPrimary domain (unique; used for dedup and enrichment)
industrystringnoIndustry vertical
sizestringnoEmployee count range: 1-10, 11-50, 51-200, 201-1000, 1000+
websitestringnoWebsite URL
phonestringnoPhone number
addressobjectnoAddress object with street, city, state, postal_code, country
owner_idstringnoAssigned team member
metadataobjectnoArbitrary key-value data

Example

curl -X POST "$REX_URL/companies" \
  -H "X-Api-Key: $REX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corp",
    "domain": "acme.com",
    "industry": "Technology",
    "size": "51-200"
  }'

Response

{
  "data": {
    "id": "comp_01HQ...",
    "name": "Acme Corp",
    "domain": "acme.com",
    "industry": "Technology",
    "size": "51-200",
    "created_at": "2026-03-16T12:00:00Z",
    "updated_at": "2026-03-16T12:00:00Z"
  }
}

List companies

GET /companies

Query parameters

ParameterTypeDescription
cursorstringPagination cursor
limitintegerResults per page (default 50, max 200)
owner_idstringFilter by owner
industrystringFilter by industry
searchstringSearch by name or domain

Example

curl "$REX_URL/companies?industry=Technology&limit=25" \
  -H "X-Api-Key: $REX_API_KEY"

Response

{
  "data": [
    {
      "id": "comp_01HQ...",
      "name": "Acme Corp",
      "domain": "acme.com",
      "industry": "Technology",
      "size": "51-200",
      "created_at": "2026-03-16T12:00:00Z",
      "updated_at": "2026-03-16T12:00:00Z"
    }
  ],
  "has_more": false
}

Get a company

GET /companies/:id

Example

curl "$REX_URL/companies/comp_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY"

Response

{
  "data": {
    "id": "comp_01HQ...",
    "name": "Acme Corp",
    "domain": "acme.com",
    "industry": "Technology",
    "size": "51-200",
    "website": "https://acme.com",
    "phone": "+1-555-0200",
    "address": {
      "street": "123 Main St",
      "city": "San Francisco",
      "state": "CA",
      "postal_code": "94105",
      "country": "US"
    },
    "owner_id": "user_01HQ...",
    "parent_company_id": null,
    "last_activity_at": "2026-03-15T14:30:00Z",
    "days_since_last_activity": 1,
    "metadata": {},
    "relationships": {
      "owner": { "type": "user", "id": "user_01HQ...", "name": "Jane Smith" }
    },
    "created_at": "2026-03-16T12:00:00Z",
    "updated_at": "2026-03-16T12:00:00Z"
  },
  "included": [
    { "type": "user", "id": "user_01HQ...", "name": "Jane Smith" }
  ]
}

Update a company

PATCH /companies/:id

All fields from the create request body are accepted. Only provided fields are updated.

Example

curl -X PATCH "$REX_URL/companies/comp_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "size": "201-1000",
    "industry": "Enterprise Software"
  }'

Response

Returns the full updated company in the same format as Get a company.

Delete a company

DELETE /companies/:id

Example

curl -X DELETE "$REX_URL/companies/comp_01HQ..." \
  -H "X-Api-Key: $REX_API_KEY"

Response

204 No Content on success.

List contacts at a company

GET /companies/:id/contacts

Returns contacts linked to this company. Supports cursor and limit query parameters.

Example

curl "$REX_URL/companies/comp_01HQ.../contacts" \
  -H "X-Api-Key: $REX_API_KEY"

Response

{
  "data": [
    {
      "id": "cont_01HQ...",
      "email": "ada@acme.com",
      "first_name": "Ada",
      "last_name": "Lovelace",
      "stage": "customer",
      "source": "organic",
      "company_id": "comp_01HQ...",
      "created_at": "2026-03-16T12:00:00Z",
      "updated_at": "2026-03-16T12:00:00Z"
    }
  ],
  "has_more": false
}

List deals for a company

GET /companies/:id/deals

Returns deals linked to this company. Supports cursor and limit query parameters.

Example

curl "$REX_URL/companies/comp_01HQ.../deals" \
  -H "X-Api-Key: $REX_API_KEY"

Response

{
  "data": [
    {
      "id": "deal_01HQ...",
      "name": "Acme Enterprise Plan",
      "pipeline_id": "pipe_01HQ...",
      "stage_id": "stg_01HQ...",
      "value": 500000,
      "currency": "USD",
      "status": "open",
      "company_id": "comp_01HQ...",
      "created_at": "2026-03-16T12:00:00Z",
      "updated_at": "2026-03-16T12:00:00Z"
    }
  ],
  "has_more": false
}

Was this page helpful?

·