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

> **Protocols:** Meta Cloud API

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

Append the raw file bytes to a resumable upload session. The request body is the binary file contents (no multipart wrapper); send file_offset: 0 on the first call. Returns { h: "<FILE_HANDLE>" } on success.



## OpenAPI

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


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


        Append the raw file bytes to a resumable upload session. The request
        body is the binary file contents (no multipart wrapper); send
        file_offset: 0 on the first call. Returns { h: "<FILE_HANDLE>" } on
        success.
      operationId: graphUploadAppend
      parameters:
        - schema:
            type: string
            example: v21.0
          required: true
          name: version
          in: path
          description: Specifies version for this path parameter.
        - schema:
            type: string
            description: 'A media ID for GET/DELETE, or an upload: session ID for POST.'
          required: true
          name: objectId
          in: path
          description: Identifier for the object.
      requestBody:
        content:
          application/octet-stream:
            schema:
              $ref: '#/components/schemas/graph__GraphUploadAppendRequest'
      responses:
        '200':
          description: File handle (Meta response, forwarded verbatim)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphUploadAppendResponse'
        '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__GraphUploadAppendRequest:
      nullable: true
    graph__GraphUploadAppendResponse:
      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.

````