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

# Create Attachment

> Upload a file and receive a one-time attachment token. The token can then be attached to an expense via `POST /expenses/{expense_id}/attachments` or included in `POST /expenses`.



## OpenAPI

````yaml /openapi.json post /attachments
openapi: 3.1.1
info:
  title: Everhour API
  version: 1.0.0
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.everhour.com
security:
  - ApiKeyAuth: []
tags:
  - name: Clients
  - name: Custom Fields
  - name: Expenses
  - name: Invoices
  - name: Projects
  - name: Reports
  - name: Schedule
  - name: Tasks
  - name: Time Off
  - name: Time Records
  - name: Timecards
  - name: Timers
  - name: Timesheets
  - name: Users
  - name: Webhooks
paths:
  /attachments:
    post:
      tags:
        - Expenses
      summary: Create Attachment
      description: >-
        Upload a file and receive a one-time attachment token. The token can
        then be attached to an expense via `POST
        /expenses/{expense_id}/attachments` or included in `POST /expenses`.
      operationId: createAttachment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AttachmentRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentDetails'
        '401':
          description: Unauthorized
components:
  schemas:
    AttachmentRequest:
      type: object
      properties:
        name:
          type: string
          example: avatar.jpg
        content:
          type: string
          description: Base64 file content. Only jpg, png and pdf supported
        type:
          type: string
          enum:
            - assignment
            - task
            - user
            - expense
          description: Object the attachment is linked to. Defaults to `expense`.
          example: expense
      required:
        - name
        - content
    AttachmentDetails:
      type: object
      properties:
        id:
          type: number
          example: 514
        name:
          type: string
          example: avatar.jpg
        token:
          type: string
          example: 9a04b8a1fb99cbfadf3386ad6a338c14
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````