AI for Database Conversations API

Manage chat conversation history

Operations 6

GET /conversations List conversations #
POST /conversations Create conversation #
GET /conversations/{id} Get conversation #
PATCH /conversations/{id} Update conversation #
DELETE /conversations/{id} Delete conversation #
GET /conversations/{id}/messages Get messages #

Documentation

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/aifordatabase-conversations-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

aifordatabase-conversations-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: AI for Database Conversations API
  version: 1.0.0
  description: API for AI agents to interact with databases through natural language, dashboards, workflows, and more.
servers:
- url: https://app.aifordatabase.com/api/v1
security:
- bearerAuth: []
tags:
- name: Conversations
  description: Manage chat conversation history
paths:
  /conversations:
    get:
      tags:
      - Conversations
      summary: List conversations
      operationId: listConversations
      description: List chat conversations for the organization, optionally filtered by connectionId.
      parameters:
      - $ref: '#/components/parameters/PageParam'
      - $ref: '#/components/parameters/PageSizeParam'
      - name: connectionId
        in: query
        schema:
          type: string
        description: Filter by connection
      responses:
        '200':
          description: Paginated list of conversations
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/SuccessEnvelope'
                - type: object
                  properties:
                    data:
                      type: array
                      items:
                        $ref: '#/components/schemas/Conversation'
    post:
      tags:
      - Conversations
      summary: Create conversation
      operationId: createConversation
      description: Create a new empty conversation.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConversationCreate'
      responses:
        '201':
          description: Conversation created
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/SuccessEnvelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/Conversation'
  /conversations/{id}:
    get:
      tags:
      - Conversations
      summary: Get conversation
      operationId: getConversation
      description: Get a conversation with all its messages.
      parameters:
      - $ref: '#/components/parameters/IdParam'
      responses:
        '200':
          description: Conversation with messages
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/SuccessEnvelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/Conversation'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      tags:
      - Conversations
      summary: Update conversation
      operationId: updateConversation
      description: Update the conversation title.
      parameters:
      - $ref: '#/components/parameters/IdParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConversationUpdate'
      responses:
        '200':
          description: Conversation updated
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/SuccessEnvelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/Conversation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      tags:
      - Conversations
      summary: Delete conversation
      operationId: deleteConversation
      description: Delete a conversation and all its messages.
      parameters:
      - $ref: '#/components/parameters/IdParam'
      responses:
        '200':
          description: Conversation deleted
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/SuccessEnvelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/DeletedResponse'
        '404':
          $ref: '#/components/responses/NotFound'
  /conversations/{id}/messages:
    get:
      tags:
      - Conversations
      summary: Get messages
      operationId: listConversationMessages
      description: List messages in a conversation, ordered chronologically.
      parameters:
      - $ref: '#/components/parameters/IdParam'
      - $ref: '#/components/parameters/PageParam'
      - $ref: '#/components/parameters/PageSizeParam'
      responses:
        '200':
          description: Paginated messages
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/SuccessEnvelope'
                - type: object
                  properties:
                    data:
                      type: array
                      items:
                        $ref: '#/components/schemas/Message'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    PageSizeParam:
      name: pageSize
      in: query
      schema:
        type: integer
        default: 20
        maximum: 100
      description: Items per page (max 100)
    PageParam:
      name: page
      in: query
      schema:
        type: integer
        default: 1
      description: Page number (1-based)
    IdParam:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Resource ID
  schemas:
    DeletedResponse:
      type: object
      properties:
        deleted:
          type: boolean
          example: true
    Conversation:
      type: object
      properties:
        id:
          type: string
        orgId:
          type: string
        userId:
          type: string
        connectionId:
          type: string
          nullable: true
        title:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ApiMeta:
      type: object
      properties:
        requestId:
          type: string
          format: uuid
        timestamp:
          type: string
          format: date-time
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
      - requestId
      - timestamp
    SuccessEnvelope:
      type: object
      properties:
        data: {}
        error:
          type: 'null'
        meta:
          $ref: '#/components/schemas/ApiMeta'
      required:
      - data
      - error
      - meta
    ConversationUpdate:
      type: object
      required:
      - title
      properties:
        title:
          type: string
    ApiError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details: {}
      required:
      - code
      - message
    Message:
      type: object
      properties:
        id:
          type: string
        conversationId:
          type: string
        role:
          type: string
          enum:
          - USER
          - ASSISTANT
        content:
          type: string
        sqlQuery:
          type: string
          nullable: true
        resultSummary:
          type: string
          nullable: true
        promptTokens:
          type: integer
          nullable: true
        completionTokens:
          type: integer
          nullable: true
        model:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
    Pagination:
      type: object
      properties:
        total:
          type: integer
        page:
          type: integer
        pageSize:
          type: integer
        totalPages:
          type: integer
      required:
      - total
      - page
      - pageSize
      - totalPages
    ConversationCreate:
      type: object
      properties:
        title:
          type: string
        connectionId:
          type: string
    ErrorEnvelope:
      type: object
      properties:
        data:
          type: 'null'
        error:
          $ref: '#/components/schemas/ApiError'
        meta:
          $ref: '#/components/schemas/ApiMeta'
      required:
      - data
      - error
      - meta
  responses:
    BadRequest:
      description: Validation error or bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Platform API key starting with afd_