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

# Post attachments

> Generate a pre-signed upload URL for a ticket attachment. Upload the file with an HTTP PUT request to the returned URL, then pass the attachment ID in the POST /tickets request.



## OpenAPI

````yaml https://api.theymes.com/openapi post /attachments
openapi: 3.1.0
info:
  title: Theymes API
  version: 1.0.0
  description: >-
    Theymes API allows you to interact with the Theymes platform.



    Most endpoints require an API key for authentication. You can generate an
    API key in the Theymes dashboard.



    The API key should be included in the Authorization header
    (```Authorization: Bearer <YOUR_KEY>```).



    The public support link endpoints do not require authentication and are
    grouped separately below.
servers: []
security: []
tags:
  - name: Authenticated endpoints (API key)
    description: Endpoints that require an API key in the Authorization header.
  - name: Public support links (no authentication)
    description: >-
      Endpoints for creating web support sessions and links. These require no
      authentication and are identified by a game environment token.
paths:
  /attachments:
    post:
      tags:
        - Authenticated endpoints (API key)
      description: >-
        Generate a pre-signed upload URL for a ticket attachment. Upload the
        file with an HTTP PUT request to the returned URL, then pass the
        attachment ID in the POST /tickets request.
      operationId: prepareAttachmentUpload
      parameters:
        - schema:
            type: string
            description: Bearer token API key
          required: true
          description: Bearer token API key
          name: Authorization
          in: header
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                gameId:
                  type: string
                  format: uuid
                fileName:
                  type: string
                  minLength: 1
                fileType:
                  type: string
                  enum:
                    - image/svg+xml
                    - image/png
                    - image/jpeg
                    - image/gif
                    - application/pdf
                    - video/mp4
                    - video/quicktime
                    - text/plain
                    - application/zip
                    - application/vnd.rar
                fileSize:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  maximum: 209715200
                  description: Size of the file in bytes. Maximum allowed size is 200 MB.
                playerId:
                  type: string
                  nullable: true
                  minLength: 1
                  description: >-
                    Optional player identifier to associate with the uploaded
                    attachment.
              required:
                - gameId
                - fileName
                - fileType
                - fileSize
      responses:
        '200':
          description: Attachment upload instructions
          content:
            application/json:
              schema:
                type: object
                properties:
                  attachmentId:
                    type: string
                    description: >-
                      Attachment identifier to be used in POST /tickets.
                      Represents the uploaded file key.
                  uploadUrl:
                    type: string
                    format: uri
                    description: Pre-signed URL for uploading the file.
                  uploadMethod:
                    type: string
                    enum:
                      - PUT
                    description: HTTP method to use for the upload request.
                  uploadHeaders:
                    type: object
                    additionalProperties:
                      type: string
                    description: >-
                      Headers that must be included when uploading the file.
                      Provide them exactly as returned to ensure the URL
                      signature matches.
                  uploadExpiresInSeconds:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    description: Number of seconds the signed upload URL remains valid.
                required:
                  - attachmentId
                  - uploadUrl
                  - uploadMethod
                  - uploadHeaders
                  - uploadExpiresInSeconds

````