API Reference
The reference below covers every endpoint in the Custom Fields API. Code examples are generated automatically; the live playground is disabled to prevent accidental writes to production from the docs site.
/api/v1/custom-fieldsAuthorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Query Parameters
Only fields on this record type. Case-insensitive. Omit for all.
Value in
- "CONTACT"
- "LEAD"
- "DEAL"
- "COMPANY"
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/custom-fields"{ "customFields": [ { "id": "cmq5cfd00alk34567890", "entity": "DEAL", "key": "deal_size", "label": "Deal size", "type": "SELECT", "options": [ "Small", "Large" ], "required": false, "order": 0, "createdAt": "2026-09-27T14:02:00.000Z", "updatedAt": "2026-09-27T14:02:00.000Z" } ]}{ "error": "entity must be one of: CONTACT, LEAD, DEAL, COMPANY."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: read:custom-fields."}{ "error": "Rate limit exceeded."}/api/v1/custom-fieldsAuthorization
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
curl -X POST "https://example.com/api/v1/custom-fields" \ -H "Content-Type: application/json" \ -d '{ "entity": "DEAL", "label": "Deal size", "type": "SELECT", "options": [ "Small", "Large" ] }'{ "customField": { "id": "cmq5cfd00alk34567890", "entity": "DEAL", "key": "deal_size", "label": "Deal size", "type": "SELECT", "options": [ "Small", "Large" ], "required": false, "order": 0, "createdAt": "2026-09-27T14:02:00.000Z", "updatedAt": "2026-09-27T14:02:00.000Z" }}{ "error": "options only apply to SELECT and MULTISELECT fields."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:custom-fields."}{ "error": "Rate limit exceeded."}/api/v1/custom-fields/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
The custom field's ID.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/custom-fields/string"{ "customField": { "id": "cmq5cfd00alk34567890", "entity": "DEAL", "key": "deal_size", "label": "Deal size", "type": "SELECT", "options": [ "Small", "Large" ], "required": false, "order": 0, "createdAt": "2026-09-27T14:02:00.000Z", "updatedAt": "2026-09-27T14:02:00.000Z" }}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: read:custom-fields."}{ "error": "Custom field not found."}{ "error": "Rate limit exceeded."}/api/v1/custom-fields/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
The custom field's ID.
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 PATCH "https://example.com/api/v1/custom-fields/string" \ -H "Content-Type: application/json" \ -d '{ "options": [ "Small", "Medium", "Large" ] }'{ "customField": { "id": "string", "entity": "CONTACT", "key": "string", "label": "string", "type": "TEXT", "options": [ "string" ], "required": true, "order": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }}{ "error": "A field's type, key and entity can't be changed. Delete it and create a new one instead."}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:custom-fields."}{ "error": "Custom field not found."}{ "error": "Rate limit exceeded."}/api/v1/custom-fields/{id}Authorization
BearerAuth Pass an API key issued from the agentlyleads workspace settings.
Example: Authorization: Bearer alk_live_xxxxxxxxxxxx
In: header
Path Parameters
The custom field's ID.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/api/v1/custom-fields/string"{ "deleted": 1, "id": "string"}{ "error": "Invalid or missing API key."}{ "error": "API key missing required scope: write:custom-fields."}{ "error": "Custom field not found."}{ "error": "Rate limit exceeded."}