Opportunities
Opportunities are the deals a business is pursuing: each has an amount and currency, an expected close date, the pipeline stage it has reached, the company and person it is with, an owner, and its own notes, files and activity timeline. An opportunity can be converted to a client when the deal is won.
Who can use it
Section titled “Who can use it”Every endpoint acts as the person whose personal access token is used, with the permissions their role gives them in the app. Reading opportunities, their notes, files and activity needs the permission to view leads; creating one needs the permission to create leads; changing one — any field, its stage, company, point of contact, owner or tags — as well as adding, changing or deleting its notes and files and converting it to a client needs the permission to edit leads; deleting one needs the permission to delete leads. These permissions cover the whole business: whoever holds the permission to view leads sees every opportunity, whether they are a member, a manager or an administrator; nothing is narrowed to the opportunities they own. Administrators hold every permission. A person without the permission an endpoint needs gets 403. No opportunity field is hidden by permission.
Objects
Section titled “Objects”The opportunity object
Section titled “The opportunity object”A deal the business is pursuing: its value, the stage it has reached in the pipeline, and the company and person it is with.
| Field | Type | Description |
|---|---|---|
id |
string | The opportunity’s id. Read only. |
name |
string | The opportunity’s name, 1–191 characters. |
amount |
decimal | The value of the deal (“Amount” in the app), in currency. 0 when no amount is set. |
currency |
string | ISO currency code of amount, such as EUR. When the opportunity has no currency of its own, the business’s currency. |
stage |
object | The pipeline stage the opportunity is in, as { id, name }, or null when it is in no stage (it then does not appear on the pipeline board). Change it with stageId. Can be null. |
closeDate |
date | The expected close date (“Close Date” in the app), or null. Can be null. |
company |
object | The company the opportunity is with, as { id, name }, or null. Set it with companyId. Can be null. |
pointOfContact |
object | The person the deal is run with (“Point of Contact” in the app), as { id, name }, or null. Set it with pointOfContactId. Their details are in People. Can be null. |
client |
object | The client this opportunity’s company or person has become, as { id, name }: the company’s client when the company is a client, otherwise the point of contact’s own individual client. Null while neither is a client. Read only. Can be null. |
owner |
object | The team member who owns the opportunity, as { id, name }, or null. Can be null. |
createdBy |
object | The team member who added the opportunity, as { id, name }, or null when that member has been removed from the business. Read only. Can be null. |
industry |
object | The opportunity’s industry as { id, name }, or null. Can be null. |
source |
object | Where the opportunity came from, as { id, name }, or null. Can be null. |
tags |
array of object | Tags on the opportunity, each { id, name }. Set them with tagIds. |
customFields |
object | The business’s custom fields for opportunities, keyed by each field’s key, with the stored value: text, number, date (YYYY-MM-DD), a list for multi-select. Fields with no value are left out. |
lastEmailedAt |
datetime | When the opportunity was last emailed from OneSuite, or null. Read only. Can be null. |
createdAt |
datetime | When the opportunity was added. Read only. |
updatedAt |
datetime | When the opportunity last changed. Read only. |
The opportunity note object
Section titled “The opportunity note object”A note on an opportunity.
| Field | Type | Description |
|---|---|---|
id |
string | The note’s id. Read only. |
title |
string | The note’s title. |
description |
string | The note’s text as HTML, or null. Can be null. |
files |
array of opportunityFile | Files attached to the note, newest first. Read only. |
createdBy |
object | The team member who wrote the note, as { id, name }, or null. Read only. Can be null. |
createdAt |
datetime | When the note was added. Read only. |
updatedAt |
datetime | When the note last changed. Read only. |
The opportunity file object
Section titled “The opportunity file object”A file on an opportunity, uploaded to it or attached to one of its notes or tasks.
| Field | Type | Description |
|---|---|---|
id |
string | The file’s id. Read only. |
name |
string | File name as shown in the app. Rename it with Update a file. |
type |
string | File type, from the file’s extension, such as pdf; null when unknown. Read only. Can be null. |
size |
integer | Size in bytes, or null when unknown. Read only. Can be null. |
isLinked |
boolean | True when the file is linked from a connected cloud drive rather than uploaded. A linked file cannot be downloaded through the API. Read only. |
note |
object | The note the file is attached to, as { id, name } (name is the note’s title), or null when it is attached to the opportunity itself. Read only. Can be null. |
task |
object | The CRM task the file is attached to, as { id, name }, or null. Read only. Can be null. |
createdBy |
object | The team member who added the file, as { id, name }, or null. Read only. Can be null. |
createdAt |
datetime | When the file was added. Read only. |
updatedAt |
datetime | When the file last changed. Read only. |
The opportunity activity object
Section titled “The opportunity activity object”One entry in an opportunity’s activity timeline.
| Field | Type | Description |
|---|---|---|
id |
string | The entry’s id. Read only. |
action |
string | What was done, in the words the app’s activity timeline shows, such as created, updated, connected, disconnected, added note, converted. Read only. |
item |
string | What it was done to, such as Opportunity, Stage, Amount, Company, Point of Contact, Note, File. Read only. Can be null. |
detail |
string | The new value or the name of the thing involved, such as the stage’s name; null when there is none. Read only. Can be null. |
member |
object | The team member who did it, as { id, name }, or null for changes OneSuite made on its own. Read only. Can be null. |
createdAt |
datetime | When it happened. Read only. |
The client conversion object
Section titled “The client conversion object”The result of converting an opportunity to a client.
| Field | Type | Description |
|---|---|---|
opportunity |
object | The opportunity converted, as { id, name }. It is not changed by the conversion. Read only. |
client |
object | The new client, as { id, name, type }, where type is company or individual. Its full record is in Clients. Read only. |
invitations |
array of object | One row per person asked to be invited to the client portal: { person: { id, name }, email, status, reason }. status is sent, skipped (with reason alreadyInvited or duplicateEmail) or failed (with reason naming the cause, such as noPrimaryEmail). A failed invitation does not undo the conversion. Read only. |
Opportunities
Section titled “Opportunities”List opportunities
Section titled “List opportunities”Returns the business’s opportunities, newest first by default. Filter by stage to read one column of the pipeline board, or by company or person to list the opportunities of one of them.
GET /v1/opportunitiesParameters
| 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 opportunity’s name, its company’s name or its point of contact’s name. |
filterStageIds |
query | string | No | Comma-separated stage ids. |
filterCompanyIds |
query | string | No | Comma-separated company ids. |
filterPointOfContactIds |
query | string | No | Comma-separated person ids: opportunities with one of them as point of contact. |
filterOwnerIds |
query | string | No | Comma-separated team member ids of owners. |
filterIndustryIds |
query | string | No | Comma-separated industry ids. |
filterSourceIds |
query | string | No | Comma-separated source ids. |
filterTagIds |
query | string | No | Comma-separated tag ids: opportunities with any of them. |
filterCountryCodes |
query | string | No | Comma-separated two-letter country codes of the opportunity’s company. |
amountMin |
query | decimal | No | Only opportunities whose amount is at least this, in each opportunity’s own currency. |
amountMax |
query | decimal | No | Only opportunities whose amount is at most this, in each opportunity’s own currency. |
from |
query | date | No | Only opportunities whose close date is on or after this day. |
to |
query | date | No | Only opportunities whose close date is on or before this day. |
updatedSince |
query | datetime | No | Only opportunities changed at or after this moment. Records deleted since then are not reported. |
sortField |
query | string | No | createdAt (default), updatedAt, name, amount or closeDate. |
sortOrder |
query | string | No | asc or desc (default). |
Rules
403when the person may not view leads.400whenfromortois not aYYYY-MM-DDday,updatedSinceis not a valid moment,amountMinoramountMaxis not a number, orsortFieldorsortOrderis not one of the listed values.- Ids in a filter that are not in the business match nothing; the request still answers 200.
Example request
curl "https://api.onesuite.io/v1/opportunities?filterStageIds=cm4st0a1b0005k908r6s7t8ub&sortField=amount&limit=1" \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/opportunities?filterStageIds=cm4st0a1b0005k908r6s7t8ub&sortField=amount&limit=1", { headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "data": [ { "id": "cm4op1a2b0003k908q7w1e2rt", "name": "Northwind Studio – website redesign", "amount": 18500, "currency": "EUR", "stage": { "id": "cm4st0a1b0005k908r6s7t8ub", "name": "Proposal" }, "closeDate": "2026-12-15", "company": { "id": "cm3qk1x6z0002l2087kf3m0aa", "name": "Northwind Studio" }, "pointOfContact": { "id": "cm3qk2a1c0009l208h7w5r3pq", "name": "Dana Reyes" }, "client": null, "owner": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "createdBy": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "industry": { "id": "cm3qk0p2x0003l208ind0a1b2", "name": "Architecture" }, "source": { "id": "cm3qk0q7v0005l208src3c4d5", "name": "Referral" }, "tags": [ { "id": "cm3qk0t1a0007l208tag9g0h1", "name": "Key account" } ], "customFields": { "decision-maker": "Board of directors" }, "lastEmailedAt": "2026-11-18T09:02:11.540Z", "createdAt": "2026-11-04T08:41:27.119Z", "updatedAt": "2026-11-19T15:22:03.874Z" } ], "totalCount": 6, "page": 1, "limit": 1}Get an opportunity
Section titled “Get an opportunity”Returns one opportunity.
GET /v1/opportunities/:idParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
Rules
403when the person may not view leads.404when the opportunity does not exist in the business.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt" \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt", { headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "data": { "id": "cm4op1a2b0003k908q7w1e2rt", "name": "Northwind Studio – website redesign", "amount": 18500, "currency": "EUR", "stage": { "id": "cm4st0a1b0005k908r6s7t8ub", "name": "Proposal" }, "closeDate": "2026-12-15", "company": { "id": "cm3qk1x6z0002l2087kf3m0aa", "name": "Northwind Studio" }, "pointOfContact": { "id": "cm3qk2a1c0009l208h7w5r3pq", "name": "Dana Reyes" }, "client": null, "owner": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "createdBy": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "industry": { "id": "cm3qk0p2x0003l208ind0a1b2", "name": "Architecture" }, "source": { "id": "cm3qk0q7v0005l208src3c4d5", "name": "Referral" }, "tags": [ { "id": "cm3qk0t1a0007l208tag9g0h1", "name": "Key account" } ], "customFields": { "decision-maker": "Board of directors" }, "lastEmailedAt": "2026-11-18T09:02:11.540Z", "createdAt": "2026-11-04T08:41:27.119Z", "updatedAt": "2026-11-19T15:22:03.874Z" }}Create an opportunity
Section titled “Create an opportunity”Adds an opportunity. Only name is required. Without stageId it goes into the business’s default stage, or its first stage when none is marked default, at the end of that stage on the pipeline board. Without currency the amount is in the business’s currency. Unless ownerId is sent, the person creating it becomes the owner. When a company is given and no industry or source is sent, the opportunity takes the company’s; when a company is given and no point of contact is sent, it takes the company’s point of contact.
POST /v1/opportunitiesParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
name |
body | string | Yes | Name, 1–191 characters. |
amount |
body | decimal | No | Value of the deal, 0 or more. Default 0. |
currency |
body | string | No | ISO currency code of the amount, such as EUR. Default: the business’s currency. |
stageId |
body | string | No | Pipeline stage to put it in. |
closeDate |
body | date | No | Expected close date, YYYY-MM-DD. |
companyId |
body | string | No | Company the opportunity is with. |
pointOfContactId |
body | string | No | Person the deal is run with. |
ownerId |
body | string | No | Team member id of the owner, or null for none. |
industryId |
body | string | No | Industry id. |
sourceId |
body | string | No | Source id. |
tagIds |
body | array of string | No | Ids of the business’s tags to put on the opportunity. |
customFields |
body | object | No | Custom field values keyed by the field’s key. |
Rules
403when the person may not create leads.400when the name is missing or longer than 191 characters,amountis negative or not a number,currencyis not a known ISO currency code, orcloseDateis not aYYYY-MM-DDday. Nothing is created.404when the stage, company, point of contact, owner, industry, source, a tag or a custom field key is not in the business.- Answers 201 with the new opportunity.
Example request
curl "https://api.onesuite.io/v1/opportunities" \ -X POST \ -H "X-API-Key: $ONESUITE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name":"Northwind Studio – brand refresh","amount":7200,"currency":"EUR","closeDate":"2027-01-31","companyId":"cm3qk1x6z0002l2087kf3m0aa","ownerId":"cm3qk0m9s0003l208own2k4m6"}'const response = await fetch("https://api.onesuite.io/v1/opportunities", { method: "POST", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ name: "Northwind Studio – brand refresh", amount: 7200, currency: "EUR", closeDate: "2027-01-31", companyId: "cm3qk1x6z0002l2087kf3m0aa", ownerId: "cm3qk0m9s0003l208own2k4m6", }),});const data = await response.json();Example response — status 201
{ "data": { "id": "cm4op9c8d0017k908z5x4c3vb", "name": "Northwind Studio – brand refresh", "amount": 7200, "currency": "EUR", "stage": { "id": "cm4st0a1b0001k908p2l3m4na", "name": "Lead" }, "closeDate": "2027-01-31", "company": { "id": "cm3qk1x6z0002l2087kf3m0aa", "name": "Northwind Studio" }, "pointOfContact": { "id": "cm3qk2a1c0009l208h7w5r3pq", "name": "Dana Reyes" }, "client": null, "owner": { "id": "cm3qk0m9s0003l208own2k4m6", "name": "Priya Nair" }, "createdBy": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "industry": { "id": "cm3qk0p2x0003l208ind0a1b2", "name": "Architecture" }, "source": { "id": "cm3qk0q7v0005l208src3c4d5", "name": "Referral" }, "tags": [], "customFields": {}, "lastEmailedAt": null, "createdAt": "2026-11-21T10:05:12.408Z", "updatedAt": "2026-11-21T10:05:12.408Z" }}Update an opportunity
Section titled “Update an opportunity”Changes the fields sent and leaves the rest as they are. Send stageId to move the opportunity to another stage of the pipeline; it goes to the end of that stage on the board. Send null to clear a field: stageId: null takes the opportunity off the board, companyId: null detaches its company. Changing the company has the same effects as in the app: the opportunity takes the new company’s industry and source if it has none, its point of contact is released if they belong to the previous company, and the new company’s point of contact is taken when the opportunity is left without one. A pointOfContactId sent in the same request wins. tagIds is the complete list of tags. Every change is recorded in the activity timeline. A request that changes nothing saves nothing and answers 200.
PATCH /v1/opportunities/:idParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
name |
body | string | No | Name, 1–191 characters. |
amount |
body | decimal | No | Value of the deal, 0 or more. |
currency |
body | string | No | ISO currency code of the amount. |
stageId |
body | string | No | Stage to move the opportunity to, or null for no stage. |
closeDate |
body | date | No | Expected close date, YYYY-MM-DD, or null to clear it. |
companyId |
body | string | No | Company the opportunity is with, or null to detach it. |
pointOfContactId |
body | string | No | Person the deal is run with, or null for none. |
ownerId |
body | string | No | Team member id of the owner, or null for none. |
industryId |
body | string | No | Industry id, or null for none. |
sourceId |
body | string | No | Source id, or null for none. |
tagIds |
body | array of string | No | The complete list of tag ids; tags not in it are taken off; an empty list removes them all. |
customFields |
body | object | No | Custom field values keyed by the field’s key. Keys not sent keep their value; null clears one. |
Rules
403when the person may not edit leads.404when the opportunity does not exist in the business.400when the body is empty, the name is empty or longer than 191 characters,amountis negative or not a number,currencyis not a known ISO currency code, orcloseDateis not aYYYY-MM-DDday. Nothing changes.404when the stage, company, point of contact, owner, industry, source, a tag or a custom field key is not in the business. Nothing changes.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt" \ -X PATCH \ -H "X-API-Key: $ONESUITE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"stageId":"cm4st0a1b0009k908v1w2x3yc","amount":21000}'const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt", { method: "PATCH", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ stageId: "cm4st0a1b0009k908v1w2x3yc", amount: 21000, }),});const data = await response.json();Example response — status 200
{ "data": { "id": "cm4op1a2b0003k908q7w1e2rt", "name": "Northwind Studio – website redesign", "amount": 21000, "currency": "EUR", "stage": { "id": "cm4st0a1b0009k908v1w2x3yc", "name": "Negotiation" }, "closeDate": "2026-12-15", "company": { "id": "cm3qk1x6z0002l2087kf3m0aa", "name": "Northwind Studio" }, "pointOfContact": { "id": "cm3qk2a1c0009l208h7w5r3pq", "name": "Dana Reyes" }, "client": null, "owner": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "createdBy": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "industry": { "id": "cm3qk0p2x0003l208ind0a1b2", "name": "Architecture" }, "source": { "id": "cm3qk0q7v0005l208src3c4d5", "name": "Referral" }, "tags": [ { "id": "cm3qk0t1a0007l208tag9g0h1", "name": "Key account" } ], "customFields": { "decision-maker": "Board of directors" }, "lastEmailedAt": "2026-11-18T09:02:11.540Z", "createdAt": "2026-11-04T08:41:27.119Z", "updatedAt": "2026-11-21T11:40:55.312Z" }}Delete an opportunity
Section titled “Delete an opportunity”Permanently deletes the opportunity with its notes, files, CRM tasks, activity timeline and custom field values. Its company and point of contact are not affected, nor is any client made from it.
DELETE /v1/opportunities/:idParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
Rules
403when the person may not delete leads.404when the opportunity does not exist in the business.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op9c8d0017k908z5x4c3vb" \ -X DELETE \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op9c8d0017k908z5x4c3vb", { method: "DELETE", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "message": "Opportunity deleted"}Convert an opportunity to a client
Section titled “Convert an opportunity to a client”Turns the opportunity’s company, or one person, into a client, as the app’s Convert to Client does. With clientType company (the default) the opportunity’s company becomes a company client; the opportunity must have a company. With individual the person in personId, or else the opportunity’s point of contact, becomes an individual client. The new client gets the business’s default client settings. People can be invited to the client portal in the same request. The opportunity itself is not changed: it keeps its stage, and its client field now names the new client. Answers 201.
POST /v1/opportunities/:id/convert-to-clientParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
clientType |
body | string | No | company (default) or individual. |
personId |
body | string | No | For individual: the person to make a client. Default: the opportunity’s point of contact. |
invitePersonIds |
body | array of string | No | For company: people of the opportunity’s company to invite to the client portal. Each needs a primary email address. |
inviteToPortal |
body | boolean | No | For individual: also invite the person to the client portal. Default false. |
invitationMessage |
body | string | No | Personal message added to the portal invitation email. |
Rules
403when the person may not edit leads.404when the opportunity, orpersonId, is not in the business.400whenclientTypeis notcompanyorindividual.400whenclientTypeiscompanyand the opportunity has no company, orindividualand neitherpersonIdnor a point of contact is given.400when an id ininvitePersonIdsis not one of the company’s people, orinvitePersonIdsis sent withindividualorinviteToPortalwithcompany. Nothing is converted.409when the company, or the person, is already a client.- A person already invited is skipped, as is a second person with the same email address; a person without a primary email address is reported as failed. Neither undoes the conversion.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/convert-to-client" \ -X POST \ -H "X-API-Key: $ONESUITE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"clientType":"company","invitePersonIds":["cm3qk2a1c0009l208h7w5r3pq"],"invitationMessage":"<p>Welcome aboard – your portal is ready.</p>"}'const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/convert-to-client", { method: "POST", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ clientType: "company", invitePersonIds: [ "cm3qk2a1c0009l208h7w5r3pq", ], invitationMessage: "<p>Welcome aboard – your portal is ready.</p>", }),});const data = await response.json();Example response — status 201
{ "data": { "opportunity": { "id": "cm4op1a2b0003k908q7w1e2rt", "name": "Northwind Studio – website redesign" }, "client": { "id": "cm3qk1x7a0004l208c2vh9e1t", "name": "Northwind Studio", "type": "company" }, "invitations": [ { "person": { "id": "cm3qk2a1c0009l208h7w5r3pq", "name": "Dana Reyes" }, "status": "sent", "reason": null } ] }}List an opportunity’s notes
Section titled “List an opportunity’s notes”Returns the opportunity’s notes, newest first, each with its files.
GET /v1/opportunities/:id/notesParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
page |
query | integer | No | Page number, from 1. Default 1. |
limit |
query | integer | No | Rows per page. Default 20, at most 1000. |
updatedSince |
query | datetime | No | Only notes changed at or after this moment. Notes deleted since then are not reported. |
Rules
403when the person may not view leads.404when the opportunity does not exist in the business.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/notes?limit=1" \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/notes?limit=1", { headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "data": [ { "id": "cm4nt3k2j0031k908m8n9p0qr", "title": "Discovery call", "description": "<p>Budget approved for Q1. Wants a phased launch.</p>", "files": [], "createdBy": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "createdAt": "2026-11-12T14:03:40.552Z", "updatedAt": "2026-11-12T14:03:40.552Z" } ], "totalCount": 3, "page": 1, "limit": 1}Add a note to an opportunity
Section titled “Add a note to an opportunity”Adds a note. title is required; description is the note’s text as HTML. To attach a file, upload it with Upload a file and pass the note’s id.
POST /v1/opportunities/:id/notesParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
title |
body | string | Yes | Title, 1–191 characters. |
description |
body | string | No | The note’s text as HTML. |
Rules
403when the person may not edit leads.404when the opportunity does not exist in the business.400when the title is missing or longer than 191 characters.- Answers 201 with the new note.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/notes" \ -X POST \ -H "X-API-Key: $ONESUITE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"title":"Discovery call","description":"<p>Budget approved for Q1. Wants a phased launch.</p>"}'const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/notes", { method: "POST", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ title: "Discovery call", description: "<p>Budget approved for Q1. Wants a phased launch.</p>", }),});const data = await response.json();Example response — status 201
{ "data": { "id": "cm4nt3k2j0031k908m8n9p0qr", "title": "Discovery call", "description": "<p>Budget approved for Q1. Wants a phased launch.</p>", "files": [], "createdBy": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "createdAt": "2026-11-12T14:03:40.552Z", "updatedAt": "2026-11-12T14:03:40.552Z" }}Update a note
Section titled “Update a note”Changes the note’s title, description, or both.
PATCH /v1/opportunities/:id/notes/:noteIdParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
noteId |
path | string | Yes | The note’s id. |
title |
body | string | No | New title, 1–191 characters. |
description |
body | string | No | New text as HTML, or null to clear it. |
Rules
403when the person may not edit leads.404when the opportunity, or the note on it, does not exist.400when the body is empty or the title is empty.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/notes/cm4nt3k2j0031k908m8n9p0qr" \ -X PATCH \ -H "X-API-Key: $ONESUITE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"title":"Discovery call – follow-up"}'const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/notes/cm4nt3k2j0031k908m8n9p0qr", { method: "PATCH", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ title: "Discovery call – follow-up", }),});const data = await response.json();Example response — status 200
{ "data": { "id": "cm4nt3k2j0031k908m8n9p0qr", "title": "Discovery call – follow-up", "description": "<p>Budget approved for Q1. Wants a phased launch.</p>", "files": [], "createdBy": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "createdAt": "2026-11-12T14:03:40.552Z", "updatedAt": "2026-11-21T09:12:07.090Z" }}Delete a note
Section titled “Delete a note”Deletes the note and the files attached to it.
DELETE /v1/opportunities/:id/notes/:noteIdParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
noteId |
path | string | Yes | The note’s id. |
Rules
403when the person may not edit leads.404when the opportunity, or the note on it, does not exist.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/notes/cm4nt3k2j0031k908m8n9p0qr" \ -X DELETE \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/notes/cm4nt3k2j0031k908m8n9p0qr", { method: "DELETE", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "message": "Note deleted"}List an opportunity’s files
Section titled “List an opportunity’s files”Returns every file on the opportunity, newest first: those uploaded to it and those attached to its notes and CRM tasks (note and task say which).
GET /v1/opportunities/:id/filesParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
page |
query | integer | No | Page number, from 1. Default 1. |
limit |
query | integer | No | Rows per page. Default 20, at most 1000. |
Rules
403when the person may not view leads.404when the opportunity does not exist in the business.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/files?limit=1" \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/files?limit=1", { headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "data": [ { "id": "cm4fl5h4g0043k908s1t2u3vw", "name": "Proposal v2.pdf", "type": "pdf", "size": 482113, "isLinked": false, "note": null, "task": null, "createdBy": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "createdAt": "2026-11-15T10:20:31.004Z", "updatedAt": "2026-11-15T10:20:31.004Z" } ], "totalCount": 4, "page": 1, "limit": 1}Upload a file
Section titled “Upload a file”Uploads one file to the opportunity, or to one of its notes when noteId is sent. Send the request as multipart/form-data with the file in the file part. Files up to 25 MB; executable file types are refused.
POST /v1/opportunities/:id/filesParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
file |
body | string | Yes | The file (multipart part). |
noteId |
body | string | No | Attach the file to this note of the opportunity instead of the opportunity itself. |
Rules
403when the person may not edit leads.404when the opportunity, ornoteIdon it, does not exist.400when no file is sent, it is larger than 25 MB, or its type is not accepted.- Answers 201 with the new file.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/files" \ -X POST \ -H "X-API-Key: $ONESUITE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"file":"(binary: Proposal v2.pdf)"}'const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/files", { method: "POST", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ file: "(binary: Proposal v2.pdf)", }),});const data = await response.json();Example response — status 201
{ "data": { "id": "cm4fl5h4g0043k908s1t2u3vw", "name": "Proposal v2.pdf", "type": "pdf", "size": 482113, "isLinked": false, "note": null, "task": null, "createdBy": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "createdAt": "2026-11-15T10:20:31.004Z", "updatedAt": "2026-11-15T10:20:31.004Z" }}Rename a file
Section titled “Rename a file”Changes the file’s name. Works for any file the opportunity’s file list shows, including those on its notes and tasks.
PATCH /v1/opportunities/:id/files/:fileIdParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
fileId |
path | string | Yes | The file’s id. |
name |
body | string | Yes | New name, 1–191 characters. |
Rules
403when the person may not edit leads.404when the opportunity, or the file on it, does not exist.400when the name is empty.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/files/cm4fl5h4g0043k908s1t2u3vw" \ -X PATCH \ -H "X-API-Key: $ONESUITE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name":"Proposal – final.pdf"}'const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/files/cm4fl5h4g0043k908s1t2u3vw", { method: "PATCH", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ name: "Proposal – final.pdf", }),});const data = await response.json();Example response — status 200
{ "data": { "id": "cm4fl5h4g0043k908s1t2u3vw", "name": "Proposal – final.pdf", "type": "pdf", "size": 482113, "isLinked": false, "note": null, "task": null, "createdBy": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "createdAt": "2026-11-15T10:20:31.004Z", "updatedAt": "2026-11-21T09:30:44.718Z" }}Delete a file
Section titled “Delete a file”Deletes the file, whether it is on the opportunity itself or on one of its notes or tasks.
DELETE /v1/opportunities/:id/files/:fileIdParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
fileId |
path | string | Yes | The file’s id. |
Rules
403when the person may not edit leads.404when the opportunity, or the file on it, does not exist.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/files/cm4fl5h4g0043k908s1t2u3vw" \ -X DELETE \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/files/cm4fl5h4g0043k908s1t2u3vw", { method: "DELETE", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "message": "File deleted"}Download a file
Section titled “Download a file”Returns the file’s contents with its content type, as an attachment named after the file.
GET /v1/opportunities/:id/files/:fileId/downloadParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
fileId |
path | string | Yes | The file’s id. |
Rules
403when the person may not view leads.404when the opportunity, or the file on it, does not exist.409when the file is linked from a cloud drive: open it there.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/files/cm4fl5h4g0043k908s1t2u3vw/download" \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/files/cm4fl5h4g0043k908s1t2u3vw/download", { headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
"(binary contents of Proposal v2.pdf, Content-Type application/pdf)"Activity
Section titled “Activity”List an opportunity’s activity
Section titled “List an opportunity’s activity”Returns the opportunity’s activity timeline, newest first: who created it, changed its stage, amount or other fields, added notes and files, converted it, and when.
GET /v1/opportunities/:id/activityParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The opportunity’s id. |
page |
query | integer | No | Page number, from 1. Default 1. |
limit |
query | integer | No | Rows per page. Default 20, at most 1000. |
updatedSince |
query | datetime | No | Only entries recorded at or after this moment. |
Rules
403when the person may not view leads.404when the opportunity does not exist in the business.
Example request
curl "https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/activity?limit=1" \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/opportunities/cm4op1a2b0003k908q7w1e2rt/activity?limit=1", { headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "data": [ { "id": "cm4ac8m7n0055k908w4x5y6za", "action": "updated", "item": "Stage", "detail": "Negotiation", "member": { "id": "cm3qk0m4r0001l208own6e7f8", "name": "Sam Okafor" }, "createdAt": "2026-11-21T11:40:55.330Z" } ], "totalCount": 14, "page": 1, "limit": 1}