Create or update a company (upsert)

Creates a new company or updates an existing one based on the provided identifiers.
This endpoint is idempotent and will never create duplicates.

How It Works

  • If a company exists (based on identifiers), it will be updated
  • If no company exists, a new one will be created
  • Returns 201 Created for new companies, 200 OK for updated companies

How Identifiers Work

You must provide at least one identifier:

  • company_id: Internal Customerly ID (if specified, must exist)
  • custom_company_id: Your custom identifier (company_id in your system)

Priority order:

  1. company_id (internal ID) - if provided, must exist
  2. custom_company_id - if no internal ID, we'll search by this

Conflict Detection

If multiple identifiers are provided, they must either:

  • All point to the same company, OR
  • Point to no existing company (new company creation), OR
  • company_id exists and other identifiers are "free" (will update the company_id company)

If different identifiers point to different companies, the request will fail with a conflict error.

Attributes

  • Attributes: Merged incrementally (only specified attributes are created/updated, others remain unchanged)
  • You can provide any custom key-value pairs in the attributes object

Response Data

The endpoint returns the complete company object including:

  • All company basic information (ID, name, created date, last seen)
  • All attributes (both updated and unchanged ones)
  • Total number of contacts associated with this company
  • HTTP status: 201 Created for new companies, 200 OK for updated companies
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
integer

Internal Customerly company ID (if specified, must exist)

string

Your custom company identifier

string

Company name

attributes
object

Custom attributes as key-value pairs

Responses

401

Authentication credentials are missing or invalid

403

You don't have permission to create/update companies

404

company_id specified but not found

409

Conflicting identifiers: the provided identifiers point to different companies

422

Validation error: check that at least one identifier is provided and all values are valid

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json