API reference
Clients
The businesses you request access from. Store your own ID on each client as externalClientId to find it again without keeping ours.
Create a client
POST/clients Creates a client. Set externalClientId to your own ID for the client so you can find it again with GET /clients?externalClientId=; it is unique within your agency and cannot be changed once set. Emails are not unique: creating a client with an existing email makes another client.
Headers
-
Idempotency-Keystring requiredA unique value per create, such as a UUID (1-255 visible ASCII characters). Retrying with the same key and body returns the original result instead of creating another object; keys are kept for 24 hours.
Body
-
namestring requiredThe contact person's name. Up to 200 characters.
-
emailstring requiredUp to 320 characters.
-
companystring | nullBlank becomes null. Up to 200 characters.
-
websitestring | nullBlank becomes null. Not checked as a URL. Up to 2048 characters.
-
languagestringThe language of the client's pages and emails. One of
English,Spanish,Dutch. Default"English". -
metadataobjectUp to 50 string values (keys up to 100 characters).
-
externalClientIdstringYour ID for the client: unique within your agency, case-sensitive, no surrounding spaces. Cannot be changed once set. Up to 255 characters.
Returns
201 The new client.
Fields (object)
-
iduuid required -
externalClientIdstring | null requiredYour ID for the client, unique within your agency.
-
namestring requiredThe contact person's name.
-
emailstring required -
companystring | null required -
websitestring | null required -
languagestring requiredThe language of the client's pages and emails. One of
English,Spanish,Dutch. -
metadataobject requiredYour own string values.
-
createdAtdatetime required
- 400 The request is invalid (
VALIDATION_FAILED);detailslists the problems, withfieldwhen one applies. - 401 The API key is missing, invalid or revoked.
- 403 The key lacks the scope (
CAPABILITY_REQUIRED), the plan has no API access (PLAN_NOT_ENTITLED), or, when creating a request, the monthly limit is reached (PLAN_LIMIT_REACHED). - 409 A conflict: an
externalClientIdin use or immutable, an Idempotency-Key reused with a different body or still in progress, or a request in a state that does not allow this. - 429 Rate limited (
RATE_LIMITED); wait forRetry-Afterseconds.
curl -X POST "https://api.agencyaccess.co/api/v2/clients" \
-H "Authorization: Bearer $AGENCYACCESS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"name": "Jamie Rivera",
"email": "jamie@northwindcoffee.com",
"company": "Northwind Coffee",
"website": "https://northwindcoffee.com",
"externalClientId": "crm-4821",
"metadata": {
"accountManager": "Priya"
}
}
JSON const res = await fetch("https://api.agencyaccess.co/api/v2/clients", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AGENCYACCESS_API_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Jamie Rivera",
"email": "jamie@northwindcoffee.com",
"company": "Northwind Coffee",
"website": "https://northwindcoffee.com",
"externalClientId": "crm-4821",
"metadata": {
"accountManager": "Priya"
}
}),
})
const { data } = await res.json() {
"data": {
"id": "7c1e9f52-3b8a-4d2e-9a61-5f0c2d8b4e17",
"externalClientId": "crm-4821",
"name": "Jamie Rivera",
"email": "jamie@northwindcoffee.com",
"company": "Northwind Coffee",
"website": "https://northwindcoffee.com",
"language": "English",
"metadata": {
"accountManager": "Priya"
},
"createdAt": "2026-10-07T09:12:44.000Z"
},
"meta": {
"requestId": "req_1f0b6c2e9a7d4f58b3c1e6a9d2f4b7c0"
}
} List clients
GET/clients Lists all your clients and prospects, including those created in the dashboard and on access pages, oldest first. Filter by externalClientId to find one client by your own ID, or by email (several clients can share an email).
Query parameters
-
limitintegerResults per page, 1-100.
-
cursorstringThe
meta.nextCursorof the previous page. Cursors only work with the filters they were issued for. -
externalClientIdstringOnly the client with this external ID (case-sensitive).
-
emailstringOnly clients with this email (case-insensitive).
Returns
200 A page of clients.
Fields of each item (object)
-
iduuid required -
externalClientIdstring | null requiredYour ID for the client, unique within your agency.
-
namestring requiredThe contact person's name.
-
emailstring required -
companystring | null required -
websitestring | null required -
languagestring requiredThe language of the client's pages and emails. One of
English,Spanish,Dutch. -
metadataobject requiredYour own string values.
-
createdAtdatetime required
- 400 The request is invalid (
VALIDATION_FAILED);detailslists the problems, withfieldwhen one applies. - 401 The API key is missing, invalid or revoked.
- 403 The key lacks the scope (
CAPABILITY_REQUIRED), the plan has no API access (PLAN_NOT_ENTITLED), or, when creating a request, the monthly limit is reached (PLAN_LIMIT_REACHED). - 429 Rate limited (
RATE_LIMITED); wait forRetry-Afterseconds.
curl "https://api.agencyaccess.co/api/v2/clients?externalClientId=crm-4821" \
-H "Authorization: Bearer $AGENCYACCESS_API_KEY" const res = await fetch("https://api.agencyaccess.co/api/v2/clients?externalClientId=crm-4821", {
headers: {
Authorization: `Bearer ${process.env.AGENCYACCESS_API_KEY}`,
},
})
const { data, meta } = await res.json()
// meta.nextCursor: pass as ?cursor= for the next page {
"data": [
{
"id": "7c1e9f52-3b8a-4d2e-9a61-5f0c2d8b4e17",
"externalClientId": "crm-4821",
"name": "Jamie Rivera",
"email": "jamie@northwindcoffee.com",
"company": "Northwind Coffee",
"website": "https://northwindcoffee.com",
"language": "English",
"metadata": {
"accountManager": "Priya"
},
"createdAt": "2026-10-07T09:12:44.000Z"
}
],
"meta": {
"requestId": "req_1f0b6c2e9a7d4f58b3c1e6a9d2f4b7c0",
"nextCursor": null
}
} Retrieve a client
GET/clients/{id} Path parameters
-
iduuid requiredThe client ID.
Returns
200 The client.
Fields (object)
-
iduuid required -
externalClientIdstring | null requiredYour ID for the client, unique within your agency.
-
namestring requiredThe contact person's name.
-
emailstring required -
companystring | null required -
websitestring | null required -
languagestring requiredThe language of the client's pages and emails. One of
English,Spanish,Dutch. -
metadataobject requiredYour own string values.
-
createdAtdatetime required
- 401 The API key is missing, invalid or revoked.
- 403 The key lacks the scope (
CAPABILITY_REQUIRED), the plan has no API access (PLAN_NOT_ENTITLED), or, when creating a request, the monthly limit is reached (PLAN_LIMIT_REACHED). - 404 Not found, or it belongs to another agency.
- 429 Rate limited (
RATE_LIMITED); wait forRetry-Afterseconds.
curl "https://api.agencyaccess.co/api/v2/clients/7c1e9f52-3b8a-4d2e-9a61-5f0c2d8b4e17" \
-H "Authorization: Bearer $AGENCYACCESS_API_KEY" const res = await fetch("https://api.agencyaccess.co/api/v2/clients/7c1e9f52-3b8a-4d2e-9a61-5f0c2d8b4e17", {
headers: {
Authorization: `Bearer ${process.env.AGENCYACCESS_API_KEY}`,
},
})
const { data } = await res.json() {
"data": {
"id": "7c1e9f52-3b8a-4d2e-9a61-5f0c2d8b4e17",
"externalClientId": "crm-4821",
"name": "Jamie Rivera",
"email": "jamie@northwindcoffee.com",
"company": "Northwind Coffee",
"website": "https://northwindcoffee.com",
"language": "English",
"metadata": {
"accountManager": "Priya"
},
"createdAt": "2026-10-07T09:12:44.000Z"
},
"meta": {
"requestId": "req_1f0b6c2e9a7d4f58b3c1e6a9d2f4b7c0"
}
} Update a client
PATCH/clients/{id} Changes the fields you send. externalClientId can be set on a client that has none; changing an existing one returns 409 EXTERNAL_CLIENT_ID_IMMUTABLE. Send null or an empty string to clear company or website.
Path parameters
-
iduuid requiredThe client ID.
Body
Send only the fields to change.
-
namestringUp to 200 characters.
-
emailstringUp to 320 characters.
-
companystring | nullUp to 200 characters.
-
websitestring | nullUp to 2048 characters.
-
languagestringThe language of the client's pages and emails. One of
English,Spanish,Dutch. -
metadataobjectReplaces all metadata.
-
externalClientIdstringOnly when the client has none yet. Up to 255 characters.
Returns
200 The updated client.
Fields (object)
-
iduuid required -
externalClientIdstring | null requiredYour ID for the client, unique within your agency.
-
namestring requiredThe contact person's name.
-
emailstring required -
companystring | null required -
websitestring | null required -
languagestring requiredThe language of the client's pages and emails. One of
English,Spanish,Dutch. -
metadataobject requiredYour own string values.
-
createdAtdatetime required
- 400 The request is invalid (
VALIDATION_FAILED);detailslists the problems, withfieldwhen one applies. - 401 The API key is missing, invalid or revoked.
- 403 The key lacks the scope (
CAPABILITY_REQUIRED), the plan has no API access (PLAN_NOT_ENTITLED), or, when creating a request, the monthly limit is reached (PLAN_LIMIT_REACHED). - 404 Not found, or it belongs to another agency.
- 409 A conflict: an
externalClientIdin use or immutable, an Idempotency-Key reused with a different body or still in progress, or a request in a state that does not allow this. - 429 Rate limited (
RATE_LIMITED); wait forRetry-Afterseconds.
curl -X PATCH "https://api.agencyaccess.co/api/v2/clients/7c1e9f52-3b8a-4d2e-9a61-5f0c2d8b4e17" \
-H "Authorization: Bearer $AGENCYACCESS_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"company": "Northwind Coffee Roasters",
"metadata": {
"accountManager": "Sam"
}
}
JSON const res = await fetch("https://api.agencyaccess.co/api/v2/clients/7c1e9f52-3b8a-4d2e-9a61-5f0c2d8b4e17", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.AGENCYACCESS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"company": "Northwind Coffee Roasters",
"metadata": {
"accountManager": "Sam"
}
}),
})
const { data } = await res.json() {
"data": {
"id": "7c1e9f52-3b8a-4d2e-9a61-5f0c2d8b4e17",
"externalClientId": "crm-4821",
"name": "Jamie Rivera",
"email": "jamie@northwindcoffee.com",
"company": "Northwind Coffee Roasters",
"website": "https://northwindcoffee.com",
"language": "English",
"metadata": {
"accountManager": "Sam"
},
"createdAt": "2026-10-07T09:12:44.000Z"
},
"meta": {
"requestId": "req_1f0b6c2e9a7d4f58b3c1e6a9d2f4b7c0"
}
}