openapi: 3.1.1

info:
  version: "1.0.0"
  title: Findly API

servers:
  - url: https://api.findly.ai/v1

components:
  securitySchemes:
    auth-header:
      type: http
      scheme: bearer

paths:
  "/health":
    get:
      summary: Health check

      description: Get a 200 OK response if the API is in healthy state

      responses:
        "200":
          description: Success
          content:
            text:
              example: OK

  "/conversations":
    post:
      summary: Start a conversation

      description: Programmatically ask Findly a question and get the newly created conversation ID and URL

      requestBody:
        content:
          application/json:
            schema:
              type: object
              required: [question, propertyId]
              properties:
                question:
                  type: string
                  description: The question you want Findly to answer
                  example: How much stock did we sell last week?

                propertyId:
                  type: string
                  description: Which data source to query, by property ID

                workspaceName:
                  type: string
                  description: Optionally specify workspace name, otherwise default will be used
                  example: my-workspace

      security:
        - auth-header: []

      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  conversationId:
                    type: string
                    example: xxx-yyy-zzz
                  publicUrl:
                    type: string
                    format: url
                    example: https://dashboard/findly.ai
