Fini Conversations API

The Conversations API from Fini — 3 operation(s) for conversations.

OpenAPI Specification

fini-conversations-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Fini AI Agents Conversations API
  version: v2
  description: Public REST API for Fini AI, the self-improving AI agent for enterprise customer support. Manage agents, conversations, knowledge (sources, articles, folders), rules, tags, and prompts, and drive the agent loop via Generate Answer. Structure captured by API Evangelist from the published Fini API reference; not an official Fini-published OpenAPI.
  contact:
    name: Fini AI
    url: https://docs.usefini.com/en/api-reference/authentication
  x-apis-json-generated: true
servers:
- url: https://api-prod.usefini.com/v2
  description: Production
security:
- bearerAuth: []
tags:
- name: Conversations
paths:
  /hc-interactions/public:
    delete:
      operationId: bulkDeleteConversations
      summary: Delete up to 50 conversations in one request through the public Conversations API.
      tags:
      - Conversations
      description: Delete up to 50 conversations in one request through the public Conversations API. Requires the `write` scope.
      externalDocs:
        url: https://docs.usefini.com/en/api-reference/bulk-delete-conversations
      responses:
        '200':
          description: Successful response.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
    get:
      operationId: listConversations
      summary: Read all Fini conversations for your workspace, sorted newest first, with cursor pagination.
      tags:
      - Conversations
      description: Read all Fini conversations for your workspace, sorted newest first, with cursor pagination. Requires the `read` scope.
      externalDocs:
        url: https://docs.usefini.com/en/api-reference/list-conversations
      responses:
        '200':
          description: Successful response.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
        '400':
          description: Invalid window (since >= until, or window exceeds 90 days).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      parameters:
      - name: since
        in: query
        schema:
          type: integer
        description: Start of the time window in Unix epoch milliseconds. Defaults to the last 7 days. The since/until window cannot exceed 90 days.
      - name: until
        in: query
        schema:
          type: integer
        description: End of the time window in Unix epoch milliseconds. Defaults to the current time.
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
        description: Maximum number of conversations to return.
      - name: cursor
        in: query
        schema:
          type: string
        description: Conversation ID to paginate from. Pass the nextCursor or prevCursor from the previous response.
      - name: direction
        in: query
        schema:
          type: string
          enum:
          - next
          - previous
        description: Pagination direction. next moves to older conversations; previous moves toward newer ones (results are newest-first).
      - name: agentId
        in: query
        schema:
          type: string
        description: Optional agent ID filter.
      - name: source
        in: query
        schema:
          type: array
          items:
            type: string
        description: Optional comma-separated conversation sources (api, widget, ui, standalone, testsuite, replay, zendesk, intercom, front, hubspot, salesforce, gorgias, livechat, slack, discord, freshdesk, freshchat).
      - name: channel
        in: query
        schema:
          type: array
          items:
            type: string
        description: Optional comma-separated channel filter.
  /hc-interactions/{id}/public:
    delete:
      operationId: deleteConversation
      summary: Delete one conversation by ID through the public Conversations API.
      tags:
      - Conversations
      description: Delete one conversation by ID through the public Conversations API. Requires the `write` scope.
      externalDocs:
        url: https://docs.usefini.com/en/api-reference/delete-conversation
      responses:
        '200':
          description: Successful response.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/NotFound'
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: The id path parameter.
    get:
      operationId: getConversation
      summary: Fetch one public conversation by ID.
      tags:
      - Conversations
      description: Fetch one public conversation by ID. Requires the `read` scope.
      externalDocs:
        url: https://docs.usefini.com/en/api-reference/get-conversation
      responses:
        '200':
          description: Successful response.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
        '404':
          $ref: '#/components/responses/NotFound'
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: The id path parameter.
  /hc-interactions/events/public:
    post:
      operationId: generateAnswer
      summary: Send a message event into Fini and return the public events created for that submission.
      tags:
      - Conversations
      description: Send a message event into Fini and return the public events created for that submission. Requires the `write` scope.
      externalDocs:
        url: https://docs.usefini.com/en/api-reference/generate-answer
      responses:
        '200':
          description: Successful response.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
        description: See the Fini API reference for the request body schema.
components:
  responses:
    Forbidden:
      description: API key lacks the required scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 403
            message: API key does not have the required scope for this operation
            error: Forbidden
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            message: Unauthorized
            error: Unauthorized
    ServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 500
            message: Internal Server Error
            error: Internal Server Error
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 404
            message: Not Found
            error: Not Found
  schemas:
    Error:
      type: object
      description: Standard Fini error envelope.
      properties:
        statusCode:
          type: integer
          example: 403
        message:
          type: string
          example: API key does not have the required scope for this operation
        error:
          type: string
          example: Forbidden
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: fini_ API key
      description: 'Bearer token containing your Fini workspace API key. Format: `Bearer fini_...`. The key carries `read` and/or `write` scope; write routes require the `write` scope.'