API Reference
The reference below covers every endpoint in the Companies API. Code examples are generated automatically; the live playground is disabled to prevent accidental writes to production from the docs site.
/api/v1/companiesAuthorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/companies" \ -H "Content-Type: application/json" \ -d '{ "companies": [ { "name": "Acme Corp", "domain": "acme.com", "industry": "Retail", "externalId": "SHOP-CO-1" } ] }'{ "created": 1, "updated": 1, "errors": 0, "results": [ { "index": 0, "status": "created", "id": "018e2a4b-0000-7000-8000-aabbccddeeff" }, { "index": 1, "status": "updated", "id": "018e2a4b-1111-7000-8000-aabbccddeeff" } ]}{ "created": 1, "updated": 0, "errors": 1, "results": [ { "index": 0, "status": "created", "id": "018e2a4b-0000-7000-8000-aabbccddeeff" }, { "index": 1, "status": "error", "error": "name: String must contain at least 1 character(s)" } ]}{ "error": "companies must not be empty."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:products."}{ "error": "Rate limit exceeded."}/api/v1/companiesAuthorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Query Parameters
Filter to the company with this exact domain.
Filter to the company with this external ID.
Filter to the companies owned by this workspace user. An id that owns nothing returns an empty list, not an error.
Only companies updated at or after this ISO 8601 datetime.
date-timePage size.
1 <= value <= 1000100The nextCursor value from the previous page.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/companies?domain=acme.com&externalId=hs_company_42&ownerId=cmq9user0alk34567890"{ "companies": [ { "id": "cmq2comp0alk34567890", "name": "Acme Corp", "domain": "acme.com", "industry": "string", "size": "string", "website": "string", "notes": "string", "parentId": "cmq2hold0alk34567890", "owner": { "id": "cmq9user0alk34567890", "name": "Kevin Rep" }, "externalId": "hs_company_42", "customFields": {}, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" } ], "nextCursor": "string"}{ "error": "limit must be an integer between 1 and 1000."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: read:companies."}{ "error": "Rate limit exceeded."}/api/v1/companies/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
The company's AgentlyLeads ID, or its externalId.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/api/v1/companies/string"{ "deleted": 1, "id": "cmq2cont0alk34567891"}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:companies."}{ "error": "Company not found."}{ "error": "Rate limit exceeded."}