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

# Update Attachment

> Reorder (position) or change role of an attachment.

caller_module is derived from the existing row's target_type via _TARGET_TYPE_OWNER.



## OpenAPI

````yaml /openapi/mio-openapi.json patch /api/v1/teams/{team_id}/attachments/{attachment_id}
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/teams/{team_id}/attachments/{attachment_id}:
    patch:
      tags:
        - media-admin-attachments
      summary: Update Attachment
      description: >-
        Reorder (position) or change role of an attachment.


        caller_module is derived from the existing row's target_type via
        _TARGET_TYPE_OWNER.
      operationId: >-
        media_admin_attachments.patch_media_admin_attachments_patch_teams_by_team_id_attachments_by_attachment_id
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
        - in: path
          name: attachment_id
          required: true
          schema:
            title: Attachment Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/AttachmentUpdateRequest'
        required: true
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    AttachmentUpdateRequest:
      description: Request body for PATCH /api/teams/{team_id}/attachments/{id}.
      properties:
        data:
          $ref: '#/components/schemas/AttachmentUpdateData'
      required:
        - data
      title: AttachmentUpdateRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AttachmentUpdateData:
      properties:
        attributes:
          $ref: '#/components/schemas/AttachmentUpdateAttributes'
        id:
          title: Id
          type: string
        type:
          const: attachments
          default: attachments
          title: Type
          type: string
      required:
        - id
        - attributes
      title: AttachmentUpdateData
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    AttachmentUpdateAttributes:
      description: >-
        PATCH fields — both optional; zero fields is a valid NO-OP (returns 200
        unchanged).


        Explicit null for `position` or `role` is rejected with 422 — callers
        must omit

        the field entirely to preserve the current value. Accepting null
        silently would

        produce an invisible NO-OP that masks client bugs.
      properties:
        position:
          anyOf:
            - maximum: 2147483647
              minimum: 0
              type: integer
            - type: 'null'
          description: New display order.
          title: Position
        role:
          anyOf:
            - enum:
                - main
                - thumbnail
                - logo
                - favicon
                - attachment
                - social_image
                - background_image
                - widget_logo
                - widget_background
              type: string
            - type: 'null'
          description: New semantic role.
          title: Role
      title: AttachmentUpdateAttributes
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````