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

# Update an attachment

> Updates an attachment. Set its type via `type` — either a predefined type (`{ name }`) or a custom, tenant-defined type (`{ id }`) — and/or update `expiryDate` and `validFrom`. Fields that are omitted are left unchanged; pass `null` for a date to clear it. The type must be allowed for all records the attachment is linked to: the predefined `CV` type can only be set on attachments linked to a candidate, and custom types define which record types they support. Attachments with platform-internal types are treated as not found.



## OpenAPI

````yaml /openapi-private.json patch /attachments/{id}
openapi: 3.1.0
info:
  title: Spott API Reference
  version: '0.1'
servers:
  - url: https://api.gospott.com
security: []
tags: []
paths:
  /attachments/{id}:
    patch:
      tags:
        - Attachments
      summary: Update an attachment
      description: >-
        Updates an attachment. Set its type via `type` — either a predefined
        type (`{ name }`) or a custom, tenant-defined type (`{ id }`) — and/or
        update `expiryDate` and `validFrom`. Fields that are omitted are left
        unchanged; pass `null` for a date to clear it. The type must be allowed
        for all records the attachment is linked to: the predefined `CV` type
        can only be set on attachments linked to a candidate, and custom types
        define which record types they support. Attachments with
        platform-internal types are treated as not found.
      operationId: updateAttachment
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAttachmentDto'
      responses:
        '204':
          description: Attachment updated successfully
        '400':
          description: >-
            Bad request - invalid body, invalid attachment type, or attachment
            type not allowed for the records the attachment is linked to
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ExceptionBaseDto'
                  - type: object
                    properties:
                      statusCode:
                        type: number
                        example: 400
                      message:
                        type: string
                        example: ATTACHMENT_TYPE_NOT_ALLOWED_FOR_RECORD_TYPE
                      error:
                        type: string
                        example: Bad Request
        '401':
          description: Unauthorized - invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
        '404':
          description: Attachment not found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ExceptionBaseDto'
                  - type: object
                    properties:
                      statusCode:
                        type: number
                        example: 404
                      message:
                        type: string
                        example: Attachment not found
                      error:
                        type: string
                        example: Not Found
        '500':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
      security:
        - x-api-key: []
components:
  schemas:
    UpdateAttachmentDto:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/AttachmentTypeInputDto'
          description: >-
            The attachment type to set — a predefined type (`{ name }`) or a
            custom, tenant-defined type (`{ id }`). Omit to leave the type
            unchanged.
        expiryDate:
          description: The date on which the attachment expires. Pass null to clear it.
          anyOf:
            - $ref: '#/components/schemas/DateISO'
            - type: 'null'
        validFrom:
          description: The date from which the attachment is valid. Pass null to clear it.
          anyOf:
            - $ref: '#/components/schemas/DateISO'
            - type: 'null'
      id: PrivateUpdateAttachmentDto
    ExceptionBaseDto:
      type: object
      properties:
        status:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        message:
          type: string
        requestId:
          type: string
      required:
        - status
        - message
        - requestId
      id: ExceptionBaseDto
    AttachmentTypeInputDto:
      anyOf:
        - $ref: '#/components/schemas/CustomAttachmentTypeInputDto'
        - $ref: '#/components/schemas/SystemAttachmentTypeInputDto'
        - $ref: '#/components/schemas/SystemAttachmentTypeNameDto'
      id: PrivateAttachmentTypeInputDto
    DateISO:
      id: DateISO
      format: date-time
      anyOf:
        - type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        - type: string
          format: date
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
    CustomAttachmentTypeInputDto:
      type: object
      properties:
        id:
          type: string
          minLength: 1
      required:
        - id
      id: PrivateCustomAttachmentTypeInputDto
    SystemAttachmentTypeInputDto:
      type: object
      properties:
        name:
          type: string
          enum:
            - UNASSIGNED
            - CV
      required:
        - name
      id: PrivateSystemAttachmentTypeInputDto
    SystemAttachmentTypeNameDto:
      type: string
      enum:
        - UNASSIGNED
        - CV
      id: PrivateSystemAttachmentTypeNameDto
  securitySchemes:
    x-api-key:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        API key for authentication. Get your API key from Settings → API Keys in
        your Spott dashboard.

````