openapi: 3.2.0 info: title: CharitySense Assistant API version: 3.0.0 description: Canonical CharitySense API for nonprofit research compiled from the canonical research overlay. contact: name: CharitySense email: mazhar@charitysense.com url: https://data.charitysense.com/contact servers: - url: https://data.charitysense.com security: [] tags: - name: Assistant description: Paid Advanced operations. Each request consumes the token's daily Advanced allowance. paths: /api/v2/charity-question: post: tags: - Assistant operationId: submitCharityQuestion summary: Submit a question about one canonical charity profile x-openai-isConsequential: true security: - BearerAuth: [] - ApiKeyAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CharityQuestionRequest' responses: '200': description: Question capture status. content: application/json: schema: $ref: '#/components/schemas/QuestionResult' '400': $ref: '#/components/responses/ErrorResponse' '404': $ref: '#/components/responses/ErrorResponse' '403': $ref: '#/components/responses/ErrorResponse' '429': $ref: '#/components/responses/ErrorResponse' '503': $ref: '#/components/responses/ErrorResponse' /api/v2/agent-feedback: post: tags: - Assistant operationId: submitAgentFeedback summary: Submit optional integration or data-quality feedback x-openai-isConsequential: true security: - BearerAuth: [] - ApiKeyAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AgentFeedbackRequest' responses: '200': description: Feedback capture status. content: application/json: schema: $ref: '#/components/schemas/FeedbackResult' '400': $ref: '#/components/responses/ErrorResponse' '403': $ref: '#/components/responses/ErrorResponse' '429': $ref: '#/components/responses/ErrorResponse' '404': $ref: '#/components/responses/ErrorResponse' '503': $ref: '#/components/responses/ErrorResponse' /api/v2/assistant/capabilities: get: tags: - Assistant operationId: getAssistantCapabilities summary: Get the assistant's supported and deferred capabilities security: - BearerAuth: [] - ApiKeyAuth: [] responses: '200': description: Assistant capability lists. content: application/json: schema: $ref: '#/components/schemas/AssistantCapabilities' '401': $ref: '#/components/responses/ErrorResponse' '403': $ref: '#/components/responses/ErrorResponse' /api/v2/assistant/chat/stream: post: tags: - Assistant operationId: streamAssistantChat summary: Stream a CharitySense research response as server-sent events x-openai-isConsequential: true security: - BearerAuth: [] - ApiKeyAuth: [] parameters: - name: X-CharitySense-Session in: header schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AssistantChatRequest' responses: '200': description: SSE frames followed by a data [DONE] frame. content: text/event-stream: schema: type: string '400': $ref: '#/components/responses/ErrorResponse' '401': $ref: '#/components/responses/ErrorResponse' '403': $ref: '#/components/responses/ErrorResponse' '429': $ref: '#/components/responses/ErrorResponse' '503': $ref: '#/components/responses/ErrorResponse' components: schemas: AssistantChatRequest: type: object required: - Message properties: Message: type: string minLength: 1 maxLength: 2000 History: type: array maxItems: 20 items: type: object required: - Role - Content properties: Role: type: string enum: - user - assistant Content: type: string maxLength: 2000 additionalProperties: false Context: type: object properties: Path: type: string EIN: type: string CharityName: type: string SearchQuery: type: string additionalProperties: false additionalProperties: false QuestionResult: type: object required: - RequestID - Stored - Notified properties: RequestID: type: string Stored: type: boolean Notified: type: boolean additionalProperties: false FeedbackResult: type: object required: - FeedbackID - Stored - Notified properties: FeedbackID: type: string Stored: type: boolean Notified: type: boolean additionalProperties: false CharityQuestionRequest: type: object required: - EIN - Question - Email properties: EIN: oneOf: - type: integer - type: string Question: type: string maxLength: 4000 Email: type: string format: email additionalProperties: false Error: type: object required: - detail properties: detail: oneOf: - type: string - type: object properties: ErrorCode: type: string Message: type: string additionalProperties: true - type: array description: FastAPI request-validation errors. items: type: object additionalProperties: true additionalProperties: false AgentFeedbackRequest: type: object required: - Message properties: FeedbackType: type: string Message: type: string maxLength: 8000 EIN: type: string Email: type: string format: email RecoverySessionID: type: string maxLength: 128 Metadata: type: object additionalProperties: true additionalProperties: false AssistantCapabilities: type: object required: - Supported - NotYet - SearchRecoveryEnabled properties: Supported: type: array items: type: string NotYet: type: array items: type: string SearchRecoveryEnabled: type: boolean additionalProperties: false responses: ErrorResponse: description: Request error in detail, with a stable ErrorCode when available. content: application/json: schema: $ref: '#/components/schemas/Error' securitySchemes: BearerAuth: type: http scheme: bearer ApiKeyAuth: type: apiKey in: header name: X-CharitySense-API-Key externalDocs: description: Agent integration guide and recommended workflow. url: https://data.charitysense.com/agents