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

# Create Page Section Attachment

> Create a page-section attachment. caller_module='pages' is hard-coded server-side.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/teams/{team_id}/page-section-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}/page-section-attachments:
    post:
      tags:
        - media-admin-attachments
      summary: Create Page Section Attachment
      description: >-
        Create a page-section attachment. caller_module='pages' is hard-coded
        server-side.
      operationId: >-
        media_admin_attachments.post_media_admin_attachments_post_teams_by_team_id_page_section_attachments
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/AttachmentCreateRequest'
        required: true
      responses:
        '201':
          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:
    AttachmentCreateRequest:
      description: Request body for POST /api/teams/{team_id}/attachments.
      properties:
        data:
          $ref: '#/components/schemas/AttachmentCreateData'
      required:
        - data
      title: AttachmentCreateRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AttachmentCreateData:
      properties:
        attributes:
          $ref: '#/components/schemas/AttachmentCreateAttributes'
        type:
          const: attachments
          default: attachments
          title: Type
          type: string
      required:
        - attributes
      title: AttachmentCreateData
      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
    AttachmentCreateAttributes:
      properties:
        media_id:
          description: ID of the Media asset to attach.
          title: Media Id
          type: string
        position:
          default: 0
          description: Display order within the target+role group.
          maximum: 2147483647
          minimum: 0
          title: Position
          type: integer
        role:
          description: Semantic role of the attachment.
          enum:
            - main
            - thumbnail
            - logo
            - favicon
            - attachment
            - social_image
            - background_image
            - widget_logo
            - widget_background
          title: Role
          type: string
        target_id:
          description: ID of the target entity (36-char string/UUID).
          title: Target Id
          type: string
        target_type:
          description: Type of the target entity.
          enum:
            - content_node
            - hub_branding
            - page_section
            - email_message
            - playlist
            - comment
            - discussion
            - message
          title: Target Type
          type: string
      required:
        - media_id
        - target_type
        - target_id
        - role
      title: AttachmentCreateAttributes
      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

````