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

# Create media resource



## OpenAPI

````yaml https://api.amply-app.com/v1/openapi.json post /v1/users/{userId}/medias
openapi: 3.1.0
info:
  title: Amply API
  version: 1.0.0
  description: >-
    Authentication: send your API key in the `X-API-KEY` header.


    Each API key is tied to a single broadcast. A key cannot manage multiple
    broadcasts.


    API keys can be generated from the broadcast developer settings.
servers:
  - url: https://api.amply-app.com
security:
  - ApiKeyAuth: []
tags:
  - name: broadcastEvent resource
    description: API endpoints for managing broadcastEvent resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastEventResponse'
    x-tag-schema-example:
      type: app.opened
      metadata: {}
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcastNetworkingForm resource
    description: API endpoints for managing broadcastNetworkingForm resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastNetworkingForm'
    x-tag-schema-example:
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: media resource
    description: API endpoints for managing media resources
    x-tag-schema:
      $ref: '#/components/schemas/media'
    x-tag-schema-example:
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _userId: string
      mediaUrl: string
      external: true
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcastContact resource
    description: API endpoints for managing broadcastContact resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastContact'
    x-tag-schema-example:
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcastCategory resource
    description: API endpoints for managing broadcastCategory resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastCategory'
    x-tag-schema-example:
      status: draft
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcastClient resource
    description: API endpoints for managing broadcastClient resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastClient'
    x-tag-schema-example:
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcastDiffuser resource
    description: API endpoints for managing broadcastDiffuser resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastDiffuser'
    x-tag-schema-example:
      type: webSite
      seo:
        title: string
        metaDescription: string
        indexing: true
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcastCampaign resource
    description: API endpoints for managing broadcastCampaign resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastCampaign'
    x-tag-schema-example:
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcastArticle resource
    description: API endpoints for managing broadcastArticle resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastArticle'
    x-tag-schema-example:
      status: draft
      blocks:
        - type: media
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcast resource
    description: API endpoints for managing broadcast resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcast'
    x-tag-schema-example:
      name: x
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcastHost resource
    description: API endpoints for managing broadcastHost resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastHost'
    x-tag-schema-example:
      name: x
      status: draft
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcastInterestPoint resource
    description: API endpoints for managing broadcastInterestPoint resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastInterestPoint'
    x-tag-schema-example:
      mapId: 64b7f8b6f23a4a4f3d0a9b12
      status: draft
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcastMap resource
    description: API endpoints for managing broadcastMap resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastMap'
    x-tag-schema-example:
      type: image
      status: draft
      metadata: {}
  - name: broadcastMember resource
    description: API endpoints for managing broadcastMember resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastMember'
    x-tag-schema-example:
      email: user@example.com
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcastPage resource
    description: API endpoints for managing broadcastPage resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastPage'
    x-tag-schema-example:
      status: draft
      blocks:
        - type: media
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: revision resource
    description: API endpoints for managing revision resources
    x-tag-schema:
      $ref: '#/components/schemas/revision'
    x-tag-schema-example:
      tos:
        accepted: true
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: broadcastSession resource
    description: API endpoints for managing broadcastSession resources
    x-tag-schema:
      $ref: '#/components/schemas/broadcastSession'
    x-tag-schema-example:
      status: draft
      time: {}
      blocks:
        - type: media
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: workflow resource
    description: API endpoints for managing workflow resources
    x-tag-schema:
      $ref: '#/components/schemas/workflow'
    x-tag-schema-example:
      entryNodeId: x
      nodes:
        - id: x
          position:
            - 0
            - 0
          type: amply
          config:
            operation:
              type: string
              value: string
            resource:
              type: string
              value: string
      name: x
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: workflowRun resource
    description: API endpoints for managing workflowRun resources
    x-tag-schema:
      $ref: '#/components/schemas/workflowRun'
    x-tag-schema-example:
      status: running
      durationMs: 0
      invokedNodeCount: 0
      context: {}
      nodeResults:
        - executionId: x
          index: 0
          nodeId: x
          nodeType: amply
          routeTaken: onSuccess
          durationMs: 0
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
  - name: font resource
    description: API endpoints for managing font resources
    x-tag-schema:
      $ref: '#/components/schemas/font'
    x-tag-schema-example:
      fontFamily: string
      weights:
        - weight: 0
          url: https://example.com
      _id: 64b7f8b6f23a4a4f3d0a9b12
      _createdAt: '2024-01-01T00:00:00.000Z'
paths:
  /v1/users/{userId}/medias:
    post:
      tags:
        - media resource
      summary: Create media resource
      parameters:
        - name: userId
          in: path
          required: true
          description: Resource identifier.
          schema:
            type: string
            format: objectId
          example: 64b7f8b6f23a4a4f3d0a9b12
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/mediaCreate'
            example:
              data: string
              path: string
              url: https://example.com
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/media'
components:
  schemas:
    mediaCreate:
      type: object
      properties:
        data:
          nullable: true
          type: string
          example: string
        path:
          nullable: true
          type: string
          example: string
        url:
          nullable: true
          type: string
          format: uri
          example: https://example.com
        external:
          nullable: true
          type: boolean
          example: true
        externalUrl:
          nullable: true
          type: string
          example: string
        metadata:
          type: object
          additionalProperties: {}
    media:
      type: object
      properties:
        _id:
          type: string
          format: objectId
          example: 64b7f8b6f23a4a4f3d0a9b12
        _userId:
          type: string
          example: string
        mediaUrl:
          type: string
          example: string
        externalUrl:
          nullable: true
          type: string
          example: string
        external:
          type: boolean
          example: true
        _createdAt:
          type: string
          format: date-time
          example: '2024-01-01T00:00:00.000Z'
        _updatedAt:
          type: string
          format: date-time
          nullable: true
          example: '2024-01-01T00:00:00.000Z'
        _reference:
          nullable: true
          type: string
          example: string
      required:
        - _id
        - _userId
        - mediaUrl
        - external
        - _createdAt
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Use the format `X-API-KEY YOUR_API_KEY`. Each key is tied to a single
        broadcast.

````

## Related topics

- [Create broadcastMap resource](/api-reference/broadcastmap-resource/create-broadcastmap-resource.md)
- [Create broadcastHost resource](/api-reference/broadcasthost-resource/create-broadcasthost-resource.md)
- [Create broadcastCampaign resource](/api-reference/broadcastcampaign-resource/create-broadcastcampaign-resource.md)
- [Create broadcastPage resource](/api-reference/broadcastpage-resource/create-broadcastpage-resource.md)
- [Create broadcastSession resource](/api-reference/broadcastsession-resource/create-broadcastsession-resource.md)


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