basePath: /v1
definitions:
  main.AnalyticsSummary:
    properties:
      conversations:
        allOf:
          - $ref: '#/definitions/main.ConversationStats'
        description: Conversation analytics for the requested period.
      contacts:
        allOf:
          - $ref: '#/definitions/main.ContactStats'
        description: Contact analytics for the requested period.
      ratings:
        allOf:
          - $ref: '#/definitions/main.RatingStats'
        description: Rating analytics for the requested period.
      operators:
        description: Per-operator conversation statistics.
        items:
          $ref: '#/definitions/main.OperatorStat'
        type: array
    type: object
  main.AuthMeResponse:
    properties:
      user_id:
        description: User ID associated with the access token.
        type: integer
      workspace_id:
        description: Workspace ID associated with the access token.
        type: integer
      role:
        description: User role in the workspace.
        type: string
    type: object
  main.Contact:
    properties:
      id:
        description: Unique contact ID.
        type: integer
      workspace_id:
        description: Workspace ID that owns this contact.
        type: integer
      external_id:
        description: Customer ID from your external system, if one was provided.
        type: string
      email:
        description: Contact email address captured from the widget or an external channel.
        type: string
      name:
        description: Contact display name captured from the widget or an external channel.
        type: string
      phone:
        description: Contact phone number captured from the widget or an external channel.
        type: string
      locale:
        description: Contact language used by the widget and visitor email digests.
        type: string
      consent_given_at:
        description: Time when the contact accepted the lead capture consent checkbox.
        type: string
        format: date-time
      meta:
        additionalProperties: true
        description: Custom key-value data attached to the contact.
        type: object
      created_at:
        description: Time when the contact was created.
        type: string
        format: date-time
      identities:
        description: Channel identities linked to this contact.
        items:
          $ref: '#/definitions/main.ContactIdentity'
        type: array
      merged_at:
        description: Time when this contact was merged into another contact.
        type: string
      merged_by:
        description: User ID that performed the merge.
        type: integer
      merged_into_contact_id:
        description: Canonical contact ID when this contact was merged into another contact.
        type: integer
    type: object
  main.ContactIdentity:
    properties:
      contact_id:
        description: Contact ID that this channel identity belongs to.
        type: integer
      created_at:
        description: Time when this identity was created.
        type: string
      display_name:
        description: Display name captured from the provider.
        type: string
      external_contact_id:
        description: End-user ID from the provider.
        type: string
      first_seen_at:
        description: First time this identity was seen.
        type: string
      id:
        description: Unique identity ID.
        type: integer
      last_seen_at:
        description: Most recent time this identity was seen.
        type: string
      metadata:
        additionalProperties: true
        description: Provider-specific metadata for this identity.
        type: object
      provider:
        description: Channel provider, for example instagram, vkontakte, whatsapp, or telegram.
        type: string
      provider_account_id:
        description: Connected provider account ID inside the workspace.
        type: string
      updated_at:
        description: Time when this identity was last updated.
        type: string
      workspace_id:
        description: Workspace ID that owns this identity.
        type: integer
    type: object
  main.ContactStats:
    properties:
      total:
        description: Total number of contacts in the workspace.
        type: integer
      new_in_period:
        description: Number of contacts created in the requested period.
        type: integer
      per_day:
        description: Daily contact counts for the requested period.
        items:
          $ref: '#/definitions/main.DayCount'
        type: array
    type: object
  main.ContactView:
    properties:
      id:
        description: Unique contact ID.
        type: integer
      email:
        description: Contact email address.
        type: string
      name:
        description: Contact display name.
        type: string
      meta:
        additionalProperties:
          type: string
        description: Custom key-value data attached to the contact.
        type: object
      created_at:
        description: Time when the contact was created.
        type: string
        format: date-time
    type: object
  main.ContactsPage:
    properties:
      data:
        description: Contacts for the current page.
        items:
          $ref: '#/definitions/main.Contact'
        type: array
      next_cursor:
        description: Cursor for the next page. Omitted or null when there are no more contacts.
        type: string
    type: object
  main.Conversation:
    properties:
      id:
        description: Unique conversation ID.
        type: integer
      workspace_id:
        description: Workspace ID that owns this conversation.
        type: integer
      contact_id:
        description: Contact ID participating in the conversation.
        type: integer
      assigned_to:
        description: Assigned operator user ID. Omitted when unassigned.
        type: integer
      status:
        description: Conversation status.
        type: string
        enum:
          - open
          - snoozed
          - closed
      snoozed_until:
        description: Time until which the conversation is snoozed.
        type: string
        format: date-time
      snoozed_by:
        description: User ID that snoozed the conversation.
        type: integer
      token:
        description: Visitor-side conversation token.
        type: string
      created_at:
        description: Time when the conversation was created.
        type: string
        format: date-time
    type: object
  main.ConversationStats:
    properties:
      total:
        description: Total number of conversations in the workspace.
        type: integer
      open:
        description: Number of open conversations.
        type: integer
      snoozed:
        description: Number of snoozed conversations.
        type: integer
      closed:
        description: Number of closed conversations.
        type: integer
      new_in_period:
        description: Number of conversations created in the requested period.
        type: integer
      per_day:
        description: Daily conversation counts for the requested period.
        items:
          $ref: '#/definitions/main.DayCount'
        type: array
    type: object
  main.ConversationView:
    properties:
      id:
        description: Unique conversation ID.
        type: integer
      workspace_id:
        description: Workspace ID that owns this conversation.
        type: integer
      contact:
        allOf:
          - $ref: '#/definitions/main.ContactView'
        description: Contact participating in the conversation.
      assigned_to:
        allOf:
          - $ref: '#/definitions/main.UserView'
        description: Operator assigned to the conversation. Null when unassigned.
      status:
        description: Conversation status.
        type: string
        enum:
          - open
          - snoozed
          - closed
      snoozed_until:
        description: Time until which the conversation is snoozed. Null when it is not snoozed.
        type: string
        format: date-time
      created_at:
        description: Time when the conversation was created.
        type: string
        format: date-time
      last_message:
        allOf:
          - $ref: '#/definitions/main.LastMessageView'
        description: Most recent message in the conversation.
      departments:
        description: Departments attached to the conversation.
        items:
          $ref: '#/definitions/main.DepartmentView'
        type: array
    type: object
  main.ConversationsPage:
    properties:
      data:
        description: Conversations for the current page.
        items:
          $ref: '#/definitions/main.ConversationView'
        type: array
      next_cursor:
        description: Cursor for the next page. Omitted or null when there are no more conversations.
        type: string
    type: object
  main.DayCount:
    properties:
      date:
        description: Date in YYYY-MM-DD format.
        type: string
      count:
        description: Count for that date.
        type: integer
    type: object
  main.DaySchedule:
    properties:
      enabled:
        description: Whether business hours are enabled for this day.
        type: boolean
      open:
        description: Opening time in HH:MM format.
        type: string
      close:
        description: Closing time in HH:MM format.
        type: string
    type: object
  main.DepartmentView:
    properties:
      id:
        description: Unique department ID.
        type: integer
      name:
        description: Department name.
        type: string
    type: object
  main.Error:
    properties:
      code:
        description: Stable machine-readable error code.
        type: string
      message:
        description: Human-readable error message.
        type: string
    type: object
  main.File:
    properties:
      id:
        description: Unique file ID.
        type: integer
      workspace_id:
        description: Workspace ID that owns this file.
        type: integer
      uploaded_by:
        description: User ID that requested the upload.
        type: integer
      file_name:
        description: Original file name.
        type: string
      file_size:
        description: File size in bytes.
        type: integer
      mime_type:
        description: File MIME type.
        type: string
      purpose:
        description: File purpose, for example attachment.
        type: string
      status:
        description: Upload status.
        type: string
      created_at:
        description: Time when the file record was created.
        type: string
        format: date-time
    type: object
  main.FileURLResponse:
    properties:
      url:
        description: Temporary public URL for downloading the file.
        type: string
    type: object
  main.Holiday:
    properties:
      date:
        description: Holiday date in YYYY-MM-DD format.
        type: string
      name:
        description: Holiday display name.
        type: string
    type: object
  main.LastMessageView:
    properties:
      id:
        description: Unique message ID.
        type: integer
      conversation_id:
        description: Conversation ID that contains the message.
        type: integer
      sender_type:
        description: 'Sender kind: contact, user, or system.'
        type: string
      sender_id:
        description: Sender ID. For user messages this is a user ID; for contact messages this is a contact ID.
        type: integer
      text:
        description: Message text. Null when the message contains only attachments or system payloads.
        type: string
      attachments:
        description: Files attached to the message.
        items: {}
        type: array
      created_at:
        description: Time when the message was created.
        type: string
        format: date-time
    type: object
  main.LeadFieldsConfig:
    properties:
      name:
        description: Whether the lead capture form asks for a name.
        type: boolean
      phone:
        description: Whether the lead capture form asks for a phone number.
        type: boolean
      email:
        description: Whether the lead capture form asks for an email address.
        type: boolean
      consent:
        description: Whether the lead capture form asks for consent.
        type: boolean
    type: object
  main.Message:
    properties:
      id:
        description: Unique message ID.
        type: integer
      sender_type:
        description: 'Sender kind: contact, user, or system.'
        type: string
      sender_id:
        description: Sender ID. For user messages this is a user ID; for contact messages this is a contact ID.
        type: integer
      text:
        description: Message text. Omitted when the message contains only attachments or system payloads.
        type: string
      attachments:
        description: Files attached to the message.
        items:
          $ref: '#/definitions/main.MessageAttachment'
        type: array
      is_internal:
        description: Whether the message is visible only to operators.
        type: boolean
      delivery_status:
        description: Current delivery status for outbound messages.
        type: string
      delivery_error:
        description: Delivery error details, if the last delivery attempt failed.
        type: string
      delivered_at:
        description: Time when the message was delivered, if delivery has completed.
        type: string
        format: date-time
      created_at:
        description: Time when the message was created.
        type: string
        format: date-time
    type: object
  main.MessageAttachment:
    properties:
      id:
        description: Unique attachment ID.
        type: integer
      file_id:
        description: Uploaded file ID.
        type: integer
      file_name:
        description: Original file name.
        type: string
      file_size:
        description: File size in bytes.
        type: integer
      mime_type:
        description: File MIME type.
        type: string
      url:
        description: Temporary public URL for downloading the file.
        type: string
    type: object
  main.OnlineVisitorItem:
    properties:
      type:
        description: 'Online item type: anonymous or contact.'
        type: string
      visitor_id:
        description: Anonymous visitor ID. Present when type is anonymous.
        type: string
      contact:
        allOf:
          - $ref: '#/definitions/main.Contact'
        description: Known contact. Present when type is contact.
      page:
        description: Current page URL reported by the widget.
        type: string
      title:
        description: Current page title reported by the widget.
        type: string
      ua:
        description: Browser user-agent string. Present when type is anonymous.
        type: string
      connected_at:
        description: Time when the visitor or contact connected.
        type: string
        format: date-time
    type: object
  main.OnlineVisitorsResponse:
    properties:
      items:
        description: Online visitors and contacts in a single paginated list.
        items:
          $ref: '#/definitions/main.OnlineVisitorItem'
        type: array
      next_cursor:
        description: Cursor for the next page.
        type: string
    type: object
  main.OperatorStat:
    properties:
      id:
        description: Operator user ID.
        type: integer
      name:
        description: Operator display name.
        type: string
      closed:
        description: Number of conversations closed by the operator in the requested period.
        type: integer
      open:
        description: Number of currently open conversations assigned to the operator.
        type: integer
    type: object
  main.PresignFileRequest:
    properties:
      file_name:
        description: Original file name.
        type: string
      mime_type:
        description: File MIME type.
        type: string
      purpose:
        description: Upload purpose. Currently only attachment is supported.
        enum:
          - attachment
        type: string
    type: object
  main.PresignFileResponse:
    properties:
      file_id:
        description: Created file ID.
        type: integer
      upload_url:
        description: Temporary S3-compatible upload URL.
        type: string
    type: object
  main.QuickReply:
    properties:
      id:
        description: Unique quick reply ID.
        type: integer
      workspace_id:
        description: Workspace ID that owns this quick reply.
        type: integer
      name:
        description: Quick reply display name.
        type: string
      text:
        description: Safe Markdown inserted when the quick reply is used. Image refs use ![alt](evercom-file:<id>).
        type: string
      created_by:
        description: User ID that created the quick reply, if known.
        type: integer
      created_at:
        description: Time when the quick reply was created.
        type: string
        format: date-time
    type: object
  main.Rating:
    properties:
      id:
        description: Unique rating ID.
        type: integer
      workspace_id:
        description: Workspace ID that owns this rating.
        type: integer
      conversation_id:
        description: Conversation ID that received the rating.
        type: integer
      message_id:
        description: Message ID that received the rating, if per-message ratings are enabled.
        type: integer
      score:
        description: Rating score submitted by the contact.
        type: integer
      created_at:
        description: Time when the rating was created.
        type: string
        format: date-time
    type: object
  main.RatingStats:
    properties:
      total:
        description: Total number of ratings in the requested period.
        type: integer
      avg_score:
        description: Average rating score in the requested period.
        type: number
      positive:
        description: Number of positive ratings in the requested period.
        type: integer
      negative:
        description: Number of negative ratings in the requested period.
        type: integer
    type: object
  main.SendMessageRequest:
    properties:
      text:
        description: Message text. Required when file_ids is empty.
        type: string
      file_ids:
        description: Uploaded file IDs to attach to the message.
        items:
          type: integer
        type: array
    type: object
  main.StartVisitorResponse:
    properties:
      contact:
        allOf:
          - $ref: '#/definitions/main.Contact'
        description: Contact created or matched for the visitor.
      conversation:
        allOf:
          - $ref: '#/definitions/main.Conversation'
        description: Conversation started for the visitor.
    type: object
  main.UserView:
    properties:
      id:
        description: Unique user ID.
        type: integer
      workspace_id:
        description: Workspace ID that owns this user.
        type: integer
      email:
        description: User email address.
        type: string
      name:
        description: User display name.
        type: string
      avatar_url:
        description: Public avatar URL, if configured.
        type: string
      role:
        description: User role in the workspace.
        type: string
      totp_enabled:
        description: Whether two-factor authentication is enabled for the user.
        type: boolean
    type: object
  main.Workspace:
    properties:
      id:
        description: Unique workspace ID.
        type: integer
      name:
        description: Workspace display name.
        type: string
      code:
        description: Public workspace code used in the widget loader URL.
        type: string
      logo_file_id:
        description: Uploaded logo file ID, if configured.
        type: integer
      per_message_rating:
        description: Whether contacts can rate individual operator messages.
        type: boolean
      rating_mode:
        description: Rating collection mode configured for the widget.
        type: string
      rating_type:
        description: Rating scale type configured for the widget.
        type: string
      locale:
        description: Default workspace locale.
        type: string
      timezone:
        description: Workspace timezone name.
        type: string
      schedule:
        additionalProperties:
          $ref: '#/definitions/main.DaySchedule'
        description: Weekly business-hours schedule keyed by weekday.
        type: object
      holidays:
        description: Workspace holidays when normal schedule may not apply.
        items:
          $ref: '#/definitions/main.Holiday'
        type: array
      lead_fields:
        allOf:
          - $ref: '#/definitions/main.LeadFieldsConfig'
        description: Workspace-level lead capture field settings stored on the workspace and used by the widget.
      lead_timing:
        description: Workspace-level lead capture timing setting stored on the workspace and used by the widget.
        type: string
      widget_tickets_enabled:
        description: Whether public ticket forms are enabled in the widget.
        type: boolean
      widget_knowledge_enabled:
        description: Whether the widget shows published knowledge base articles.
        type: boolean
      widget_knowledge_base_id:
        description: Knowledge base ID shown in the widget when widget knowledge is enabled.
        type: integer
      widget_accent_color:
        description: 'Widget brand accent color in #RRGGBB format.'
        type: string
      created_at:
        description: Time when the workspace was created.
        type: string
        format: date-time
      modules:
        additionalProperties:
          $ref: '#/definitions/main.WorkspaceModule'
        description: >-
          Workspace module registry. messages and contacts are locked core modules; optional modules can be toggled by
          workspace admins.
        type: object
    type: object
  main.WorkspaceModule:
    properties:
      enabled:
        description: Whether this module is enabled in the workspace.
        type: boolean
      locked:
        description: Whether this module is part of the locked workspace core.
        type: boolean
    type: object
info:
  contact: {}
  description: Public developer API. Use workspace access tokens with the wk_ prefix.
  title: Evercom Public API
  version: 1.0.0
paths:
  /analytics/summary:
    get:
      parameters:
        - description: Relative period in days
          in: query
          name: days
          type: integer
        - description: Start date YYYY-MM-DD
          in: query
          name: from
          type: string
        - description: End date YYYY-MM-DD
          in: query
          name: to
          type: string
        - description: Operator ID
          in: query
          name: operator_id
          type: integer
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/main.AnalyticsSummary'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: Get analytics summary
      tags:
        - analytics
  /auth/me:
    get:
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/main.AuthMeResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: Inspect current workspace access token
      tags:
        - auth
  /contacts:
    get:
      parameters:
        - description: Page size, default 20, max 100
          in: query
          name: limit
          type: integer
        - description: Cursor from previous response
          in: query
          name: cursor
          type: integer
        - description: Search text
          in: query
          name: search
          type: string
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/main.ContactsPage'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: List contacts
      tags:
        - contacts
  /contacts/{id}:
    get:
      parameters:
        - description: Contact ID
          in: path
          name: id
          required: true
          type: integer
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/main.Contact'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: Get contact
      tags:
        - contacts
  /contacts/{id}/conversations:
    get:
      parameters:
        - description: Contact ID
          in: path
          name: id
          required: true
          type: integer
        - description: Page size, default 20, max 100
          in: query
          name: limit
          type: integer
        - description: Cursor from previous response
          in: query
          name: cursor
          type: integer
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/main.ConversationsPage'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: List contact conversations
      tags:
        - contacts
  /conversations:
    get:
      parameters:
        - description: Page size, default 20, max 100
          in: query
          name: limit
          type: integer
        - description: Cursor from previous response
          in: query
          name: cursor
          type: integer
        - description: Conversation status. Defaults to open when omitted.
          enum:
            - open
            - snoozed
            - closed
          in: query
          name: status
          type: string
        - description: Assignee filter
          enum:
            - mine
            - unassigned
          in: query
          name: assignee
          type: string
        - description: Department ID
          in: query
          name: department
          type: integer
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/main.ConversationsPage'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: List conversations
      tags:
        - conversations
  /conversations/{id}:
    get:
      parameters:
        - description: Conversation ID
          in: path
          name: id
          required: true
          type: integer
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/main.ConversationView'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: Get conversation
      tags:
        - conversations
  /conversations/{id}/messages:
    get:
      parameters:
        - description: Conversation ID
          in: path
          name: id
          required: true
          type: integer
        - description: Page size, default 20, max 100
          in: query
          name: limit
          type: integer
        - description: Message ID cursor
          in: query
          name: before
          type: integer
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            items:
              $ref: '#/definitions/main.Message'
            type: array
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: List conversation messages
      tags:
        - messages
    post:
      consumes:
        - application/json
      parameters:
        - description: Conversation ID
          in: path
          name: id
          required: true
          type: integer
        - description: Message payload
          in: body
          name: request
          required: true
          schema:
            $ref: '#/definitions/main.SendMessageRequest'
      produces:
        - application/json
      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/main.Message'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/main.Error'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: Send message to conversation
      tags:
        - messages
  /conversations/{id}/ratings:
    get:
      parameters:
        - description: Conversation ID
          in: path
          name: id
          required: true
          type: integer
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            items:
              $ref: '#/definitions/main.Rating'
            type: array
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: List conversation ratings
      tags:
        - ratings
  /files/{id}/confirm:
    post:
      parameters:
        - description: File ID
          in: path
          name: id
          required: true
          type: integer
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/main.File'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/main.Error'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: Confirm uploaded file
      tags:
        - files
  /files/{id}/url:
    get:
      parameters:
        - description: File ID
          in: path
          name: id
          required: true
          type: integer
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/main.FileURLResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: Get public file URL
      tags:
        - files
  /files/presign:
    post:
      consumes:
        - application/json
      parameters:
        - description: File metadata
          in: body
          name: request
          required: true
          schema:
            $ref: '#/definitions/main.PresignFileRequest'
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/main.PresignFileResponse'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/main.Error'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: Create file upload URL
      tags:
        - files
  /quick-replies:
    get:
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            items:
              $ref: '#/definitions/main.QuickReply'
            type: array
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: List quick replies
      tags:
        - quick-replies
  /visitors/{visitorID}/start:
    post:
      parameters:
        - description: Visitor ID
          in: path
          name: visitorID
          required: true
          type: string
      produces:
        - application/json
      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/main.StartVisitorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: Start a conversation with an online visitor
      tags:
        - visitors
  /visitors/online:
    get:
      parameters:
        - description: Page size, default 20, max 100
          in: query
          name: limit
          type: integer
        - description: Cursor returned by the previous page
          in: query
          name: cursor
          type: string
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/main.OnlineVisitorsResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: List online visitors
      tags:
        - visitors
  /workspace:
    get:
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/main.Workspace'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/main.Error'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/main.Error'
      security:
        - WorkspaceTokenAuth: []
      summary: Get current workspace
      tags:
        - workspace
securityDefinitions:
  WorkspaceTokenAuth:
    description: Use "Bearer wk_..." as the header value.
    in: header
    name: Authorization
    type: apiKey
swagger: '2.0'
