Events
Append immutable events to document timelines in the Carrot API.
Events are the primary mechanism for evolving document state. After a document is created, all relevant changes are recorded as new events.
Create event
Authorization
OAuth2ClientCredentials OAuth 2.0 Client Credentials authentication.
In: header
Path Parameters
Document identifier
Header Parameters
Authorization bearer token
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.carrot.eco/documents/string/events" \ -H "Authorization: string" \ -H "Content-Type: application/json" \ -d '{ "externalCreatedAt": "2020-01-01T00:00:00.000Z", "isPublic": true, "name": "CLOSE" }'{
"documentId": "28b04f62-8fe2-4332-b854-fe8a922788b5",
"eventId": "JrSRCUhKOxKyUujM2DkH9"
}Use POST /documents/{documentId}/events to append one event to a document timeline.
Batch events
Authorization
OAuth2ClientCredentials OAuth 2.0 Client Credentials authentication.
In: header
Header Parameters
Authorization bearer token
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.carrot.eco/documents/events" \ -H "Authorization: string" \ -H "Content-Type: application/json" \ -d '{ "events": [ { "externalCreatedAt": "2020-01-01T00:00:00.000Z", "isPublic": true, "name": "Pick-up" } ] }'{
"documentId": "28b04f62-8fe2-4332-b854-fe8a922788b5",
"events": [
{
"eventId": "string",
"targetDocumentId": "string"
}
]
}Use POST /documents/events to create multiple events for a document in a single request. Each event
in the batch follows the same schema and validation rules as the single-document endpoint above.
Logical event types
| Type | Purpose |
|---|---|
ACTOR | Adds a participant role on the document and can update permissions. |
CLOSE | Closes the document for future updates (except specific relation workflows). |
CANCEL | Cancels the document and blocks future actions. |
RELATED | Links this document to another document. |
UPDATE | Updates specific document visibility fields. |
SPLIT | Creates a new document with part of the original value. No dedicated schema — represented via target payload fields. |
OUTPUT | Creates a new downstream document from current data. No dedicated schema — represented via target payload fields. |
CUSTOM | Methodology-specific event names not covered by built-in types. |
The current schema defines six discriminated event schemas (CloseEvent, ActorEvent, CancelEvent,
RelatedEvent, UpdateEvent, CustomEvent). SPLIT and OUTPUT do not have their own schemas and are
instead represented through event data using the target payload fields.
Ordering and consistency
externalCreatedAtmust be before current time.externalCreatedAtmust be equal to or later than the last recorded event.- Use
deduplicationIdwhen retrying event submissions.
Event propagation
When propagateEvent is enabled, propagation applies only one relationship level deep.
Some event combinations are restricted (for example, propagated events cannot send value).
For complete event definitions and methodology alignment, see Event Specification.