Creed chatbot API

The chatbot API from Creed — 7 operation(s) for chatbot.

OpenAPI Specification

creed-chatbot-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Creed achievements chatbot API
  description: Creed API - Christian AI Chatbot
  version: 1.0.0
tags:
- name: chatbot
paths:
  /api/chatbot:
    post:
      tags:
      - chatbot
      summary: Chatbot Endpoint
      operationId: chatbot_endpoint_api_chatbot_post
      security:
      - HTTPBearer: []
      parameters:
      - name: x-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-User-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/chats:
    get:
      tags:
      - chatbot
      summary: Get User Chats
      description: Get all chats for the current authenticated user
      operationId: get_user_chats_api_chats_get
      security:
      - HTTPBearer: []
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 20
          title: Limit
      - name: x-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-User-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/chats/{chat_id}/messages:
    get:
      tags:
      - chatbot
      summary: Get Chat Messages
      description: "Get messages for a specific chat\n\nArgs:\n    chat_id: The chat ID\n    current_user: Authenticated user from dependency injection\n    recent: If True, returns the most recent N messages. If False (default), returns oldest N messages.\n    limit: Maximum number of messages to return (default 100)"
      operationId: get_chat_messages_api_chats__chat_id__messages_get
      security:
      - HTTPBearer: []
      parameters:
      - name: chat_id
        in: path
        required: true
        schema:
          type: string
          title: Chat Id
      - name: recent
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Recent
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 100
          title: Limit
      - name: x-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-User-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/auth/test:
    get:
      tags:
      - chatbot
      summary: Test Auth
      description: Test endpoint to verify authentication is working
      operationId: test_auth_api_auth_test_get
      security:
      - HTTPBearer: []
      parameters:
      - name: x-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-User-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/public/test:
    get:
      tags:
      - chatbot
      summary: Test Public
      description: Public test endpoint that doesn't require authentication
      operationId: test_public_api_public_test_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /api/chat/suggestions:
    get:
      tags:
      - chatbot
      summary: Get Chat Suggestions
      description: 'Get chat suggestions for the Christian companion app in user''s preferred language.


        If conversation_id is provided and has messages, returns contextual suggestions.

        Otherwise returns static suggestions.'
      operationId: get_chat_suggestions_api_chat_suggestions_get
      security:
      - HTTPBearer: []
      parameters:
      - name: conversation_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Conversation Id
      - name: x-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-User-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuggestionsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/chatbot/compact:
    post:
      tags:
      - chatbot
      summary: Compact Conversation
      description: Trigger conversation compaction inline. Called after a successful chat message.
      operationId: compact_conversation_api_chatbot_compact_post
      security:
      - HTTPBearer: []
      parameters:
      - name: x-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Api-Key
      - name: x-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-User-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompactRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompactResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Source:
      properties:
        title:
          type: string
          title: Title
        url:
          type: string
          title: Url
        snippet:
          anyOf:
          - type: string
          - type: 'null'
          title: Snippet
        favicon:
          anyOf:
          - type: string
          - type: 'null'
          title: Favicon
        domain:
          anyOf:
          - type: string
          - type: 'null'
          title: Domain
      type: object
      required:
      - title
      - url
      title: Source
    ChatRequest:
      properties:
        message:
          type: string
          title: Message
          default: ''
        conversation_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Conversation Id
        sendAudio:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Sendaudio
          default: false
        newUser:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Newuser
          default: false
        promptKey:
          anyOf:
          - type: string
          - type: 'null'
          title: Promptkey
          description: Used alongside daily topic quest
        image_ids:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Image Ids
      type: object
      title: ChatRequest
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    SuggestionsResponse:
      properties:
        suggestions:
          items:
            type: string
          type: array
          title: Suggestions
      type: object
      required:
      - suggestions
      title: SuggestionsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CompactRequest:
      properties:
        conversation_id:
          type: string
          title: Conversation Id
      type: object
      required:
      - conversation_id
      title: CompactRequest
    ChatResponse:
      properties:
        reply:
          anyOf:
          - type: string
          - type: 'null'
          title: Reply
        conversation_id:
          type: string
          title: Conversation Id
        bible_verses:
          items:
            type: string
          type: array
          title: Bible Verses
          default: []
        sources:
          anyOf:
          - items:
              $ref: '#/components/schemas/Source'
            type: array
          - type: 'null'
          title: Sources
        error:
          anyOf:
          - type: string
          - type: 'null'
          title: Error
        audio_base64:
          anyOf:
          - type: string
          - type: 'null'
          title: Audio Base64
      type: object
      required:
      - conversation_id
      title: ChatResponse
    CompactResponse:
      properties:
        success:
          type: boolean
          title: Success
        messages_compacted:
          type: integer
          title: Messages Compacted
          default: 0
        skipped:
          type: boolean
          title: Skipped
          default: false
        reason:
          anyOf:
          - type: string
          - type: 'null'
          title: Reason
      type: object
      required:
      - success
      title: CompactResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Supabase JWT token