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

# Publish Hub Media File

> Publish/upsert a FILE into the hub (idempotent on (hub, file)).



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/teams/{team_id}/hubs/{hub_id}/media
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}/hubs/{hub_id}/media:
    post:
      tags:
        - media-admin-hub-media
      summary: Publish Hub Media File
      description: Publish/upsert a FILE into the hub (idempotent on (hub, file)).
      operationId: >-
        media_admin_hub_media.post_media_admin_hub_media_post_teams_by_team_id_hubs_by_hub_id_media
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
        - in: path
          name: hub_id
          required: true
          schema:
            title: Hub Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/HubMediaPublishRequest'
        required: true
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HubMediaResponse'
          description: Publish row updated (upsert).
        '201':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HubMediaResponse'
          description: Publish row created.
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    HubMediaPublishRequest:
      description: Body for POST .../media or .../playlists/{id}.
      properties:
        data:
          $ref: '#/components/schemas/HubMediaPublishData'
      required:
        - data
      title: HubMediaPublishRequest
      type: object
    HubMediaResponse:
      description: Single-resource response wrapping a HubMediaResource.
      properties:
        data:
          $ref: '#/components/schemas/JsonApiResource_HubMediaAttributes_'
        included:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Included
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - data
      title: HubMediaResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    HubMediaPublishData:
      properties:
        attributes:
          $ref: '#/components/schemas/HubMediaPublishAttributes'
        type:
          const: hub_media
          default: hub_media
          title: Type
          type: string
      required:
        - attributes
      title: HubMediaPublishData
      type: object
    JsonApiResource_HubMediaAttributes_:
      properties:
        attributes:
          $ref: '#/components/schemas/HubMediaAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        relationships:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Relationships
        type:
          title: Type
          type: string
      required:
        - id
        - type
        - attributes
      title: JsonApiResource[HubMediaAttributes]
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      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
    HubMediaPublishAttributes:
      properties:
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Target file id (supplied on the media route only).
          title: File Id
        playlist_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Target playlist id (supplied on the playlists route only).
          title: Playlist Id
        position:
          anyOf:
            - maximum: 2147483647
              minimum: 0
              type: integer
            - type: 'null'
          title: Position
        published_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Publish timestamp. Null = draft. Future = scheduled. <= now = live.
          title: Published At
        visibility:
          default: members
          description: Per-hub visibility override.
          enum:
            - members
            - private
            - public
          title: Visibility
          type: string
      title: HubMediaPublishAttributes
      type: object
    HubMediaAttributes:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: File Id
        hub_id:
          title: Hub Id
          type: string
        playlist_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Playlist Id
        position:
          title: Position
          type: integer
        published_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Published At
        team_id:
          title: Team Id
          type: string
        updated_at:
          format: date-time
          title: Updated At
          type: string
        visibility:
          title: Visibility
          type: string
      required:
        - team_id
        - hub_id
        - visibility
        - position
        - created_at
        - updated_at
      title: HubMediaAttributes
      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

````