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

# Upload media

> **Protocols:** Linked Device API · Meta Cloud API

**Required scope:** `media:manage`



## OpenAPI

````yaml api-reference/features/communicate-graph.json POST /graph/whatsapp/{version}/{phoneNumberId}/media
openapi: 3.0.3
info:
  title: Communicate Polymorfa Graph API methods
  version: 1.0.0
  description: Task-focused communicate methods exposed by the Polymorfa Graph API.
servers: []
security: []
paths:
  /graph/whatsapp/{version}/{phoneNumberId}/media:
    post:
      tags:
        - Media
      summary: Upload media
      description: |-
        **Protocols:** Linked Device API · Meta Cloud API

        **Required scope:** `media:manage`
      operationId: graphUploadMedia
      parameters:
        - schema:
            type: string
            example: v21.0
          required: true
          name: version
          in: path
          description: Specifies version for this path parameter.
        - schema:
            type: string
            example: '123456789012345'
          required: true
          name: phoneNumberId
          in: path
          description: Identifier for the phone number.
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/graph__GraphMediaUploadRequest'
      responses:
        '200':
          description: Media uploaded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphMediaUploadResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphError'
        '401':
          description: Unauthenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphError'
        '403':
          description: Permission error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphError'
        '404':
          description: Object does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphError'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphError'
      security:
        - graph__BearerAuth: []
      servers:
        - url: https://api.polymorfa.com
components:
  schemas:
    graph__GraphMediaUploadRequest:
      type: object
      properties:
        messaging_product:
          type: string
          example: whatsapp
          description: Messaging product associated with this Graph API object.
        type:
          type: string
          description: Type discriminator for this object.
        file:
          type: string
          format: binary
          description: |-
            Specifies file for this graph graph media upload request.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `binary` |
      required:
        - messaging_product
    graph__GraphMediaUploadResponse:
      type: object
      properties:
        id:
          type: string
          description: Identifier for this resource.
      required:
        - id
    graph__GraphError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable message associated with this result.
            type:
              type: string
              description: Type discriminator for this object.
            code:
              type: number
              description: Stable machine-readable code for this result.
            error_subcode:
              type: number
              description: Machine-readable error subcode for this error.
            error_data:
              nullable: true
              description: |-
                Specifies error data for this error.

                <!-- polymorfa-input-table -->
                **Accepted alternatives**
                | Alternative | Accepted input |
                | --- | --- |
                | Alternative 1 | Any JSON value matching this alternative |
                | Alternative 2 | `null` |
            fbtrace_id:
              type: string
              description: Identifier for the fbtrace.
          required:
            - message
            - type
            - code
            - fbtrace_id
          description: Error details returned when the operation fails.
      required:
        - error
  securitySchemes:
    graph__BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Polymorfa organization key (pmfa_ prefix) or project token (pmfa_pt_
        prefix). Client tokens are not accepted by Graph operations.

````