Skip to main content
Conversations represent chat sessions in the system. Each conversation is associated with a workflow and can contain multiple messages.

Base URL

All API endpoints are prefixed with the following base URL:

Create a Conversation

Create a new conversation instance.
  • Endpoint: POST /conversations
  • Authentication: API Key Required

Headers

Conversation Usecases

The usecase field determines the conversation’s purpose and behavior:
  1. DEFAULT ("usecase": "DEFAULT")
    • Standard conversation, chat with the GAIFE system
    • Used for general messaging purposes
  2. WORKFLOW_EXECUTION ("usecase": "WORKFLOW_EXECUTION")
    • Used when executing an existing workflow
    • Automatically sets metadata with workflow_id from config
    • Enables workflow-specific message processing
!!! info Optionally, configure a callback_url in config to receive a webhook/callback on every message of conversation.

Request Body

Response

Example Usecases Request Body

=== “Workflow Execution”
=== “Default”

Notes

  • For WORKFLOW_EXECUTION, the metadata will automatically include the workflow_id from config
  • The DEFAULT usecase provides the most flexibility for custom implementations
  • All usecases support custom metadata for additional context
  • The channel field is used to specify the communication channel, currently only API is supported
  • To receive a webhook on every message of conversation, configure a callback_url in config

Example Request

Example Response

Status Codes

  • 201: Conversation created successfully
  • 400: Invalid request data
  • 401: Invalid or missing API key
  • 500: Server error

Get Conversation Messages

Retrieve all messages in a conversation.
  • Endpoint: GET /conversations/{conversation_id}/messages
  • Authentication: Required

Path Parameters

  • conversation_id: The ID of the conversation

Example Request

Response

  • Messages are returned in chronological order, from newest to oldest.

Status Codes

  • 200: Success
  • 404: Conversation not found
  • 500: Server error

Notes

  1. Content Types:
    • TEXT: Regular text messages
    • IMAGE: Image files
    • VIDEO: Video files
    • AUDIO: Audio files
  2. Message Types:
    • USER_INPUT: Messages from users
    • Other types as per your MessageType choices
  3. Message Status:
    • RECEIVED: Message has been received
    • Other statuses as per your MessageStatus choices
  4. Response Fields:
    • id: Unique message identifier
    • content: Message content/text
    • filename: Present only for media messages
    • metadata: Optional JSON object for additional data