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.
Who can use it
Section titled “Who can use it”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.
The source object
Section titled “The source object”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. |
Endpoints
Section titled “Endpoints”List sources
Section titled “List sources”Returns the business’s sources: the default first, then newest first, unless sortField is sent.
GET /v1/sourcesParameters
| 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
403when the person may not view companies.400whenupdatedSince,sortFieldorsortOrderis not valid.
Example request
curl "https://api.onesuite.io/v1/sources?limit=2" \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/sources?limit=2", { headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();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}Get a source
Section titled “Get a source”Returns one source.
GET /v1/sources/:idParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The source’s id. |
Rules
403when the person may not view companies.404when the source does not exist in the business.
Example request
curl "https://api.onesuite.io/v1/sources/cm2h6v3np0001rt52xy7za9bc" \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/sources/cm2h6v3np0001rt52xy7za9bc", { headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();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" }}Create a source
Section titled “Create a source”Adds a source to the business’s list. It is not the default.
POST /v1/sourcesParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
name |
body | string | Yes | Name, 1–191 characters, unique in the business. |
Rules
403when the person may not create companies.400when the name is empty or longer than 191 characters.409when a source with that name already exists.
Example request
curl "https://api.onesuite.io/v1/sources" \ -X POST \ -H "X-API-Key: $ONESUITE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name":"Trade show"}'const response = await fetch("https://api.onesuite.io/v1/sources", { method: "POST", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ name: "Trade show", }),});const data = await response.json();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" }}Update a source
Section titled “Update a source”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/:idParameters
| 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
403when the person may not edit companies.404when the source does not exist in the business.400when the body is empty, the name is empty or too long, orisDefaultis false.409when another source already has that name.
Example request
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"}'const response = await fetch("https://api.onesuite.io/v1/sources/cm2h6w8qs0003rt52de1fg2hi", { method: "PATCH", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ name: "Trade shows", }),});const data = await response.json();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" }}Delete a source
Section titled “Delete a source”Deletes a source that no person or company has. Opportunities that have it are left without a source.
DELETE /v1/sources/:idParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The source’s id. |
Rules
403when the person may not edit companies.404when the source does not exist in the business.409when a person or company has the source: give them another source first.409when it is the default source: make another one the default first.
Example request
curl "https://api.onesuite.io/v1/sources/cm2h6w8qs0003rt52de1fg2hi" \ -X DELETE \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/sources/cm2h6w8qs0003rt52de1fg2hi", { method: "DELETE", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "message": "Source deleted"}