Skip to content

Sources

The business’s list of sources: where a person, company, client or opportunity came from, such as Referral or Website. People, companies, clients and opportunities share one list, managed under Source in the CRM’s and the Clients’ Customize settings.

Every endpoint acts as the person whose personal access token is used. Reading sources needs the permission to view companies; creating one needs the permission to create companies; renaming, making default and deleting need the permission to edit companies. The list is the same for everyone who may read it, member, manager or administrator; administrators hold every permission. A person without the permission an endpoint needs gets 403. To give a person, company, client or opportunity a source, send its id as sourceId when creating or updating that record.

One source in the business’s list.

Field Type Description
id string The source’s id. Read only.
name string Name, 1–191 characters, unique in the business.
isDefault boolean Whether this is the business’s default source. The default is listed first and cannot be deleted; at most one source is the default.
isInUse boolean True when any person or company has this source. A source in use cannot be deleted. Read only.
createdAt datetime When it was created. Read only.
updatedAt datetime When it last changed. Read only.

Returns the business’s sources: the default first, then newest first, unless sortField is sent.

GET /v1/sources

Parameters

Parameter In Type Required Description
page query integer No Page number, from 1. Default 1.
limit query integer No Rows per page. Default 20, at most 1000.
search query string No Text in the name.
isInUse query boolean No true: only sources someone has; false: only unused ones.
updatedSince query datetime No Only records changed at or after this moment. Records deleted since then are not reported.
sortField query string No name, createdAt or updatedAt. Default: the default first, then newest first.
sortOrder query string No asc or desc. Default asc for name, desc otherwise.

Rules

  • 403 when the person may not view companies.
  • 400 when updatedSince, sortField or sortOrder is not valid.

Example request

Terminal window
curl "https://api.onesuite.io/v1/sources?limit=2" \
-H "X-API-Key: $ONESUITE_TOKEN"

Example response — status 200

{
"data": [
{
"id": "cm2h6v3np0001rt52xy7za9bc",
"name": "Referral",
"isDefault": true,
"isInUse": true,
"createdAt": "2026-02-11T08:30:12.004Z",
"updatedAt": "2026-06-03T13:44:51.287Z"
},
{
"id": "cm2h6w8qs0003rt52de1fg2hi",
"name": "Trade show",
"isDefault": false,
"isInUse": false,
"createdAt": "2026-11-21T09:58:40.771Z",
"updatedAt": "2026-11-21T09:58:40.771Z"
}
],
"totalCount": 9,
"page": 1,
"limit": 2
}

Returns one source.

GET /v1/sources/:id

Parameters

Parameter In Type Required Description
id path string Yes The source’s id.

Rules

  • 403 when the person may not view companies.
  • 404 when the source does not exist in the business.

Example request

Terminal window
curl "https://api.onesuite.io/v1/sources/cm2h6v3np0001rt52xy7za9bc" \
-H "X-API-Key: $ONESUITE_TOKEN"

Example response — status 200

{
"data": {
"id": "cm2h6v3np0001rt52xy7za9bc",
"name": "Referral",
"isDefault": true,
"isInUse": true,
"createdAt": "2026-02-11T08:30:12.004Z",
"updatedAt": "2026-06-03T13:44:51.287Z"
}
}

Adds a source to the business’s list. It is not the default.

POST /v1/sources

Parameters

Parameter In Type Required Description
name body string Yes Name, 1–191 characters, unique in the business.

Rules

  • 403 when the person may not create companies.
  • 400 when the name is empty or longer than 191 characters.
  • 409 when a source with that name already exists.

Example request

Terminal window
curl "https://api.onesuite.io/v1/sources" \
-X POST \
-H "X-API-Key: $ONESUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Trade show"}'

Example response — status 201

{
"data": {
"id": "cm2h6w8qs0003rt52de1fg2hi",
"name": "Trade show",
"isDefault": false,
"isInUse": false,
"createdAt": "2026-11-21T09:58:40.771Z",
"updatedAt": "2026-11-21T09:58:40.771Z"
}
}

Renames the source, or makes it the default: send isDefault true and the previous default stops being the default. Every person, company, client and opportunity that has the source shows the new name.

PATCH /v1/sources/:id

Parameters

Parameter In Type Required Description
id path string Yes The source’s id.
name body string No New name, 1–191 characters, unique in the business.
isDefault body boolean No true makes this the default source. false is refused: make another source the default instead.

Rules

  • 403 when the person may not edit companies.
  • 404 when the source does not exist in the business.
  • 400 when the body is empty, the name is empty or too long, or isDefault is false.
  • 409 when another source already has that name.

Example request

Terminal window
curl "https://api.onesuite.io/v1/sources/cm2h6w8qs0003rt52de1fg2hi" \
-X PATCH \
-H "X-API-Key: $ONESUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Trade shows"}'

Example response — status 200

{
"data": {
"id": "cm2h6w8qs0003rt52de1fg2hi",
"name": "Trade shows",
"isDefault": false,
"isInUse": false,
"createdAt": "2026-11-21T09:58:40.771Z",
"updatedAt": "2026-11-21T10:03:17.402Z"
}
}

Deletes a source that no person or company has. Opportunities that have it are left without a source.

DELETE /v1/sources/:id

Parameters

Parameter In Type Required Description
id path string Yes The source’s id.

Rules

  • 403 when the person may not edit companies.
  • 404 when the source does not exist in the business.
  • 409 when a person or company has the source: give them another source first.
  • 409 when it is the default source: make another one the default first.

Example request

Terminal window
curl "https://api.onesuite.io/v1/sources/cm2h6w8qs0003rt52de1fg2hi" \
-X DELETE \
-H "X-API-Key: $ONESUITE_TOKEN"

Example response — status 200

{
"message": "Source deleted"
}