Set a deal's field values
curl --request PUT \ --url https://example.com/api/v1/deals/example/fields \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "values": [ { "definitionId": "example", "items": [ { "done": true, "id": "example", "text": "example" } ], "value": "example" } ] }'Sets the deal’s value for one or more of the fields listed by GET /deal-field-definitions, and answers with every field shown on the deal as it now stands. A field left out keeps its value; null, an empty text or an empty list clears it. A CHECKLIST field takes items, the whole list in order, and an item sent without an id is new. Works on an open or a won deal; a lost deal answers 409 until it is reopened. A value that does not fit its field, an unknown field or a new value for a hidden field answers 422. Each save is one entry in the deal’s history. Requires deals.manage.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Deal identifier (CUID2).
Deal identifier (CUID2).
Request Body
Section titled “Request Body”object
One entry per field to set, each field once; a field left out keeps its value. A CHECKLIST field takes items, the whole list in order, where an item without an id is new. Every other kind takes value: a text, an address, a day as YYYY-MM-DD, an option of the field, or “true” or “false”. Null, an empty text or an empty list clears the field.
object
object
Example generated
{ "values": [ { "definitionId": "example", "items": [ { "done": true, "id": "example", "text": "example" } ], "value": "example" } ]}Responses
Section titled “Responses”The deal’s field values after the save.
object
One deal field with a deal’s value for it.
object
The deal field this value belongs to.
True when the deal holds a value, or at least one checklist item, for the field.
The items of a CHECKLIST field, in order; null while it has none and on every other kind.
object
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.
The options of a DROPDOWN field; empty for every other kind.
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.
Example
{ "data": [ { "kind": "TEXT" } ]}Validation error. Parse failures include field paths and expectations.
Validation error with safe field paths and expected values; submitted values are never returned.
object
object
Stable machine-readable error code.
object
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Unauthorized.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Forbidden.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Not found.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Conflict.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Invalid input.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Rate limit exceeded. Wait for Retry-After before retrying.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Headers
Section titled “Headers”Maximum requests in the current quota window.
Quota policy in requests and window seconds, for example 60;w=60.
Requests left in this quota window (zero when blocked).
Seconds until the current quota window resets, when available from the rate-limit store.
Seconds until another request may be attempted.
Chelsea is operated by Arepa Labs LLC