> ## Documentation Index
> Fetch the complete documentation index at: https://docs.writine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# File a request

> File a request that expects an answer later; it reaches the same inbox as a chat and draws on the same daily allowance. No visitor token is issued, because nothing is read back over the widget session. Files are described here, not uploaded here: the reply carries one presigned destination per file. Authorization and resource ownership are evaluated on every request.



## OpenAPI

````yaml /openapi/widget.json post /api/v1/chat/widget/{siteID}/tickets
openapi: 3.1.0
info:
  title: Widget API
  version: 1.0.0
  description: >-
    Embed Writine chat on your own site. These endpoints need no Writine
    account: the widget routes are authorised by your site origin allowlist, and
    the visitor routes by a token issued when a conversation starts.
servers:
  - url: https://api.writine.com
    description: Production
security: []
paths:
  /api/v1/chat/widget/{siteID}/tickets:
    post:
      summary: File a request
      description: >-
        File a request that expects an answer later; it reaches the same inbox
        as a chat and draws on the same daily allowance. No visitor token is
        issued, because nothing is read back over the widget session. Files are
        described here, not uploaded here: the reply carries one presigned
        destination per file. Authorization and resource ownership are evaluated
        on every request.
      operationId: chat_post__api_v1_chat_widget__siteID__tickets
      parameters:
        - in: path
          name: siteID
          required: true
          schema:
            type: string
            maxLength: 100
        - in: header
          name: Origin
          required: true
          schema:
            type: string
            format: uri
          description: >-
            Must exactly match the website's allowlist. Visitor tokens are bound
            to this origin.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 80
                email:
                  type: string
                  maxLength: 254
                subject:
                  type: string
                  maxLength: 120
                body:
                  type: string
                  maxLength: 8000
                priority:
                  type: string
                  enum:
                    - low
                    - normal
                    - high
                    - urgent
                files:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        maxLength: 255
                      content_type:
                        type: string
                        enum:
                          - image/png
                          - image/jpeg
                          - image/gif
                          - image/webp
                          - application/pdf
                          - text/plain
                          - text/csv
                          - application/zip
                          - application/msword
                          - >-
                            application/vnd.openxmlformats-officedocument.wordprocessingml.document
                          - >-
                            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
                      bytes:
                        type: integer
                        minimum: 0
                    required:
                      - name
                      - content_type
                      - bytes
                    additionalProperties: false
              required:
                - email
                - subject
                - body
              additionalProperties: false
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      number:
                        type: integer
                        minimum: 0
                      subject:
                        type: string
                        maxLength: 120
                      uploads:
                        type: array
                        items:
                          type: object
                          properties:
                            attachment_id:
                              type: string
                              maxLength: 64
                            upload_url:
                              type: string
                              maxLength: 2000
                            name:
                              type: string
                              maxLength: 255
                          required:
                            - attachment_id
                            - upload_url
                            - name
                          additionalProperties: false
                    required:
                      - number
                      - subject
                      - uploads
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '400':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '401':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '403':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '404':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '409':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '429':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '500':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '503':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
      security: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.