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

# Create an image or video upload

> Required permissions: media-write.



## OpenAPI

````yaml /api-reference/openapi.json post /media/uploads
openapi: 3.1.0
info:
  title: Postinger Public API
  version: 1.0.0
  description: >-
    Project-scoped API keys. JSON bodies up to 100 KB. Upload media directly to
    the returned R2 URL, then complete the upload. Rate limits are shared by all
    keys in the project. Scheduling requires posts-publish in addition to
    posts-write. A paused key returns 403 with error.code api_key_paused.
servers:
  - url: https://api.dev.postinger.dev/public/v1
security: []
paths:
  /media/uploads:
    post:
      tags:
        - Media
      summary: Create an image or video upload
      description: 'Required permissions: media-write.'
      operationId: createUpload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Upload'
      responses:
        '201':
          description: Success
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    $ref: '#/components/schemas/MediaUpload'
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '400':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '401':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '403':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '404':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '409':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
            Retry-After:
              schema:
                type: integer
              description: Present for idempotency_in_progress; wait before retrying.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '413':
          description: >-
            JSON body exceeds the 100 KB limit. This can be rejected before the
            controller, so the public error envelope is not guaranteed.
        '429':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
            Retry-After:
              schema:
                type: integer
              description: Seconds before retrying.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '500':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '503':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
      security:
        - ApiKey: []
components:
  schemas:
    Upload:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        filename:
          type: string
          minLength: 1
          maxLength: 255
        contentType:
          type: string
          enum:
            - image/jpeg
            - image/png
            - video/mp4
            - video/quicktime
        sizeBytes:
          type: integer
          exclusiveMinimum: 0
          maximum: 1073741824
      required:
        - filename
        - contentType
        - sizeBytes
      additionalProperties: false
      description: >-
        JPEG/PNG images: at most 8 MiB. MP4/MOV videos: at most 1 GiB. Upload
        the file to the signed storage URL without the Postinger Authorization
        header, then call complete.
      allOf:
        - if:
            properties:
              contentType:
                enum:
                  - image/jpeg
                  - image/png
            required:
              - contentType
          then:
            properties:
              sizeBytes:
                maximum: 8388608
    MediaUpload:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        uploadUrl:
          type: string
          description: >-
            Signed PUT URL. Empty for multipart uploads; use the multipart
            endpoint to sign each part.
        multipart:
          type: boolean
        partSize:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        posterUploadUrl:
          type: string
        expiresAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
      required:
        - id
        - uploadUrl
        - multipart
        - partSize
        - expiresAt
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: Postinger API key

````

## Related topics

- [Upload media](/guides/media.md)
- [MCP examples](/mcp/examples.md)
- [Sign parts, list parts, complete or abort a large video upload](/api-reference/media/sign-parts-list-parts-complete-or-abort-a-large-video-upload.md)
- [Your first draft](/quickstart.md)
- [Read current publishing rules and account availability](/api-reference/accounts/read-current-publishing-rules-and-account-availability.md)


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