Skip to content

Update a deal

PATCH
/deals/{id}
Code sample: Shell / cURL
curl --request PATCH \
--url https://example.com/api/v1/deals/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "amount": 1, "expectedCloseDate": "example", "leadSourceId": "example", "ownerId": "example", "projectTypeId": "example", "title": "example" }'

Updates mutable fields on a deal. Requires deals.manage.

id
required

Deal identifier (CUID2).

string
>= 1 characters

Deal identifier (CUID2).

Media typeapplication/json
object
amount
Any of:
number
<= 999999999999.99
expectedCloseDate
Any of:
string
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
leadSourceId
string | null
ownerId
string
projectTypeId
string | null
title

A blank or null title resets to the company name.

Any of:
string
<= 255 characters

Example generated

{
"amount": 1,
"expectedCloseDate": "example",
"leadSourceId": "example",
"ownerId": "example",
"projectTypeId": "example",
"title": "example"
}

Updated deal.

Media typeapplication/json
object
data
required
object
amount
required
number | null
clientId
required
string
createdAt
required
string
expectedCloseDate
required
string | null
fields

The deal’s field values. Present on GET /deals/{id} only; absent on lists, on write responses and on an older server.

Array<object>

One deal field with a deal’s value for it.

object
definitionId
required

The deal field this value belongs to.

string
hasValue
required

True when the deal holds a value, or at least one checklist item, for the field.

boolean
items
required

The items of a CHECKLIST field, in order; null while it has none and on every other kind.

Any of:
Array<object>
object
done
required
boolean
id
required
string
text
required
string
kind
required

What a deal field holds: a short text, a long text, a link, a day, one option of a list, a yes or no, or a checklist.

string
Allowed values: TEXT MULTILINE URL DATE DROPDOWN CHECKBOX CHECKLIST
name
required
string
options
required

The options of a DROPDOWN field; empty for every other kind.

Array<string>
value
required

The value of every kind but CHECKLIST, null while the field is empty: the text (TEXT, MULTILINE), the address (URL), the day as YYYY-MM-DD (DATE), the chosen option (DROPDOWN), or “true” or “false” (CHECKBOX). Always null on a CHECKLIST field.

string | null
finalAmount
required
number | null
id
required
string
isGeneral

True when no project was kicked off from the deal, so it sits in its company’s General section, as the company’s Deals tab marks it. Returned by the list only; absent on an older server.

boolean
kickoffProjectId
required

The kickoff project the won deal was handed to delivery in.

string | null
kickoffProjectName

The name of the kickoff project, when the caller reaches that project; null otherwise. Returned by the list only; absent on an older server.

string | null
leadSourceId
required
string | null
lostAt
required
string | null
lostReason
required

The optional note written beside the lost reason. A deal lost before reasons existed keeps its old text here.

string | null
lostReasonId

The reason the deal was lost, an id from the lost reasons list; null on an open or won deal and on a deal lost before reasons existed. Absent on an older server.

string | null
outcome
required
string
Allowed values: OPEN WON LOST
ownerId
required
string
projectTypeId
required
string | null
stageId
required
string
title
required
string | null
updatedAt
required
string
wonAt
required
string | null

Example

{
"data": {
"fields": [
{
"kind": "TEXT"
}
],
"outcome": "OPEN"
}
}

Validation error. Parse failures include field paths and expectations.

Media typeapplication/json

Validation error with safe field paths and expected values; submitted values are never returned.

object
error
required
object
code
required

Stable machine-readable error code.

string
issues
Array<object>
object
expected
required
string
message
required
string
path
required
Array<string | number>
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Invalid input.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.