> ## Documentation Index
> Fetch the complete documentation index at: https://api-documentation.kare-app.fr/llms.txt
> Use this file to discover all available pages before exploring further.

# Prepare a presigned upload and attach a file to one parent



## OpenAPI

````yaml /api/rs/openapi.json post /rs/attachments/v1/
openapi: 3.0.3
info:
  title: KARE API
  description: Backend API for the KARE platform
  version: dev
servers:
  - url: http://localhost:3000
    description: Local dev
security: []
tags:
  - name: better-auth
    description: >-
      Better Auth's own endpoints (sign-in, session, MFA, password) - generated
      from the audience's live config via `generateOpenAPISchema()`, not
      hand-written.
paths:
  /rs/attachments/v1/:
    post:
      tags:
        - attachments
      summary: Prepare a presigned upload and attach a file to one parent
      operationId: createAttachmentRSV1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                parentType:
                  type: string
                  enum:
                    - anomaly
                    - intervention
                    - report
                    - logbook
                    - provider
                    - contract
                    - equipment
                    - routine
                parentId:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                name:
                  type: string
                  minLength: 1
                  maxLength: 255
                mimeType:
                  type: string
                  enum:
                    - image/jpg
                    - image/jpeg
                    - image/png
                    - image/svg+xml
                    - image/gif
                    - text/plain
                    - text/csv
                    - application/pdf
                    - application/msword
                    - >-
                      application/vnd.openxmlformats-officedocument.wordprocessingml.document
                    - application/vnd.ms-excel
                    - >-
                      application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
                    - application/zip
                    - application/x-7z-compressed
                    - application/vnd.ms-outlook
                    - message/rfc822
                size:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  maximum: 1073741824
              required:
                - parentType
                - parentId
                - name
                - mimeType
                - size
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  presignedUrl:
                    type: string
                    format: uri
                  expiresAt:
                    type: string
                    format: date-time
                required:
                  - id
                  - presignedUrl
                  - expiresAt
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  details: {}
                required:
                  - error
                  - message
                  - requestId
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  details: {}
                required:
                  - error
                  - message
                  - requestId
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  details: {}
                required:
                  - error
                  - message
                  - requestId
                additionalProperties: false

````