> ## 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.

# Attach Playlist Attachment



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/teams/{team_id}/playlists/{id}/attachments
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}/playlists/{id}/attachments:
    post:
      tags:
        - media-admin
      summary: Attach Playlist Attachment
      operationId: >-
        media_admin.post_media_admin_post_teams_by_team_id_playlists_by_id_attachments
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
        - in: path
          name: id
          required: true
          schema:
            title: Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/PlaylistAttachmentCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/PlaylistAttachmentAdminResponse'
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    PlaylistAttachmentCreateRequest:
      additionalProperties: false
      description: Body of ``POST /api/teams/{team_id}/playlists/{id}/attachments``.
      properties:
        data:
          $ref: '#/components/schemas/PlaylistAttachmentCreateData'
      required:
        - data
      title: PlaylistAttachmentCreateRequest
      type: object
    PlaylistAttachmentAdminResponse:
      description: 'One attachment: the body of ``POST`` (201) and ``PATCH`` (200).'
      properties:
        data:
          $ref: '#/components/schemas/PlaylistAttachmentAdminResource'
      required:
        - data
      title: PlaylistAttachmentAdminResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    PlaylistAttachmentCreateData:
      additionalProperties: false
      properties:
        attributes:
          $ref: '#/components/schemas/PlaylistAttachmentCreate'
        type:
          const: playlist_attachments
          default: playlist_attachments
          title: Type
          type: string
      required:
        - attributes
      title: PlaylistAttachmentCreateData
      type: object
    PlaylistAttachmentAdminResource:
      properties:
        attributes:
          $ref: '#/components/schemas/PlaylistAttachmentAdminAttributes'
        id:
          title: Id
          type: string
        type:
          const: playlist_attachments
          default: playlist_attachments
          title: Type
          type: string
      required:
        - id
        - attributes
      title: PlaylistAttachmentAdminResource
      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
    PlaylistAttachmentCreate:
      additionalProperties: false
      description: >-
        ``attributes`` of ``POST .../attachments``: which library file, and
        where.
      properties:
        file_id:
          description: ID of the library File to attach.
          title: File Id
          type: string
        position:
          anyOf:
            - maximum: 2147483647
              minimum: 0
              type: integer
            - type: 'null'
          description: 0-based slot. Omit to append; a value past the end appends.
          title: Position
      required:
        - file_id
      title: PlaylistAttachmentCreate
      type: object
    PlaylistAttachmentAdminAttributes:
      additionalProperties: false
      description: >-
        What a team admin sees of one attachment: the member fields plus its
        slot.


        ``url`` is the download route scoped to the playlist's own hub, and is

        ``None`` for a playlist that has no hub (``Playlist.hub_id`` is
        nullable).
      properties:
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: File Id
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        media_id:
          title: Media Id
          type: string
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Mime Type
        position:
          title: Position
          type: integer
        role:
          const: attachment
          title: Role
          type: string
        size_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size Bytes
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
      required:
        - media_id
        - role
        - position
      title: PlaylistAttachmentAdminAttributes
      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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.