API Reference
Every endpoint once, generated from Cubrel's OpenAPI file: first for any module through {module}, then for Contacts as a worked example with its real fields.
Your workspace has its own modules and fields. For the exact list, download the OpenAPI file for your token under Workspace > Integrations > API Tokens, with Download OpenAPI next to the token, and import it into Postman, Insomnia or Bruno. The generic file of this page is at /openapi.json.
Any module
GET/{module}
List records
Parameters
| Name | In | Type | Description |
|---|---|---|---|
module * | path | string | The module's slug, as in its URL in the app, such as `contacts`. |
per_page | query | integer | |
page | query | integer | |
search | query | string | Matches the module's searchable fields. |
sort | query | string | A sortable field. |
direction | query | string | |
filter | query | string | The slug or id of a saved list filter. |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.200One page of records.
POST/{module}
Create a record
Parameters
| Name | In | Type | Description |
|---|---|---|---|
module * | path | string | The module's slug, as in its URL in the app, such as `contacts`. |
Request body: RecordInput
The module's writable fields, custom fields included, as one flat object. Download your workspace's OpenAPI file from API Tokens for the exact fields. `line_items` on quotes and orders, `attendees` on meetings.
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
line_items | LineItemInput[] | |||
attendees | AttendeeInput[] |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.3No such record, or a module the API can't reach.4A value was refused. `errors` names each field, such as `line_items.0.sku`.201The record.
PUT/{module}
Create or update by a matching field
Updates the one record whose `match` field has the value sent in the body, or creates a record when none has it. More than one match is a 422.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
module * | path | string | The module's slug, as in its URL in the app, such as `contacts`. |
match * | query | string | A writable text or email field, such as `sku` or `email`. |
Request body: RecordInput
The module's writable fields, custom fields included, as one flat object. Download your workspace's OpenAPI file from API Tokens for the exact fields. `line_items` on quotes and orders, `attendees` on meetings.
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
line_items | LineItemInput[] | |||
attendees | AttendeeInput[] |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.3No such record, or a module the API can't reach.4A value was refused. `errors` names each field, such as `line_items.0.sku`.200The record.201The record.
GET/{module}/{id}
Get a record
Includes `related` records, and `line_items` on quotes and orders, `attendees` on meetings.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
module * | path | string | The module's slug, as in its URL in the app, such as `contacts`. |
id * | path | string (uuid) |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.200The record.404No such record, or a module the API can't reach.
PATCH/{module}/{id}
Update a record
Only the fields you send change. `line_items` or `attendees`, when sent, is the complete new list. PUT does the same.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
module * | path | string | The module's slug, as in its URL in the app, such as `contacts`. |
id * | path | string (uuid) |
Request body: RecordInput
The module's writable fields, custom fields included, as one flat object. Download your workspace's OpenAPI file from API Tokens for the exact fields. `line_items` on quotes and orders, `attendees` on meetings.
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
line_items | LineItemInput[] | |||
attendees | AttendeeInput[] |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.3No such record, or a module the API can't reach.4A value was refused. `errors` names each field, such as `line_items.0.sku`.200The record.
DELETE/{module}/{id}
Delete a record
Moves the record to the Bin.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
module * | path | string | The module's slug, as in its URL in the app, such as `contacts`. |
id * | path | string (uuid) |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.204Deleted.404No such record, or a module the API can't reach.
GET/{module}/relationships
List the module's relationships
Parameters
| Name | In | Type | Description |
|---|---|---|---|
module * | path | string | The module's slug, as in its URL in the app, such as `contacts`. |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.200The relationships records of this module can be linked through.
POST/{module}/{id}/relationships/{relationship}
Link records
A link that exists, or that the relationship's type doesn't allow, is a 422.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
module * | path | string | The module's slug, as in its URL in the app, such as `contacts`. |
id * | path | string (uuid) | |
relationship * | path | string |
Request body: object
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
related_ids | string (uuid)[] | yes |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.3No such record, or a module the API can't reach.4A value was refused. `errors` names each field, such as `line_items.0.sku`.201The linked records.
DELETE/{module}/{id}/relationships/{relationship}/{relatedId}
Unlink a record
Parameters
| Name | In | Type | Description |
|---|---|---|---|
module * | path | string | The module's slug, as in its URL in the app, such as `contacts`. |
id * | path | string (uuid) | |
relationship * | path | string | |
relatedId * | path | string (uuid) |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.204Unlinked.404No such record, or a module the API can't reach.
Example: Contacts
GET/contacts
List records
Parameters
| Name | In | Type | Description |
|---|---|---|---|
per_page | query | integer | |
page | query | integer | |
search | query | string | Matches the module's searchable fields. |
sort | query | string | A sortable field. |
direction | query | string | |
filter | query | string | The slug or id of a saved list filter. |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.200One page of records.
POST/contacts
Create a record
Request body: ContactsInput
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
name | string | yes | Name | |
description | string | Description | ||
first_name | string | First Name | ||
last_name | string | Last Name | ||
email | string (email) | |||
phone | string | Phone | ||
position | string | Position | ||
notes | string | Notes | ||
avatar | string | Profile Picture | ||
address | object | Address | ||
mobile | string | Mobile | ||
salutation | string | mr, ms, mx, dr, prof | Salutation | |
department | string | Department | ||
marketing_consent | boolean | Marketing Consent | ||
consent_date | string (date) | Consent Date |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.3No such record, or a module the API can't reach.4A value was refused. `errors` names each field, such as `line_items.0.sku`.201The record.
PUT/contacts
Create or update by a matching field
Updates the one record whose `match` field has the value sent in the body, or creates a record when none has it. More than one match is a 422.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
match * | query | string | A writable text or email field, such as `sku` or `email`. |
Request body: ContactsInput
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
name | string | yes | Name | |
description | string | Description | ||
first_name | string | First Name | ||
last_name | string | Last Name | ||
email | string (email) | |||
phone | string | Phone | ||
position | string | Position | ||
notes | string | Notes | ||
avatar | string | Profile Picture | ||
address | object | Address | ||
mobile | string | Mobile | ||
salutation | string | mr, ms, mx, dr, prof | Salutation | |
department | string | Department | ||
marketing_consent | boolean | Marketing Consent | ||
consent_date | string (date) | Consent Date |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.3No such record, or a module the API can't reach.4A value was refused. `errors` names each field, such as `line_items.0.sku`.200The record.201The record.
GET/contacts/{id}
Get a record
Includes `related` records, and `line_items` on quotes and orders, `attendees` on meetings.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.200The record.404No such record, or a module the API can't reach.
PATCH/contacts/{id}
Update a record
Only the fields you send change. `line_items` or `attendees`, when sent, is the complete new list. PUT does the same.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) |
Request body: ContactsInput
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
name | string | yes | Name | |
description | string | Description | ||
first_name | string | First Name | ||
last_name | string | Last Name | ||
email | string (email) | |||
phone | string | Phone | ||
position | string | Position | ||
notes | string | Notes | ||
avatar | string | Profile Picture | ||
address | object | Address | ||
mobile | string | Mobile | ||
salutation | string | mr, ms, mx, dr, prof | Salutation | |
department | string | Department | ||
marketing_consent | boolean | Marketing Consent | ||
consent_date | string (date) | Consent Date |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.3No such record, or a module the API can't reach.4A value was refused. `errors` names each field, such as `line_items.0.sku`.200The record.
DELETE/contacts/{id}
Delete a record
Moves the record to the Bin.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.204Deleted.404No such record, or a module the API can't reach.
GET/contacts/relationships
List the module's relationships
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.200The relationships records of this module can be linked through.
POST/contacts/{id}/relationships/{relationship}
Link records
A link that exists, or that the relationship's type doesn't allow, is a 422.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | |
relationship * | path | string |
Request body: object
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
related_ids | string (uuid)[] | yes |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.3No such record, or a module the API can't reach.4A value was refused. `errors` names each field, such as `line_items.0.sku`.201The linked records.
DELETE/contacts/{id}/relationships/{relationship}/{relatedId}
Unlink a record
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | |
relationship * | path | string | |
relatedId * | path | string (uuid) |
Responses
0The token is missing, invalid or revoked.1The token lacks the ability for this module and action.2Rate limit reached. Retry after the time in the Retry-After header.204Unlinked.404No such record, or a module the API can't reach.
Tickets
POST/tickets/{module}
Open a ticket
Opens a ticket with its first message, sent by the requester.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
module * | path | string | A ticket module's slug, such as `cases`. |
Request body: object
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
requester_email | string (email) | yes | ||
requester_name | string | |||
subject | string | yes | ||
body | string | yes |
Responses
201The record.422A value was refused. `errors` names each field, such as `line_items.0.sku`.
GET/tickets/{module}/{id}/messages
List a ticket's messages
The conversation without internal notes.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
module * | path | string | A ticket module's slug, such as `cases`. |
id * | path | string (uuid) |
Responses
200The ticket's messages, oldest first.
POST/tickets/{module}/{id}/messages
Add a message to a ticket
Parameters
| Name | In | Type | Description |
|---|---|---|---|
module * | path | string | A ticket module's slug, such as `cases`. |
id * | path | string (uuid) |
Request body: object
| Name | Type | Required | Values | Description |
|---|---|---|---|---|
body | string | yes | ||
author | string | customer, agent | ||
name | string | |||
email | string (email) |
Responses
201The new message.422A value was refused. `errors` names each field, such as `line_items.0.sku`.
Webhooks
{module}.created{module}.updated{module}.deleted{module}.message_created
| Name | Type | Description |
|---|---|---|
id | string (uuid) | Unique per delivery; skip an id you have seen. |
event | string | |
occurred_at | string (date-time) | |
data | object | The record's fields as GET returns them, with line_items on quotes and orders; only the id on deleted. |
changes | object | On updated: each changed field with from and to. |