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

# Start a media upload

> **Protocols:** Meta Cloud API

**Required scope:** `messages:write`

Start a resumable upload. Pass file_name, file_length and file_type as query parameters; returns { id: "upload:<SESSION_ID>" } whose id is the path of the subsequent append call.



## OpenAPI

````yaml api-reference/features/communicate-graph.json POST /graph/whatsapp/{version}/{appId}/uploads
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}/{appId}/uploads:
    post:
      tags:
        - Media
      summary: Start a media upload
      description: >-
        **Protocols:** Meta Cloud API


        **Required scope:** `messages:write`


        Start a resumable upload. Pass file_name, file_length and file_type as
        query parameters; returns { id: "upload:<SESSION_ID>" } whose id is the
        path of the subsequent append call.
      operationId: graphCreateUploadSession
      parameters:
        - schema:
            type: string
            example: v21.0
          required: true
          name: version
          in: path
          description: Specifies version for this path parameter.
        - schema:
            type: string
            example: '1234567890123456'
          required: true
          name: appId
          in: path
          description: Identifier of the connected application.
        - schema:
            type: string
            example: header.jpg
          required: false
          name: file_name
          in: query
          description: Human-readable file name for this query parameter.
        - schema:
            type: string
            example: '152728'
          required: false
          name: file_length
          in: query
          description: Specifies file length for this query parameter.
        - schema:
            type: string
            example: image/jpeg
          required: false
          name: file_type
          in: query
          description: >-
            IANA media type that matches the uploaded file.


            <!-- polymorfa-input-table -->

            **Value constraints**

            | Constraint | Accepted input |

            | --- | --- |

            | Media type | IANA `type/subtype` value matching the payload, such
            as `application/pdf`, `text/plain`, or
            `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
            |
      responses:
        '200':
          description: Upload session created (Meta response, forwarded verbatim)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphCreateUploadSessionResponse'
        '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__GraphCreateUploadSessionResponse:
      nullable: true
    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.

````