Brainfish Analytics API

Conversation thread analytics with filtering and pagination

Operations 1

POST /v1/analytics/threads List analytics threads #

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/brainfish-analytics-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 form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

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

OpenAPI Specification

brainfish-analytics-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Brainfish Public Analytics API
  description: The Brainfish API is organized around REST.
  version: 1.0.0
  contact:
    name: Brainfish API Support
    email: support@brainfish.ai
    url: https://help.brainfi.sh/articles/api-reference-7mjzVCAmeM
  license:
    name: Proprietary
servers:
- url: https://api.brainfi.sh
  description: Production server
tags:
- name: Analytics
  description: Conversation thread analytics with filtering and pagination
paths:
  /v1/analytics/threads:
    post:
      summary: List analytics threads
      description: 'List and filter conversation threads with analytics data. Returns each thread''s initial question,

        source channel, resolution status, conversation score, and pagination metadata.


        A date range is required. Results are ordered by creation date descending.'
      operationId: listAnalyticsThreads
      tags:
      - Analytics
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnalyticsThreadsRequest'
            examples:
              basicDateRange:
                summary: Fetch threads for a date range
                value:
                  dateRange:
                    from: 1711929600000
                    to: 1714521600000
              withFilters:
                summary: Filter by status and feedback
                value:
                  dateRange:
                    from: 1711929600000
                    to: 1714521600000
                  status:
                  - answered
                  - partial
                  feedback:
                  - negative
                  limit: 20
                  offset: 0
      responses:
        '200':
          description: Threads retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsThreadsResponse'
              example:
                data:
                - id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  question: How do I reset my password?
                  source:
                    name: Help Widget
                    color: '#4F46E5'
                  resolutionStatus: answered
                  timestamp: '2024-04-01T12:00:00Z'
                  value: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  hasAttributes: true
                  conversationScore: 0.85
                pagination:
                  total: 142
                  limit: 10
                  offset: 0
                timestamp: '2024-04-15T10:30:00Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    Unauthorized:
      description: Authentication required or invalid credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missingToken:
              summary: Missing authentication token
              value:
                error: authentication_required
                message: 'Authentication required. Use Authorization: Bearer <token> header'
                timestamp: '2024-01-15T10:30:00Z'
                requestId: req-abc123
            missingAgentKey:
              summary: Missing agent key
              value:
                error: authentication_required
                message: Agent key is required
                timestamp: '2024-01-15T10:30:00Z'
                requestId: req-def456
            invalidCredentials:
              summary: Invalid credentials
              value:
                error: authentication_required
                message: Invalid or missing authentication credentials
                timestamp: '2024-01-15T10:30:00Z'
                requestId: req-ghi789
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: internal_error
            message: An unexpected error occurred
            requestId: req-abc123
            timestamp: '2024-01-15T10:30:00Z'
    UnprocessableEntity:
      description: Invalid request format or unknown message type
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
          examples:
            emptyQuery:
              summary: Empty query validation error
              value:
                error: validation_failed
                message: Request validation failed
                validationErrors:
                - field: query
                  message: Query cannot be empty
                  code: invalid_string
                timestamp: '2024-01-15T10:30:00Z'
                requestId: req-val123
            invalidConversationId:
              summary: Invalid conversation ID format
              value:
                error: validation_failed
                message: Request validation failed
                validationErrors:
                - field: conversationId
                  message: Invalid conversation ID format
                  code: invalid_string
                timestamp: '2024-01-15T10:30:00Z'
                requestId: req-val456
            queryTooLong:
              summary: Query exceeds maximum length
              value:
                error: validation_failed
                message: Request validation failed
                validationErrors:
                - field: query
                  message: Query must be 2000 characters or less
                  code: too_big
                timestamp: '2024-01-15T10:30:00Z'
                requestId: req-val789
    TooManyRequests:
      description: Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          schema:
            type: integer
          description: Request limit per time window
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Remaining requests in current window
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Time when rate limit resets (Unix timestamp)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: rate_limit_exceeded
            message: 'Too many requests. Rate limit: 25 requests per minute'
            timestamp: '2024-01-15T10:30:00Z'
  schemas:
    Error:
      type: object
      required:
      - error
      - message
      properties:
        error:
          type: string
          description: Error type or code
        message:
          type: string
          description: Human-readable error message
        details:
          type: object
          additionalProperties: true
          description: Additional error details
        timestamp:
          type: string
          format: date-time
          description: Error timestamp
        requestId:
          type: string
          description: Unique request identifier for debugging
    AnalyticsThreadsRequest:
      type: object
      required:
      - dateRange
      properties:
        dateRange:
          type: object
          required:
          - from
          - to
          properties:
            from:
              type: number
              description: Start date as Unix timestamp in milliseconds
              example: 1711929600000
            to:
              type: number
              description: End date as Unix timestamp in milliseconds
              example: 1714521600000
        limit:
          type: integer
          minimum: 1
          maximum: 100
          default: 10
          description: Number of threads to return
        offset:
          type: integer
          minimum: 0
          default: 0
          description: Pagination offset
        sources:
          type: array
          items:
            type: string
          description: Filter by channel keys (source identifiers)
        status:
          type: array
          items:
            type: string
            enum:
            - answered
            - partial
            - unable_to_help
            - technical_issue
            - skipped
          description: Filter by resolution status
        feedback:
          type: array
          items:
            type: string
            enum:
            - positive
            - negative
          description: Filter by user feedback type
        searchQuery:
          type: string
          description: Search within user messages across threads
        actions:
          type: array
          items:
            type: string
          description: Filter by action types
    AnalyticsThreadsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticsThread'
        pagination:
          type: object
          properties:
            total:
              type: integer
              description: Total number of matching threads
            limit:
              type: integer
              description: Page size
            offset:
              type: integer
              description: Current offset
        timestamp:
          type: string
          format: date-time
          description: Response timestamp
    ValidationError:
      allOf:
      - $ref: '#/components/schemas/Error'
      - type: object
        properties:
          validationErrors:
            type: array
            items:
              type: object
              properties:
                field:
                  type: string
                  description: Field that failed validation
                message:
                  type: string
                  description: Validation error message
                code:
                  type: string
                  description: Validation error code
    AnalyticsThread:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Thread ID
        question:
          type: string
          description: First user message in the thread
        source:
          type: object
          properties:
            name:
              type: string
              description: Channel name
            color:
              type: string
              description: Channel display colour
        resolutionStatus:
          type:
          - string
          - 'null'
          enum:
          - answered
          - partial
          - unable_to_help
          - technical_issue
          - skipped
          description: Thread resolution status
        timestamp:
          type: string
          format: date-time
          description: Timestamp of the first user message
        value:
          type: string
          description: Thread ID (alias)
        hasAttributes:
          type: boolean
          description: Whether the thread has user attributes
        conversationScore:
          type:
          - number
          - 'null'
          description: AI-computed conversation quality score
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Token
      description: 'Bearer token authentication. Include your API token in the Authorization header.


        Example: `Authorization: Bearer bf_api_xxxxx`


        Create tokens in your Brainfish dashboard under Settings → API Tokens.

        '
    AccessToken:
      type: apiKey
      in: header
      name: access-token
      description: '**Deprecated**: Use Bearer authentication instead.


        Legacy access token header for backward compatibility. Must start with `bf_api_`.


        Create tokens in your Brainfish dashboard under Settings → API Tokens.

        '
    AgentKey:
      type: apiKey
      in: header
      name: agent-key
      description: 'Agent key identifier that specifies which AI agent/widget to use for the request.


        Find agent keys in your Brainfish dashboard under Agents. Click on any agent key to copy it.

        '