Crm API
CRM REST API for customers, suppliers, contacts, addresses, people, notes, tags, files, imports, exports, and contact management.
Generated from the Celerp 2.5.0 OpenAPI schema, 21 September 2026.
GET /crm/contacts
List Contacts
Return CRM contacts with optional search, contact-type, deleted-record, and pagination filters.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
q | query | -- | string | Search text used to filter matching records. |
limit | query | -- | integer | Maximum number of records to return. |
offset | query | -- | integer | Number of matching records to skip before returning results. |
contact_type | query | -- | string, optional | Contact type used to filter CRM contacts, such as customer or supplier when supported. |
include_deleted | query | -- | boolean | Whether to include deleted contacts in the result. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the requested contacts. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X GET http://localhost:8000/crm/contacts \
-H "Authorization: Bearer $TOKEN"POST /crm/contacts
Create Contact
Create a customer, supplier, or other CRM contact.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Display name of the CRM contact, customer, or supplier. |
company_name | string, optional | -- | Company or organization name. |
website | string, optional | -- | Website URL associated with the CRM contact. |
currency | string, optional | -- | Currency code used for amounts in this record. |
email | string, optional | -- | Email address associated with the user, contact, or request. |
phone | string, optional | -- | Phone number associated with the contact or user. |
billing_address | string, optional | -- | Billing address for the CRM contact. |
shipping_address | string, optional | -- | Shipping or delivery address for the CRM contact. |
contact_type | string | -- | CRM contact classification, such as customer or supplier when supported. |
attributes | object | -- | Custom or category-specific attributes associated with the record. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the created contact or creation result. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/crm/contacts \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'POST /crm/contacts/bulk/delete
Bulk Delete Contacts
Delete multiple selected CRM contacts in one request.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
contact_ids | array of string | yes | Identifiers of the CRM contacts included in the operation. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the IDs of the deleted contacts. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/crm/contacts/bulk/delete \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'GET /crm/contacts/export/csv
Export Contacts CSV
Export matching or selected CRM contacts as a CSV file.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
q | query | -- | string, optional | Search text used to filter matching records. |
selected | query | -- | array of string | Identifiers of the selected contacts to include in the CSV export. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the generated file or download response. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X GET http://localhost:8000/crm/contacts/export/csv \
-H "Authorization: Bearer $TOKEN"POST /crm/contacts/import
Import Contact
Import one CRM contact from the supported Celerp interchange record.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
entity_id | string | yes | Identifier of the business record. |
event_type | string | yes | Business event type represented by the imported record. |
data | object | yes | Business data contained in the imported record. |
source | string | yes | Origin or source system recorded for the imported data. |
idempotency_key | string | yes | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
source_ts | string, optional | -- | Timestamp from the source system for the imported record. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the contact ID and event ID. `idempotency_hit` is true when the same record was already imported. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/crm/contacts/import \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'POST /crm/contacts/import/batch
Batch Import Contacts
Import multiple CRM contact records in one request.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
records | array of CRMImportRecord | yes | List of records included in the batch request. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns how many records were created, skipped or failed, with the reason for each failure. | celerp_contacts__routes__BatchImportResult |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/crm/contacts/import/batch \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'POST /crm/contacts/merge
Merge Contacts
Merge duplicate CRM contacts into the selected target contact.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
target_contact_id | string | yes | Identifier of the contact that should remain after a merge. |
source_contact_ids | array of string | yes | Identifiers of the contacts whose data should be merged into the target contact. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the merged contact. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/crm/contacts/merge \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'GET /crm/contacts/{contact_id}
Get Contact
Return contact.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the requested contact result. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X GET http://localhost:8000/crm/contacts/:contact_id \
-H "Authorization: Bearer $TOKEN"PATCH /crm/contacts/{contact_id}
Update Contact
Update contact with the supplied fields.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
fields_changed | object | -- | Fields and replacement values to apply to the existing record. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the updated contact or update result. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X PATCH http://localhost:8000/crm/contacts/:contact_id \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'POST /crm/contacts/{contact_id}/addresses
Add Contact Address
Add an address to a contact.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
address_type | string | -- | Address classification, such as billing or shipping. |
line1 | string, optional | -- | First street-address line. |
line2 | string, optional | -- | Optional second street-address line. |
city | string, optional | -- | City or locality for the address. |
state | string, optional | -- | State, province, region, or administrative area for the address. |
postal_code | string, optional | -- | Postal or ZIP code for the address. |
country | string, optional | -- | Country for the address. |
attn | string, optional | -- | Attention or recipient line for the address. |
is_default | boolean | -- | Whether this record should be the default choice for its category. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the event ID and the new address ID. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/crm/contacts/:contact_id/addresses \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'PATCH /crm/contacts/{contact_id}/addresses/{address_id}
Update Contact Address
Update contact address with the supplied fields.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
address_id | path | yes | string | Identifier of the contact address. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
address_type | string, optional | -- | Address classification, such as billing or shipping. |
line1 | string, optional | -- | First street-address line. |
line2 | string, optional | -- | Optional second street-address line. |
city | string, optional | -- | City or locality for the address. |
state | string, optional | -- | State, province, region, or administrative area for the address. |
postal_code | string, optional | -- | Postal or ZIP code for the address. |
country | string, optional | -- | Country for the address. |
attn | string, optional | -- | Attention or recipient line for the address. |
is_default | boolean, optional | -- | Whether this record should be the default choice for its category. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the updated contact address or update result. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X PATCH http://localhost:8000/crm/contacts/:contact_id/addresses/:address_id \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'DELETE /crm/contacts/{contact_id}/addresses/{address_id}
Remove Contact Address
Remove an address from a contact.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
address_id | path | yes | string | Identifier of the contact address. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/crm/contacts/:contact_id/addresses/:address_id \
-H "Authorization: Bearer $TOKEN"POST /crm/contacts/{contact_id}/files
Upload Contact File
Upload a file and attach it to a contact.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the event ID and the stored file's details. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/crm/contacts/:contact_id/files \
-H "Authorization: Bearer $TOKEN"GET /crm/contacts/{contact_id}/files/{file_id}
Download Contact File
Download a file attached to a contact.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
file_id | path | yes | string | Identifier of the uploaded or stored file. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the generated file or download response. | -- |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X GET http://localhost:8000/crm/contacts/:contact_id/files/:file_id \
-H "Authorization: Bearer $TOKEN"DELETE /crm/contacts/{contact_id}/files/{file_id}
Delete Contact File
Delete a file attached to a contact.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
file_id | path | yes | string | Identifier of the uploaded or stored file. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the updated contact record. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/crm/contacts/:contact_id/files/:file_id \
-H "Authorization: Bearer $TOKEN"PATCH /crm/contacts/{contact_id}/files/{file_id}/description
Update Contact File Description
Update contact file description with the supplied fields.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
file_id | path | yes | string | Identifier of the uploaded or stored file. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the updated contact file description or update result. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X PATCH http://localhost:8000/crm/contacts/:contact_id/files/:file_id/description \
-H "Authorization: Bearer $TOKEN"POST /crm/contacts/{contact_id}/files/{file_id}/tag
Tag Contact File
Set the tag on a file attached to a contact.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
file_id | path | yes | string | Identifier of the uploaded or stored file. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the updated contact record. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/crm/contacts/:contact_id/files/:file_id/tag \
-H "Authorization: Bearer $TOKEN"GET /crm/contacts/{contact_id}/notes
List Contact Notes
Return contact notes matching the documented filters and pagination options.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the requested contact notes. | array of object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X GET http://localhost:8000/crm/contacts/:contact_id/notes \
-H "Authorization: Bearer $TOKEN"POST /crm/contacts/{contact_id}/notes
Add Contact Note
Add a note to a contact.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
note | string | yes | Note text to add or update. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the event ID and the new note ID. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/crm/contacts/:contact_id/notes \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'PATCH /crm/contacts/{contact_id}/notes/{note_id}
Update Contact Note
Update contact note with the supplied fields.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
note_id | path | yes | string | Identifier of the note. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
note | string | yes | Note text to add or update. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the updated contact note or update result. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X PATCH http://localhost:8000/crm/contacts/:contact_id/notes/:note_id \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'DELETE /crm/contacts/{contact_id}/notes/{note_id}
Delete Contact Note
Delete a note from a contact.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
note_id | path | yes | string | Identifier of the note. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/crm/contacts/:contact_id/notes/:note_id \
-H "Authorization: Bearer $TOKEN"POST /crm/contacts/{contact_id}/people
Add Contact Person
Add a person to a contact, such as a buyer or accounts contact.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Full or display name of the contact person. |
role | string, optional | -- | Role assigned to the company user or contact person. |
email | string, optional | -- | Email address associated with the user, contact, or request. |
phone | string, optional | -- | Phone number associated with the contact or user. |
is_primary | boolean | -- | Whether this person should be the primary contact person. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the event ID and the new person ID. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/crm/contacts/:contact_id/people \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'PATCH /crm/contacts/{contact_id}/people/{person_id}
Update Contact Person
Update contact person with the supplied fields.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
person_id | path | yes | string | Identifier of the contact person. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string, optional | -- | Updated full or display name of the contact person. |
role | string, optional | -- | Role assigned to the company user or contact person. |
email | string, optional | -- | Email address associated with the user, contact, or request. |
phone | string, optional | -- | Phone number associated with the contact or user. |
is_primary | boolean, optional | -- | Whether this person should be the primary contact person. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the updated contact person or update result. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X PATCH http://localhost:8000/crm/contacts/:contact_id/people/:person_id \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'DELETE /crm/contacts/{contact_id}/people/{person_id}
Remove Contact Person
Remove a person from a contact.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
person_id | path | yes | string | Identifier of the contact person. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/crm/contacts/:contact_id/people/:person_id \
-H "Authorization: Bearer $TOKEN"POST /crm/contacts/{contact_id}/tags
Tag Contact
Replace the tags on a contact.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
contact_id | path | yes | string | Identifier of the customer, supplier, or other CRM contact. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
tags | array of string | yes | Tags to assign or store for the record. |
idempotency_key | string, optional | -- | Client-supplied idempotency key identifying this operation so the same request can be retried safely. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Returns the ID of the recorded event. | object |
422 | The request failed validation. The response lists each invalid field and why. | HTTPValidationError |
Example
curl -X POST http://localhost:8000/crm/contacts/:contact_id/tags \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'