openapi: 3.1.0 info: title: Request agentApiActivity agentApiContext API version: 1.0.0 servers: - url: https://app.band.ai description: https://app.band.ai tags: - name: agentApiContext paths: /api/v1/agent/chats/{chat_id}/context: get: operationId: getAgentChatContext summary: Get agent context for rehydration description: 'Returns all messages relevant to the agent for execution context/rehydration. This includes: - All messages the agent sent (any type: text, tool_call, tool_result, thought, etc.) - All text messages that @mention the agent Use this endpoint to load the complete context an external agent needs to resume execution. Messages are returned in chronological order (oldest first). ## Pagination Use `cursor` + `limit` for cursor-based pagination (recommended). The response `metadata` includes `next_cursor` and `has_more`. `page` and `page_size` are deprecated and will be removed in API 2.0.0 (2026-10-01). ' tags: - agentApiContext parameters: - name: chat_id in: path description: Chat Room ID required: true schema: type: string format: uuid - name: cursor in: query description: Cursor for keyset pagination (from previous response next_cursor) required: false schema: type: string - name: limit in: query description: 'Items per page for cursor pagination (default: 50, max: 100)' required: false schema: type: integer - name: page in: query description: Page number (deprecated — use cursor instead) required: false schema: type: integer - name: page_size in: query description: Items per page (deprecated — use limit instead) required: false schema: type: integer - name: X-API-Key in: header description: Enter your API key for programmatic access required: true schema: type: string responses: '200': description: Agent context content: application/json: schema: $ref: '#/components/schemas/Agent API/Context_getAgentChatContext_Response_200' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Forbidden - Agent authentication required content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Not Found - Chat room not found or agent not a participant content: application/json: schema: $ref: '#/components/schemas/Error' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/ValidationError' components: schemas: ErrorErrorDetails: type: object properties: {} description: Additional error details (optional) title: ErrorErrorDetails ValidationError: type: object properties: error: $ref: '#/components/schemas/ValidationErrorError' required: - error description: Validation error response with field-specific errors and request ID for tracing title: ValidationError ErrorError: type: object properties: code: type: string description: Machine-readable error code details: $ref: '#/components/schemas/ErrorErrorDetails' description: Additional error details (optional) message: type: string description: Human-readable error message request_id: type: string description: Unique request identifier for tracing and debugging required: - code - message - request_id title: ErrorError ValidationErrorError: type: object properties: code: type: string description: Machine-readable error code details: type: object additionalProperties: type: array items: type: string description: Field-specific validation errors with JSON Pointer paths (RFC 6901) as keys message: type: string description: Human-readable error message request_id: type: string description: Unique request identifier for tracing and debugging required: - code - details - message - request_id title: ValidationErrorError Error: type: object properties: error: $ref: '#/components/schemas/ErrorError' required: - error description: Standard error response with request ID for tracing title: Error securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-API-Key description: Enter your API key for programmatic access bearerAuth: type: http scheme: bearer description: Enter your JWT token (without the 'Bearer ' prefix)