{"openapi":"3.0.3","info":{"title":"DiviDen Agent API v2","version":"2.0.0","description":"External API for AI agents to interact with the DiviDen Command Center.\n\nAll endpoints require Bearer token authentication via the Authorization header.\nGenerate API keys from the DiviDen Settings page.\n\n## Authentication\n```\nAuthorization: Bearer dvd_your_api_key_here\n```\n\n## Rate Limiting\n- 120 requests per minute per API key\n- Rate limit headers included in responses:\n  - X-RateLimit-Limit\n  - X-RateLimit-Remaining\n  - X-RateLimit-Reset\n\n## Error Responses\nAll errors follow a consistent format:\n```json\n{\n  \"success\": false,\n  \"error\": \"Human-readable error message\"\n}\n```\n\n### HTTP Status Codes\n- 200: Success\n- 201: Created\n- 400: Bad Request (invalid input)\n- 401: Unauthorized (missing/invalid token)\n- 403: Forbidden (expired/deactivated key or insufficient permissions)\n- 404: Not Found\n- 429: Rate Limited\n- 500: Internal Server Error\n"},"servers":[{"url":"/api/v2","description":"Agent API v2"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key generated from DiviDen Settings page"}},"schemas":{"QueueItem":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["task","notification","reminder","agent_suggestion"]},"title":{"type":"string"},"description":{"type":"string","nullable":true},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"status":{"type":"string","enum":["pending_confirmation","ready","in_progress","done_today","blocked"],"description":"pending_confirmation = awaiting user approval before entering queue"},"source":{"type":"string","nullable":true},"metadata":{"type":"string","nullable":true,"description":"JSON string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"KanbanCard":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["leads","qualifying","proposal","negotiation","contracted","active","development","planning","paused","completed"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"assignee":{"type":"string","enum":["human","agent"]},"dueDate":{"type":"string","format":"date-time","nullable":true},"order":{"type":"integer"},"checklist":{"type":"array","items":{"$ref":"#/components/schemas/ChecklistItem"}},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/CardContact"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ChecklistItem":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"completed":{"type":"boolean"},"order":{"type":"integer"}}},"CardContact":{"type":"object","properties":{"id":{"type":"string"},"contactId":{"type":"string"},"role":{"type":"string","nullable":true},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true},"company":{"type":"string","nullable":true}}}}},"Contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"role":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"enrichedData":{"type":"string","nullable":true},"cards":{"type":"array","items":{"$ref":"#/components/schemas/CardContact"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ChatMessage":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"},"agentName":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"Pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"hasMore":{"type":"boolean"}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"string"}}},"dividen.agentapi.v1.AgentChatMessage":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","description":"'user' | 'assistant' | 'system'. Stored as free text and published as it is stored; the REST route does not validate it on the way out either."},"content":{"type":"string"},"userId":{"type":"string"},"metadata":{"type":"string"},"clearedAt":{"type":"string"},"sandboxId":{"type":"string"},"createdAt":{"type":"string"}},"description":"One chat message, mirroring `ChatMessage`."},"dividen.agentapi.v1.AgentChatPagination":{"type":"object","properties":{"limit":{"type":"integer","format":"int32"},"cursor":{"type":"string","description":"The id to pass as the next request's `cursor`. ABSENT when there is no next page, where REST emits `null`."},"hasMore":{"type":"boolean"}},"description":"Mirrors the REST body's `pagination` object."},"dividen.agentapi.v1.AgentContact":{"type":"object","properties":{"id":{"type":"string","description":"── always present ──"},"name":{"type":"string"},"userId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"email":{"type":"string","description":"── nullable in the model: ABSENT on the wire, never null and never \"\" ──"},"phone":{"type":"string"},"company":{"type":"string"},"role":{"type":"string"},"preferredChannel":{"type":"string"},"notes":{"type":"string"},"tags":{"type":"string"},"source":{"type":"string"},"enrichedData":{"type":"string"},"platformUserId":{"type":"string"},"platformUserStatus":{"type":"string"},"matchedAt":{"type":"string"},"lastInteractionAt":{"type":"string"},"lastInteractionType":{"type":"string"},"cards":{"type":"array","items":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentContactCardLink"},"description":"The contact's card links. Empty is an answer: a contact on no cards."}},"description":"One contact, mirroring `Contact` field for field."},"dividen.agentapi.v1.AgentContactCardBrief":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string"}},"description":"The LIST's card projection: four fields."},"dividen.agentapi.v1.AgentContactCardDetail":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string"},"assignee":{"type":"string","description":"Defaults to \"human\" in the model, so never absent."},"dueDate":{"type":"string"}},"description":"The DETAIL's card projection: the brief plus two fields."},"dividen.agentapi.v1.AgentContactCardLink":{"type":"object","properties":{"id":{"type":"string"},"cardId":{"type":"string"},"contactId":{"type":"string"},"role":{"type":"string"},"involvement":{"type":"string","description":"Defaults to \"related\"."},"canDelegate":{"type":"boolean"},"createdAt":{"type":"string"},"brief":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentContactCardBrief"},"detail":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentContactCardDetail"}},"description":"A contact-to-card link: the join row itself, plus the card it points at."},"dividen.agentapi.v1.AgentContactPagination":{"type":"object","properties":{"total":{"type":"integer","format":"int32"},"limit":{"type":"integer","format":"int32"},"offset":{"type":"integer","format":"int32"},"hasMore":{"type":"boolean"}}},"dividen.agentapi.v1.AgentKanbanCard":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"summary":{"type":"string"},"brief":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string"},"assignee":{"type":"string"},"assigneeUserId":{"type":"string"},"assigneeAgentId":{"type":"string"},"assignedById":{"type":"string"},"dueDate":{"type":"string"},"reminderOffsetMinutes":{"type":"integer","format":"int32"},"reminderFiredAt":{"type":"string"},"order":{"type":"integer","format":"int32"},"userId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"workspaceId":{"type":"string"},"originCardId":{"type":"string"},"originUserId":{"type":"string"},"sourceRelayId":{"type":"string"},"sharedProjectId":{"type":"string"},"templateId":{"type":"string"},"counterpartyUserId":{"type":"string"},"projectRole":{"type":"string"},"paymentHoldId":{"type":"string"},"paymentStatus":{"type":"string"},"projectPrice":{"type":"number","format":"double"},"completionSuggestedBy":{"type":"string"},"completionSuggestedAt":{"type":"string"},"cardType":{"type":"string"},"labels":{"type":"array","items":{"type":"string"},"description":"THE COST, stated because a reader will otherwise meet it as a surprise: REST emits `\"labels\": null` for a card with none, and this emits `[]`. A row holding anything OTHER than an array of strings is coerced to `[]` by the shared read rather than crashing the response. Both behaviours are asserted in rpc-kanban-parity.test.ts so neither can change silently."},"coverColor":{"type":"string"},"coverImageUrl":{"type":"string"},"priorityScore":{"type":"integer","format":"int32"},"startDate":{"type":"string"},"lastActivityAt":{"type":"string"},"isArchived":{"type":"boolean"},"parentCardId":{"type":"string"},"parentChecklistItemId":{"type":"string"},"cardRole":{"type":"string"},"rollupCardId":{"type":"string"},"projectTaskKey":{"type":"string"},"sourceRunId":{"type":"string"},"sourceChannel":{"type":"string"},"settledAt":{"type":"string"},"differenceId":{"type":"string"},"unifiedThreadId":{"type":"string"},"checklist":{"type":"array","items":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentKanbanChecklistItem"}},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentKanbanCardContact"}}},"description":"One card, mirroring `KanbanCard`."},"dividen.agentapi.v1.AgentKanbanCardContact":{"type":"object","properties":{"id":{"type":"string"},"cardId":{"type":"string"},"contactId":{"type":"string"},"role":{"type":"string"},"involvement":{"type":"string"},"canDelegate":{"type":"boolean"},"createdAt":{"type":"string"},"contact":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentKanbanContact"}},"description":"The contact rows joined to a card, mirroring `CardContact`.\n\n`contact` is the SELECTED subset the REST route asks for — four fields, not the whole Contact model. Restating it here keeps it an allow-list: a column added to Contact cannot ride onto this published surface without an edit."},"dividen.agentapi.v1.AgentKanbanCardContactDetail":{"type":"object","properties":{"id":{"type":"string"},"cardId":{"type":"string"},"contactId":{"type":"string"},"role":{"type":"string"},"involvement":{"type":"string"},"canDelegate":{"type":"boolean"},"createdAt":{"type":"string"},"contact":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentKanbanContactDetail"}},"description":"The contact rows joined to a card on the DETAIL arm, mirroring `CardContact`."},"dividen.agentapi.v1.AgentKanbanCardDetail":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"summary":{"type":"string"},"brief":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string"},"assignee":{"type":"string"},"assigneeUserId":{"type":"string"},"assigneeAgentId":{"type":"string"},"assignedById":{"type":"string"},"dueDate":{"type":"string"},"reminderOffsetMinutes":{"type":"integer","format":"int32"},"reminderFiredAt":{"type":"string"},"order":{"type":"integer","format":"int32"},"userId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"workspaceId":{"type":"string"},"originCardId":{"type":"string"},"originUserId":{"type":"string"},"sourceRelayId":{"type":"string"},"sharedProjectId":{"type":"string"},"templateId":{"type":"string"},"counterpartyUserId":{"type":"string"},"projectRole":{"type":"string"},"paymentHoldId":{"type":"string"},"paymentStatus":{"type":"string"},"projectPrice":{"type":"number","format":"double"},"completionSuggestedBy":{"type":"string"},"completionSuggestedAt":{"type":"string"},"cardType":{"type":"string"},"labels":{"type":"array","items":{"type":"string"}},"coverColor":{"type":"string"},"coverImageUrl":{"type":"string"},"priorityScore":{"type":"integer","format":"int32"},"startDate":{"type":"string"},"lastActivityAt":{"type":"string"},"isArchived":{"type":"boolean"},"parentCardId":{"type":"string"},"parentChecklistItemId":{"type":"string"},"cardRole":{"type":"string"},"rollupCardId":{"type":"string"},"projectTaskKey":{"type":"string"},"sourceRunId":{"type":"string"},"sourceChannel":{"type":"string"},"settledAt":{"type":"string"},"differenceId":{"type":"string"},"unifiedThreadId":{"type":"string"},"checklist":{"type":"array","items":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentKanbanChecklistItem"}},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentKanbanCardContactDetail"}}},"description":"One card on the DETAIL arm, mirroring `KanbanCard`."},"dividen.agentapi.v1.AgentKanbanChecklistItem":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"summary":{"type":"string"},"brief":{"type":"string"},"completed":{"type":"boolean"},"order":{"type":"integer","format":"int32"},"cardId":{"type":"string"},"dueDate":{"type":"string"},"sourceType":{"type":"string"},"sourceId":{"type":"string"},"sourceLabel":{"type":"string"},"assigneeType":{"type":"string"},"assigneeName":{"type":"string"},"assigneeId":{"type":"string"},"delegationStatus":{"type":"string"},"childCardId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"description":"One checklist item, mirroring `ChecklistItem`."},"dividen.agentapi.v1.AgentKanbanContact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"company":{"type":"string"}},"description":"The four Contact fields GET /api/v2/kanban selects. Nothing else crosses."},"dividen.agentapi.v1.AgentKanbanContactDetail":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"company":{"type":"string"},"phone":{"type":"string"},"role":{"type":"string"},"tags":{"type":"string"}},"description":"The seven Contact fields GET /api/v2/kanban/{id} selects. Nothing else crosses."},"dividen.agentapi.v1.AgentKanbanPagination":{"type":"object","properties":{"total":{"type":"integer","format":"int32"},"limit":{"type":"integer","format":"int32"},"offset":{"type":"integer","format":"int32"},"hasMore":{"type":"boolean"}},"description":"Mirrors the REST body's `pagination` object."},"dividen.agentapi.v1.AgentKanbanServiceGetCardResponse":{"type":"object","properties":{"card":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentKanbanCardDetail"}}},"dividen.agentapi.v1.AgentKanbanServiceListCardsResponse":{"type":"object","properties":{"cards":{"type":"array","items":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentKanbanCard"}},"pagination":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentKanbanPagination"}}},"dividen.agentapi.v1.AgentQueueItem":{"type":"object","properties":{"id":{"type":"string","description":"── always present ──"},"type":{"type":"string"},"title":{"type":"string"},"priority":{"type":"string"},"status":{"type":"string"},"taskOrigin":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"description":{"type":"string","description":"── nullable in the model: ABSENT on the wire, never null, never \"\" ──"},"source":{"type":"string"},"userId":{"type":"string"},"projectId":{"type":"string"},"teamId":{"type":"string"},"cardId":{"type":"string"},"metadata":{"type":"string"},"parentTaskId":{"type":"string"},"dependsOn":{"type":"string"},"subtaskOrder":{"type":"integer","format":"int32"},"requesterEmail":{"type":"string"},"requesterName":{"type":"string"},"executionId":{"type":"string"},"callbackUrl":{"type":"string"},"sourceInstanceName":{"type":"string"},"projectRequestId":{"type":"string"}},"description":"One queue item, mirroring `QueueItem` field for field."},"dividen.agentapi.v1.AgentSettingsServiceGetSettingsResponse":{"type":"object","properties":{"mode":{"type":"string","description":"Always \"cockpit\". `chief_of_staff` mode was removed, but the key stays: this is a PUBLISHED contract and the clients reading it are not ours to redeploy. A STRING, not an enum — protobuf JSON renders an enum as its declared name (\"MODE_COCKPIT\") while REST returns \"cockpit\", so an enum would make the two transports disagree on the fallback path, which is the path nobody exercises."},"queueAutoApprove":{"type":"boolean"},"diviName":{"type":"string"},"goalsEnabled":{"type":"boolean"},"onboardingComplete":{"type":"boolean"},"onboardingPhase":{"type":"integer","format":"int32"}},"description":"Mirrors the REST body's `data` object field for field."},"dividen.agentapi.v1.AgentSettingsServiceUpdateSettingsRequest":{"type":"object","properties":{"queueAutoApprove":{"type":"boolean","description":"Turn queue auto-approve on or off."},"mode":{"type":"string","description":"Accepted for backward compatibility. Has no effect."}},"description":"A settings write. Every field is OPTIONAL and absence means \"leave it alone\"."},"dividen.agentapi.v1.AgentSettingsServiceUpdateSettingsResponse":{"type":"object","properties":{"queueAutoApprove":{"type":"boolean","description":"Present when the caller supplied it."},"mode":{"type":"string","description":"Always \"cockpit\", and present only when the caller supplied `mode`."}},"description":"What the write applied. Only the fields that changed appear."},"dividen.agentapi.v1.AgentSharedChatServiceListSharedChatMessagesResponse":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentChatMessage"},"description":"CHRONOLOGICAL — oldest first — even though the page is cut newest-first. The REST route reverses after cutting, and so does the shared read."},"pagination":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentChatPagination"}}},"dividen.agentapi.v1.AgentSharedChatServiceSendSharedChatMessageRequest":{"type":"object","properties":{"content":{"type":"string","description":"Required and non-empty. REST refuses a missing, non-string, or whitespace-only value with ONE message, so absent and empty are one case."},"metadataJson":{"type":"string","description":"Empty means no metadata. ⚠ UNPARSEABLE TEXT IS REFUSED (InvalidArgument) — an RPC-only refusal with no REST equivalent, because a REST body is already parsed JSON by the time the route sees it. Stated rather than hidden."}}},"dividen.agentapi.v1.AgentSharedChatServiceSendSharedChatMessageResponse":{"type":"object","properties":{"id":{"type":"string","description":"The created message's id."},"role":{"type":"string","description":"Always 'assistant'. Not a request field: letting a caller name the role would let an API key forge a message attributed to the human."},"content":{"type":"string","description":"The stored content — TRIMMED, which is not necessarily what was sent."},"agentName":{"type":"string","description":"The name this message is attributed to: the `x-agent-name` REQUEST HEADER when present, else the API key's own name. Read off the header on both transports."},"createdAt":{"type":"string"}}},"dividen.agentapi.v1.ConfirmAgentQueueItemRequest":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string","description":"\"approve\" or \"reject\". Anything else REFUSES."}}},"dividen.agentapi.v1.ConfirmAgentQueueItemResponse":{"type":"object","properties":{"item":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentQueueItem"},"message":{"type":"string","description":"Always present, and quotes the item's title — the REST twin's wording verbatim, e.g. `\"Ship it\" approved and added to queue.`"}}},"dividen.agentapi.v1.GetAgentContactResponse":{"type":"object","properties":{"contact":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentContact"}}},"dividen.agentapi.v1.ListAgentContactsResponse":{"type":"object","properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentContact"}},"pagination":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentContactPagination"}}},"dividen.agentapi.v1.ReportAgentQueueResultRequest":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string","description":"The agent's output. REQUIRED and refused when empty."},"status":{"type":"string","description":"Target status. Absent or empty means \"done_today\"."}}},"dividen.agentapi.v1.ReportAgentQueueResultResponse":{"type":"object","properties":{"item":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentQueueItem"},"autoDispatched":{"type":"boolean"}}},"dividen.agentapi.v1.SetAgentQueueItemStatusRequest":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","description":"The target status, validated against the shared transition table. An illegal move is refused with the reason rather than silently ignored."}}},"dividen.agentapi.v1.SetAgentQueueItemStatusResponse":{"type":"object","properties":{"item":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentQueueItem"},"autoDispatched":{"type":"boolean"}}},"dividen.updates.v1.ListUpdatesResponse":{"type":"object","properties":{"updates":{"type":"array","items":{"$ref":"#/components/schemas/dividen.updates.v1.Update"}},"total":{"type":"integer","format":"int32","description":"Total entries in the feed, BEFORE `limit` and the filters — the REST route reports the whole changelog's size here, and a client uses it to know more exists."},"returned":{"type":"integer","format":"int32"},"source":{"type":"string","description":"Always \"dividen.ai\"; federation consumers read it to attribute the feed."},"generatedAt":{"type":"string","description":"ISO-8601 timestamp of this response."}}},"dividen.updates.v1.Update":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","description":"ISO date string, YYYY-MM-DD."},"time":{"type":"string","description":"Display time, e.g. \"2:30 PM\". Absent on older entries."},"title":{"type":"string"},"subtitle":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"content":{"type":"string","description":"Markdown-ish body, rendered by the consumer."},"adoptionModuleId":{"type":"string","description":"Links a shipped entry to the onboarding module that teaches the feature."}},"description":"One changelog entry, mirroring `Update` in src/lib/updates.ts exactly."}}},"paths":{"/chat/mentions":{"servers":[{"url":"/api","description":"Not under the v2 base"}],"get":{"tags":["Chat"],"summary":"Search mentionable entities (people, teams, agents, commands, channels)","description":"Returns matching entities for the composer's inline mention search — one source per trigger symbol: @ people+teams, ! agents (installed + own listings), / commands, # channels. Results are filtered by the authenticated user's access (e.g., teams they belong to, accessible channels).","parameters":[{"name":"type","in":"query","required":true,"schema":{"type":"string","enum":["people","agents","teams","commands","channels"]},"description":"Entity type to search"},{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Search query string (name, username, or team name). Empty returns top results."}],"responses":{"200":{"description":"Array of matching entities","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"avatar":{"type":"string","nullable":true},"subtitle":{"type":"string","nullable":true},"type":{"type":"string","enum":["person","agent","team","command","channel"]},"memberCount":{"type":"integer","nullable":true,"description":"Only present for type=team"}}}}}}},"401":{"description":"Unauthorized"}}}},"/connections":{"get":{"tags":["Federation"],"summary":"List federated connections","description":"Returns active federated connections for the authenticated user. Requires Bearer token auth.","responses":{"200":{"description":"List of federated connections","content":{"application/json":{"example":{"connections":[{"id":"clx...","status":"active","peerInstanceUrl":"https://other.instance.com","peerUserEmail":"user@other.com","peerUserName":"User Name"}]}}}}}},"post":{"tags":["Federation"],"summary":"Create federation connection request","description":"Receive an inbound connection request from a remote instance. No auth required — uses federation token in body. Supports both v1 and v2 field naming conventions. Includes automatic duplicate detection.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["fromInstanceUrl","fromUserEmail","toUserEmail","federationToken"],"properties":{"fromInstanceUrl":{"type":"string","description":"URL of the requesting instance"},"fromInstanceName":{"type":"string","description":"Name of the requesting instance"},"fromUserEmail":{"type":"string","description":"Email of the requesting user"},"fromUserName":{"type":"string","description":"Name of the requesting user"},"toUserEmail":{"type":"string","description":"Email of the target user on this instance"},"federationToken":{"type":"string","description":"Token for authenticating future requests"},"connectionId":{"type":"string","description":"Remote connection ID (for linking)"}}}}}},"responses":{"200":{"description":"Connection created or already exists","content":{"application/json":{"example":{"success":true,"connectionId":"clx...","status":"active"}}}},"403":{"description":"Federation disabled or instance not in allowlist"},"404":{"description":"Target user not found on this instance"}}}},"/contacts":{"get":{"operationId":"AgentContactsService_ListAgentContacts","description":"List the contacts of the account this API key belongs to.\n\nFilters match substrings and are CASE-SENSITIVE. Results are ordered by name.","summary":"List the contacts of the account this API key belongs to.","tags":["AgentContactsService"],"parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.ListAgentContactsResponse"}}}},"400":{"description":"Bad Request (invalid input)"},"401":{"description":"Unauthorized (missing or invalid token)"},"403":{"description":"Forbidden (expired/deactivated key or insufficient permissions)"},"429":{"description":"Rate limited"},"500":{"description":"Internal Server Error"}}}},"/contacts/{id}":{"get":{"operationId":"AgentContactsService_GetAgentContact","description":"Read one contact, including its card links with fuller card detail than the list.","summary":"Read one contact, including its card links with fuller card detail than the list.","tags":["AgentContactsService"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.GetAgentContactResponse"}}}},"400":{"description":"Bad Request (invalid input)"},"401":{"description":"Unauthorized (missing or invalid token)"},"403":{"description":"Forbidden (expired/deactivated key or insufficient permissions)"},"429":{"description":"Rate limited"},"500":{"description":"Internal Server Error"}}}},"/federation/agents":{"post":{"tags":["Federation"],"summary":"Batch sync agents from a federated instance","description":"Push agents from a self-hosted instance to the DiviDen marketplace. Accepts full agent config including pricing tiers, integration kit, and display fields. Max 50 agents per call.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["agents"],"properties":{"agents":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","description":"Remote agent ID on your instance"},"name":{"type":"string"},"description":{"type":"string"},"endpointUrl":{"type":"string","description":"A2A/MCP endpoint URL"},"developerName":{"type":"string"},"category":{"type":"string","enum":["research","coding","writing","analysis","operations","creative","general"]},"pricingModel":{"type":"string","enum":["free","per_task","tiered","dynamic"]},"pricePerTask":{"type":"number"},"pricingConfig":{"type":"object","description":"Full pricing configuration. For tiered: include tiers[]. For dynamic: include dynamicConfig.","properties":{"model":{"type":"string","enum":["free","per_task","tiered","dynamic"]},"tiers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"pricePerTask":{"type":"number"},"taskLimit":{"type":"integer"},"description":{"type":"string"}}}},"dynamicConfig":{"type":"object","properties":{"estimateRange":{"type":"array","items":{"type":"number"},"description":"[min, max] estimated cost"},"requiresApproval":{"type":"boolean","description":"User must approve price before charge"},"description":{"type":"string"}}}}},"installGuide":{"type":"string","description":"Markdown post-install instructions"},"commands":{"type":"array","description":"[{name, description, usage}]"},"taskTypes":{"type":"array","description":"What this agent handles"},"contextInstructions":{"type":"string"},"supportsA2A":{"type":"boolean"},"supportsMCP":{"type":"boolean"},"version":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Sync results with per-agent status"},"401":{"description":"Invalid platform token"},"403":{"description":"Marketplace not enabled"}}},"get":{"tags":["Federation"],"summary":"List agents synced from this instance","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of synced agents with stats"}}}},"/federation/agents/{remoteId}":{"put":{"tags":["Federation"],"summary":"Register or update a single agent","description":"Preferred endpoint for managing individual agents. Full agent config accepted. Creates if new, updates if exists.","security":[{"bearerAuth":[]}],"parameters":[{"name":"remoteId","in":"path","required":true,"schema":{"type":"string"},"description":"Agent ID on your instance"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"endpointUrl":{"type":"string"},"pricingModel":{"type":"string","enum":["free","per_task","tiered","dynamic"]},"pricePerTask":{"type":"number"},"pricingConfig":{"type":"object","description":"Full PricingConfig (see batch sync docs)"},"installGuide":{"type":"string"},"commands":{"type":"array"},"taskTypes":{"type":"array"}}}}}},"responses":{"200":{"description":"Agent updated"},"201":{"description":"Agent created"},"409":{"description":"Slug conflict"}}},"get":{"tags":["Federation"],"summary":"Get a single synced agent","security":[{"bearerAuth":[]}],"parameters":[{"name":"remoteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Agent details with revenue stats"},"404":{"description":"Agent not found"}}},"delete":{"tags":["Federation"],"summary":"Remove a synced agent from marketplace","description":"Permanently removes the agent and all its subscriptions and executions.","security":[{"bearerAuth":[]}],"parameters":[{"name":"remoteId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Agent deleted"},"404":{"description":"Agent not found"}}}},"/federation/heartbeat":{"post":{"tags":["Federation"],"summary":"Instance heartbeat","description":"Periodic health check from federated instances. Updates stats and returns network info.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"userCount":{"type":"integer"},"agentCount":{"type":"integer"},"status":{"type":"string","enum":["healthy","degraded","maintenance"]}}}}}},"responses":{"200":{"description":"Heartbeat acknowledged with network stats"}}}},"/federation/marketplace-link":{"post":{"tags":["Federation"],"summary":"Enable/disable marketplace participation","description":"Requires platform token from registration. Allows self-hosted instances to list agents on the managed marketplace.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["enable","disable","status"]}}}}}},"responses":{"200":{"description":"Marketplace link status updated"}}}},"/federation/register":{"post":{"tags":["Federation"],"summary":"Register self-hosted instance with the managed platform","description":"Connect to Network endpoint. Returns a platform token for authenticated API access.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","baseUrl","apiKey"],"properties":{"name":{"type":"string","description":"Instance display name"},"baseUrl":{"type":"string","description":"Instance public URL"},"apiKey":{"type":"string","description":"Instance federation API key"},"version":{"type":"string"},"userCount":{"type":"integer"},"agentCount":{"type":"integer"},"capabilities":{"type":"object"}}}}}},"responses":{"201":{"description":"Registration successful. Returns platformToken and available endpoints."},"403":{"description":"API key mismatch on re-registration"}}}},"/federation/validate-payment":{"post":{"tags":["Federation"],"summary":"Validate network payment fee","description":"Validates that a proposed payment fee meets the network minimum floor.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["transactionType","grossAmount","proposedFeePercent"],"properties":{"transactionType":{"type":"string","enum":["marketplace","recruiting"]},"grossAmount":{"type":"number"},"proposedFeePercent":{"type":"number"},"agentId":{"type":"string"},"executionId":{"type":"string"},"contractId":{"type":"string"}}}}}},"responses":{"200":{"description":"Validation result with enforced fee details"},"401":{"description":"Invalid or missing platformToken"}}}},"/kanban":{"get":{"operationId":"AgentKanbanService_ListCards","description":"List the kanban cards on the board of the account this API key belongs to, with their checklists and linked contacts.","summary":"List the kanban cards on the board of the account this API key belongs to, with their checklists and linked contacts.","tags":["AgentKanbanService"],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"priority","in":"query","required":false,"schema":{"type":"string"}},{"name":"assignee","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentKanbanServiceListCardsResponse"}}}},"400":{"description":"Bad Request (invalid input)"},"401":{"description":"Unauthorized (missing or invalid token)"},"403":{"description":"Forbidden (expired/deactivated key or insufficient permissions)"},"429":{"description":"Rate limited"},"500":{"description":"Internal Server Error"}}}},"/kanban/{id}":{"get":{"operationId":"AgentKanbanService_GetCard","description":"Read one card on the board of the account this API key belongs to, with its checklist and its linked contacts.\n\nThe contact rows carry more detail here than on the list — phone, role and tags as well as name, email and company.","summary":"Read one card on the board of the account this API key belongs to, with its checklist and its linked contacts.","tags":["AgentKanbanService"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentKanbanServiceGetCardResponse"}}}},"400":{"description":"Bad Request (invalid input)"},"401":{"description":"Unauthorized (missing or invalid token)"},"403":{"description":"Forbidden (expired/deactivated key or insufficient permissions)"},"429":{"description":"Rate limited"},"500":{"description":"Internal Server Error"}}}},"/marketplace/webhook":{"servers":[{"url":"/api","description":"Not under the v2 base"}],"post":{"tags":["Marketplace"],"summary":"Receive marketplace webhooks (agent approval, etc.)","description":"Webhook receiver for events from the managed marketplace. Currently supports agent_approval events fired when a federated agent is approved/rejected.","parameters":[{"name":"X-Federation-Token","in":"header","required":true,"schema":{"type":"string"},"description":"Federation API key for authentication"},{"name":"X-DiviDen-Event","in":"header","required":false,"schema":{"type":"string"},"description":"Event type hint"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event"],"properties":{"event":{"type":"string","enum":["agent_approval"]},"agentId":{"type":"string","description":"Remote agent ID (your local agent ID)"},"marketplaceId":{"type":"string","description":"ID on the managed marketplace"},"name":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["active","rejected","disabled"]},"reason":{"type":"string","nullable":true},"timestamp":{"type":"string","format":"date-time"}}}}}},"responses":{"200":{"description":"Webhook received and processed"},"400":{"description":"Missing required fields"},"401":{"description":"Invalid federation token"}}}},"/network/discover":{"get":{"tags":["Network"],"summary":"Network discovery feed","description":"Browse public profiles, teams, and marketplace agents. Authenticated federated instances get richer data.","security":[],"parameters":[{"name":"type","in":"query","schema":{"type":"string","enum":["profiles","teams","agents","all"],"default":"all"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}},{"name":"q","in":"query","schema":{"type":"string"},"description":"Search term"}],"responses":{"200":{"description":"Discovery results with network stats"}}}},"/prompt-groups":{"get":{"tags":["Federation"],"summary":"Get relevance engine prompt groups and CapabilityModule spec","description":"Returns the complete prompt group registry (17 static groups), signal patterns, scoring parameters, and the CapabilityModule interface spec. Designed for federation alignment — other instances can sync their signal patterns.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Prompt groups, scoring config, and CapabilityModule spec","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"totalGroups":{"type":"integer"},"groups":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"name":{"type":"string"},"alwaysLoaded":{"type":"boolean"},"signalPatterns":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}}}},"scoring":{"type":"object"},"capabilityModuleSpec":{"type":"object"},"dynamicModules":{"type":"object"}}}}}},"401":{"description":"Invalid bearer token"}}}},"/queue":{"get":{"tags":["Queue"],"summary":"List queue items","description":"Get queue items with optional filtering by status, priority, or type.","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["pending_confirmation","ready","in_progress","done_today","blocked"]}},{"name":"priority","in":"query","schema":{"type":"string","enum":["low","medium","high","urgent"]}},{"name":"type","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":100}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"List of queue items","content":{"application/json":{"example":{"success":true,"data":{"items":[{"id":"clx...","type":"task","title":"Review proposal","status":"ready","priority":"high"}],"pagination":{"total":1,"limit":50,"offset":0,"hasMore":false}}}}}}}}},"/queue/{id}":{"get":{"tags":["Queue"],"summary":"Get single queue item","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Queue item details"},"404":{"description":"Not found"}}}},"/queue/{id}/confirm":{"post":{"operationId":"AgentQueueService_ConfirmAgentQueueItem","description":"Approve or reject an item awaiting confirmation.\n\nApproving moves it to `ready` and returns the updated item. Rejecting DELETES it, so the response carries only a message.","summary":"Approve or reject an item awaiting confirmation.","tags":["AgentQueueService"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.ConfirmAgentQueueItemRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.ConfirmAgentQueueItemResponse"}}}},"400":{"description":"Bad Request (invalid input)"},"401":{"description":"Unauthorized (missing or invalid token)"},"403":{"description":"Forbidden (expired/deactivated key or insufficient permissions)"},"429":{"description":"Rate limited"},"500":{"description":"Internal Server Error"}}}},"/queue/{id}/result":{"post":{"operationId":"AgentQueueService_ReportAgentQueueResult","description":"Report an agent's result on a queue item.\n\nThe result is merged into the item's metadata alongside the reporting key's name and a completion timestamp. Defaults the status to `done_today`.","summary":"Report an agent's result on a queue item.","tags":["AgentQueueService"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.ReportAgentQueueResultRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.ReportAgentQueueResultResponse"}}}},"400":{"description":"Bad Request (invalid input)"},"401":{"description":"Unauthorized (missing or invalid token)"},"403":{"description":"Forbidden (expired/deactivated key or insufficient permissions)"},"429":{"description":"Rate limited"},"500":{"description":"Internal Server Error"}}}},"/queue/{id}/status":{"post":{"operationId":"AgentQueueService_SetAgentQueueItemStatus","description":"Move an item to a new status.\n\nIllegal transitions are refused with a reason — completed items cannot be resurrected.","summary":"Move an item to a new status.","tags":["AgentQueueService"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.SetAgentQueueItemStatusRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.SetAgentQueueItemStatusResponse"}}}},"400":{"description":"Bad Request (invalid input)"},"401":{"description":"Unauthorized (missing or invalid token)"},"403":{"description":"Forbidden (expired/deactivated key or insufficient permissions)"},"429":{"description":"Rate limited"},"500":{"description":"Internal Server Error"}}}},"/relay":{"post":{"tags":["Federation"],"summary":"Send federation relay (v2 proxy)","description":"Proxies to /api/federation/relay. Use X-Federation-Token header for auth. This endpoint exists for v2 protocol compatibility. v2.3.2: accepts top-level teamId/projectId with scope resolution on the receiver; response echoes scopeResolved + scopeDropped.","parameters":[{"name":"X-Federation-Token","in":"header","required":true,"schema":{"type":"string"},"description":"Federation token from connection handshake"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string"},"relayId":{"type":"string","description":"Remote relay ID"},"fromUserEmail":{"type":"string"},"fromUserName":{"type":"string"},"toUserEmail":{"type":"string"},"type":{"type":"string","enum":["request","response","notification"]},"intent":{"type":"string","enum":["get_info","assign_task","request_approval","share_update","schedule","introduce","custom"]},"subject":{"type":"string"},"payload":{"type":"object"},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"teamId":{"type":"string","nullable":true,"description":"v2.3.2: sender-side team ID. Receiver runs scope resolution; dropped if unknown locally. Echoed in scopeResolved/scopeDropped."},"projectId":{"type":"string","nullable":true,"description":"v2.3.2: sender-side project ID. Receiver runs scope resolution; dropped if unknown locally. Project implies team (inheritance)."}}}}}},"responses":{"200":{"description":"Relay accepted (v2.3.2: idempotent on peerRelayId, may return duplicate=true, ambient=true with filtered=true, task=true with cardId, and scopeResolved/scopeDropped objects)","content":{"application/json":{"examples":{"newTask":{"value":{"success":true,"relayId":"clx...","task":true,"cardId":"kc...","message":"Task assigned and saved as Kanban card"}},"duplicate":{"value":{"success":true,"relayId":"clx...","duplicate":true,"message":"Relay already received"}},"ambientFiltered":{"value":{"success":true,"ambient":true,"filtered":true,"reason":"topic-filter | quiet-hours | ambient-disabled"}},"ambientAccepted":{"value":{"success":true,"relayId":"clx...","ambient":true,"message":"Ambient broadcast received"}},"fallback":{"value":{"success":true,"relayId":"clx...","fallback":true,"message":"Recipient unknown — surfaced to instance owner"}},"scopeResolved":{"value":{"success":true,"relayId":"clx...","scopeResolved":{"teamId":"tm_local_abc","projectId":"prj_local_xyz"},"scopeDropped":{},"message":"Relay accepted with full scope"}},"scopeDropped":{"value":{"success":true,"relayId":"clx...","scopeResolved":{},"scopeDropped":{"teamId":"tm_remote_def","projectId":"prj_remote_ghi"},"message":"Relay accepted; scope not resolvable locally"}}}}}},"401":{"description":"Missing or invalid federation token"},"404":{"description":"No active connection for this token"}}}},"/settings":{"get":{"operationId":"AgentSettingsService_GetSettings","description":"Read the settings of the account this API key belongs to.","summary":"Read the settings of the account this API key belongs to.","tags":["AgentSettingsService"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentSettingsServiceGetSettingsResponse"}}}},"400":{"description":"Bad Request (invalid input)"},"401":{"description":"Unauthorized (missing or invalid token)"},"403":{"description":"Forbidden (expired/deactivated key or insufficient permissions)"},"429":{"description":"Rate limited"},"500":{"description":"Internal Server Error"}}},"patch":{"operationId":"AgentSettingsService_UpdateSettings","description":"Update the settings of the account this API key belongs to.\n\nOnly the fields you send are changed, and the response contains only what was applied. Sending no supported field returns 400.","summary":"Update the settings of the account this API key belongs to.","tags":["AgentSettingsService"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentSettingsServiceUpdateSettingsRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentSettingsServiceUpdateSettingsResponse"}}}},"400":{"description":"Bad Request (invalid input)"},"401":{"description":"Unauthorized (missing or invalid token)"},"403":{"description":"Forbidden (expired/deactivated key or insufficient permissions)"},"429":{"description":"Rate limited"},"500":{"description":"Internal Server Error"}}}},"/shared-chat/messages":{"get":{"operationId":"AgentSharedChatService_ListSharedChatMessages","description":"Read the chat history of the account this API key belongs to, oldest first.\n\nPaginate by passing the `pagination.cursor` of the previous response; when it is absent there are no older messages.","summary":"Read the chat history of the account this API key belongs to, oldest first.","tags":["AgentSharedChatService"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"role","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentSharedChatServiceListSharedChatMessagesResponse"}}}},"400":{"description":"Bad Request (invalid input)"},"401":{"description":"Unauthorized (missing or invalid token)"},"403":{"description":"Forbidden (expired/deactivated key or insufficient permissions)"},"429":{"description":"Rate limited"},"500":{"description":"Internal Server Error"}}}},"/shared-chat/send":{"post":{"operationId":"AgentSharedChatService_SendSharedChatMessage","description":"Post a message into the chat of the account this API key belongs to. The message is stored and pushed to the user's open browsers immediately.\n\nSet the `X-Agent-Name` header to choose the name it is attributed to; without it the API key's own name is used.","summary":"Post a message into the chat of the account this API key belongs to. The message is stored and pushed to the user's open browsers immediately.","tags":["AgentSharedChatService"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentSharedChatServiceSendSharedChatMessageRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.agentapi.v1.AgentSharedChatServiceSendSharedChatMessageResponse"}}}},"400":{"description":"Bad Request (invalid input)"},"401":{"description":"Unauthorized (missing or invalid token)"},"403":{"description":"Forbidden (expired/deactivated key or insufficient permissions)"},"429":{"description":"Rate limited"},"500":{"description":"Internal Server Error"}}}},"/shared-chat/stream":{"get":{"tags":["Shared Chat"],"summary":"SSE stream for real-time updates","description":"Server-Sent Events stream. Delivers: new_message, heartbeat (every 30s), wake (urgent tasks).\n\nSet `X-Agent-Name` header to identify the agent.\n\nExample events:\n```\nevent: connected\ndata: {\"type\":\"connected\",\"clientId\":\"sse_...\",\"agentName\":\"my-agent\"}\n\nevent: heartbeat\ndata: {\"type\":\"heartbeat\",\"timestamp\":\"2026-04-06T...\"}\n\nevent: new_message\ndata: {\"type\":\"new_message\",\"message\":{\"id\":\"...\",\"content\":\"Hello\"}}\n\nevent: wake\ndata: {\"type\":\"wake\",\"reason\":\"urgent_task\",\"metadata\":{...}}\n```","parameters":[{"name":"X-Agent-Name","in":"header","schema":{"type":"string"},"description":"Agent display name"}],"responses":{"200":{"description":"SSE stream","content":{"text/event-stream":{}}}}}},"/updates":{"get":{"operationId":"UpdatesService_ListUpdates","description":"Returns the DiviDen changelog. No authentication required — self-hosted instances can poll this to stay in sync.","summary":"Returns the DiviDen changelog. No authentication required — self-hosted instances can poll this to stay in sync.","tags":["UpdatesService"],"security":[],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"since","in":"query","required":false,"schema":{"type":"string"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dividen.updates.v1.ListUpdatesResponse"}}}},"400":{"description":"Bad Request (invalid input)"},"429":{"description":"Rate limited"},"500":{"description":"Internal Server Error"}}}}}}