JSON Schema (draft 2020-12), emitted from the same contract the handlers validate every request and every response against.
AgentError
{
"type": "object",
"properties": {
"error": {
"type": "string"
},
"code": {
"type": "string"
},
"status": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"error",
"code",
"status"
],
"additionalProperties": false
}WebhookAck
{
"type": "object",
"properties": {},
"additionalProperties": false,
"description": "No body is required. Any 2xx acknowledges the delivery; the response body is never read."
}DraftCreatedEvent
{
"type": "object",
"properties": {
"eventId": {
"type": "string",
"minLength": 1
},
"deliveryId": {
"type": "string",
"minLength": 1
},
"occurredAt": {
"type": "string",
"minLength": 1
},
"event": {
"type": "string",
"const": "draft.created"
},
"data": {
"type": "object",
"properties": {
"documentId": {
"type": "string",
"minLength": 1
},
"blockId": {
"type": "string",
"minLength": 1
},
"draftId": {
"type": "string",
"minLength": 1
},
"authorKind": {
"type": "string",
"enum": [
"human",
"agent"
]
},
"authorLabel": {
"type": "string",
"minLength": 1
}
},
"required": [
"documentId",
"blockId",
"draftId",
"authorKind",
"authorLabel"
],
"additionalProperties": false
}
},
"required": [
"eventId",
"deliveryId",
"occurredAt",
"event",
"data"
],
"additionalProperties": false
}SectionApprovedEvent
{
"type": "object",
"properties": {
"eventId": {
"type": "string",
"minLength": 1
},
"deliveryId": {
"type": "string",
"minLength": 1
},
"occurredAt": {
"type": "string",
"minLength": 1
},
"event": {
"type": "string",
"const": "section.approved"
},
"data": {
"type": "object",
"properties": {
"documentId": {
"type": "string",
"minLength": 1
},
"blockId": {
"type": "string",
"minLength": 1
},
"draftId": {
"type": "string",
"minLength": 1
},
"reviewerLabel": {
"type": "string",
"minLength": 1
}
},
"required": [
"documentId",
"blockId",
"draftId",
"reviewerLabel"
],
"additionalProperties": false
}
},
"required": [
"eventId",
"deliveryId",
"occurredAt",
"event",
"data"
],
"additionalProperties": false
}SectionRejectedEvent
{
"type": "object",
"properties": {
"eventId": {
"type": "string",
"minLength": 1
},
"deliveryId": {
"type": "string",
"minLength": 1
},
"occurredAt": {
"type": "string",
"minLength": 1
},
"event": {
"type": "string",
"const": "section.rejected"
},
"data": {
"type": "object",
"properties": {
"documentId": {
"type": "string",
"minLength": 1
},
"blockId": {
"type": "string",
"minLength": 1
},
"draftId": {
"type": "string",
"minLength": 1
},
"reviewerLabel": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
}
},
"required": [
"documentId",
"blockId",
"draftId",
"reviewerLabel",
"reason"
],
"additionalProperties": false
}
},
"required": [
"eventId",
"deliveryId",
"occurredAt",
"event",
"data"
],
"additionalProperties": false
}ListDocumentsResponse
{
"type": "object",
"properties": {
"op": {
"type": "string",
"const": "documents.list"
},
"documents": {
"type": "array",
"items": {
"type": "object",
"properties": {
"documentId": {
"type": "string",
"minLength": 1
},
"path": {
"type": "string"
},
"title": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"pending",
"in_review",
"approved",
"archived"
]
},
"pendingDraftCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"updatedAt": {
"type": "number"
},
"createdAt": {
"type": "number"
}
},
"required": [
"documentId",
"path",
"title",
"status",
"pendingDraftCount",
"updatedAt",
"createdAt"
],
"additionalProperties": false
}
}
},
"required": [
"op",
"documents"
],
"additionalProperties": false
}GetBlockResponse
{
"type": "object",
"properties": {
"op": {
"type": "string",
"const": "blocks.get"
},
"block": {
"type": "object",
"properties": {
"blockId": {
"type": "string",
"minLength": 1
},
"documentId": {
"type": "string",
"minLength": 1
},
"order": {
"type": "number"
},
"ownerKind": {
"type": "string",
"enum": [
"human",
"agent",
"review"
]
},
"ownerLabel": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"clean",
"drafting",
"review",
"conflict"
]
},
"body": {
"type": "string"
}
},
"required": [
"blockId",
"documentId",
"order",
"ownerKind",
"ownerLabel",
"status",
"body"
],
"additionalProperties": false
},
"pendingDrafts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"draftId": {
"type": "string",
"minLength": 1
},
"blockId": {
"type": "string",
"minLength": 1
},
"authorKind": {
"type": "string",
"enum": [
"human",
"agent"
]
},
"authorLabel": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"status": {
"type": "string",
"enum": [
"pending",
"approved",
"rejected",
"superseded"
]
},
"body": {
"type": "string"
},
"createdAt": {
"type": "number"
}
},
"required": [
"draftId",
"blockId",
"authorKind",
"authorLabel",
"status",
"body",
"createdAt"
],
"additionalProperties": false
}
}
},
"required": [
"op",
"block",
"pendingDrafts"
],
"additionalProperties": false
}SubmitDraftResponse
{
"type": "object",
"properties": {
"op": {
"type": "string",
"const": "drafts.submit"
},
"draft": {
"type": "object",
"properties": {
"draftId": {
"type": "string",
"minLength": 1
},
"blockId": {
"type": "string",
"minLength": 1
},
"documentId": {
"type": "string",
"minLength": 1
},
"authorKind": {
"type": "string",
"const": "agent"
},
"status": {
"type": "string",
"const": "pending"
},
"blockStatus": {
"type": "string",
"enum": [
"clean",
"drafting",
"review",
"conflict"
]
},
"pendingDraftCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"draftId",
"blockId",
"documentId",
"authorKind",
"status",
"blockStatus",
"pendingDraftCount"
],
"additionalProperties": false
}
},
"required": [
"op",
"draft"
],
"additionalProperties": false
}SubmitDraftRequest
{
"type": "object",
"properties": {
"blockId": {
"type": "string",
"minLength": 1
},
"body": {
"type": "string",
"minLength": 1,
"maxLength": 20000
},
"authorLabel": {
"type": "string",
"minLength": 1,
"maxLength": 80
}
},
"required": [
"blockId",
"body"
],
"additionalProperties": false
}