REST API

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

NameInRequiredTypeDescription
qquery--stringSearch text used to filter matching records.
limitquery--integerMaximum number of records to return.
offsetquery--integerNumber of matching records to skip before returning results.
contact_typequery--string, optionalContact type used to filter CRM contacts, such as customer or supplier when supported.
include_deletedquery--booleanWhether to include deleted contacts in the result.

Responses

StatusDescriptionBody
200Returns the requested contacts.object
422The 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

FieldTypeRequiredDescription
namestringyesDisplay name of the CRM contact, customer, or supplier.
company_namestring, optional--Company or organization name.
websitestring, optional--Website URL associated with the CRM contact.
currencystring, optional--Currency code used for amounts in this record.
emailstring, optional--Email address associated with the user, contact, or request.
phonestring, optional--Phone number associated with the contact or user.
billing_addressstring, optional--Billing address for the CRM contact.
shipping_addressstring, optional--Shipping or delivery address for the CRM contact.
contact_typestring--CRM contact classification, such as customer or supplier when supported.
attributesobject--Custom or category-specific attributes associated with the record.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the created contact or creation result.object
422The 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

FieldTypeRequiredDescription
contact_idsarray of stringyesIdentifiers of the CRM contacts included in the operation.

Responses

StatusDescriptionBody
200Returns the IDs of the deleted contacts.object
422The 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

NameInRequiredTypeDescription
qquery--string, optionalSearch text used to filter matching records.
selectedquery--array of stringIdentifiers of the selected contacts to include in the CSV export.

Responses

StatusDescriptionBody
200Returns the generated file or download response.--
422The 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

FieldTypeRequiredDescription
entity_idstringyesIdentifier of the business record.
event_typestringyesBusiness event type represented by the imported record.
dataobjectyesBusiness data contained in the imported record.
sourcestringyesOrigin or source system recorded for the imported data.
idempotency_keystringyesClient-supplied idempotency key identifying this operation so the same request can be retried safely.
source_tsstring, optional--Timestamp from the source system for the imported record.

Responses

StatusDescriptionBody
200Returns the contact ID and event ID. `idempotency_hit` is true when the same record was already imported.object
422The 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

FieldTypeRequiredDescription
recordsarray of CRMImportRecordyesList of records included in the batch request.

Responses

StatusDescriptionBody
200Returns how many records were created, skipped or failed, with the reason for each failure.celerp_contacts__routes__BatchImportResult
422The 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

FieldTypeRequiredDescription
target_contact_idstringyesIdentifier of the contact that should remain after a merge.
source_contact_idsarray of stringyesIdentifiers of the contacts whose data should be merged into the target contact.

Responses

StatusDescriptionBody
200Returns the merged contact.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.

Responses

StatusDescriptionBody
200Returns the requested contact result.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.

Request body

FieldTypeRequiredDescription
fields_changedobject--Fields and replacement values to apply to the existing record.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the updated contact or update result.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.

Request body

FieldTypeRequiredDescription
address_typestring--Address classification, such as billing or shipping.
line1string, optional--First street-address line.
line2string, optional--Optional second street-address line.
citystring, optional--City or locality for the address.
statestring, optional--State, province, region, or administrative area for the address.
postal_codestring, optional--Postal or ZIP code for the address.
countrystring, optional--Country for the address.
attnstring, optional--Attention or recipient line for the address.
is_defaultboolean--Whether this record should be the default choice for its category.

Responses

StatusDescriptionBody
200Returns the event ID and the new address ID.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.
address_idpathyesstringIdentifier of the contact address.

Request body

FieldTypeRequiredDescription
address_typestring, optional--Address classification, such as billing or shipping.
line1string, optional--First street-address line.
line2string, optional--Optional second street-address line.
citystring, optional--City or locality for the address.
statestring, optional--State, province, region, or administrative area for the address.
postal_codestring, optional--Postal or ZIP code for the address.
countrystring, optional--Country for the address.
attnstring, optional--Attention or recipient line for the address.
is_defaultboolean, optional--Whether this record should be the default choice for its category.

Responses

StatusDescriptionBody
200Returns the updated contact address or update result.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.
address_idpathyesstringIdentifier of the contact address.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.

Responses

StatusDescriptionBody
200Returns the event ID and the stored file's details.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.
file_idpathyesstringIdentifier of the uploaded or stored file.

Responses

StatusDescriptionBody
200Returns the generated file or download response.--
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.
file_idpathyesstringIdentifier of the uploaded or stored file.

Responses

StatusDescriptionBody
200Returns the updated contact record.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.
file_idpathyesstringIdentifier of the uploaded or stored file.

Responses

StatusDescriptionBody
200Returns the updated contact file description or update result.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.
file_idpathyesstringIdentifier of the uploaded or stored file.

Responses

StatusDescriptionBody
200Returns the updated contact record.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.

Responses

StatusDescriptionBody
200Returns the requested contact notes.array of object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.

Request body

FieldTypeRequiredDescription
notestringyesNote text to add or update.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the event ID and the new note ID.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.
note_idpathyesstringIdentifier of the note.

Request body

FieldTypeRequiredDescription
notestringyesNote text to add or update.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the updated contact note or update result.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.
note_idpathyesstringIdentifier of the note.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.

Request body

FieldTypeRequiredDescription
namestringyesFull or display name of the contact person.
rolestring, optional--Role assigned to the company user or contact person.
emailstring, optional--Email address associated with the user, contact, or request.
phonestring, optional--Phone number associated with the contact or user.
is_primaryboolean--Whether this person should be the primary contact person.

Responses

StatusDescriptionBody
200Returns the event ID and the new person ID.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.
person_idpathyesstringIdentifier of the contact person.

Request body

FieldTypeRequiredDescription
namestring, optional--Updated full or display name of the contact person.
rolestring, optional--Role assigned to the company user or contact person.
emailstring, optional--Email address associated with the user, contact, or request.
phonestring, optional--Phone number associated with the contact or user.
is_primaryboolean, optional--Whether this person should be the primary contact person.

Responses

StatusDescriptionBody
200Returns the updated contact person or update result.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.
person_idpathyesstringIdentifier of the contact person.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.

Request body

FieldTypeRequiredDescription
tagsarray of stringyesTags to assign or store for the record.
idempotency_keystring, optional--Client-supplied idempotency key identifying this operation so the same request can be retried safely.

Responses

StatusDescriptionBody
200Returns the ID of the recorded event.object
422The 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 '{ ... }'