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

# Request a pre-signed upload URL

> *Rate limit: 20 requests / minute per shop. See [Rate limiting](/guides/rate-limiting).*

Returns a pre-signed upload URL for uploading a new image. After receiving the response, PUT the image bytes directly to the uploadUrl.

<Note>
  **OAuth scope:** `media_write`

  API keys have full access to this endpoint.
</Note>


## OpenAPI

````yaml POST /open-api/v1.0/media/upload-url
openapi: 3.1.0
info:
  title: Fourthwall APIs
  description: Service used for management of orders, carts, and payments.
  termsOfService: https://fourthwall.com/terms-of-service
  contact:
    name: Backend team
    url: https://fourthwall.com
    email: backend@fourthwall.com
  version: unspecified
servers:
  - url: https://api.fourthwall.com
    description: Production server
security: []
externalDocs:
  description: OpenAPI documentation
  url: https://docs.fourthwall.com
paths:
  /open-api/v1.0/media/upload-url:
    post:
      tags:
        - Media Library
      summary: Request a pre-signed upload URL
      description: >-
        *Rate limit: 20 requests / minute per shop. See [Rate
        limiting](/guides/rate-limiting).*


        Returns a pre-signed upload URL for uploading a new image. After
        receiving the response, PUT the image bytes directly to the uploadUrl.
      operationId: request-media-upload-url
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/com.fourthwall.openapi.model.media.RequestUploadUrlV1
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/com.fourthwall.openapi.model.media.UploadUrlResponseV1
        '406':
          description: >-
            Possible errors: `MEDIA_FILE_SIZE_EXCEEDED_ERROR`,
            `UNSUPPORTED_ASSET_TYPE_ERROR`, `UNSUPPORTED_MEDIA_TYPE_ERROR`
          content:
            application/json:
              examples:
                media-file-size-exceeded-error:
                  value:
                    code: MEDIA_FILE_SIZE_EXCEEDED_ERROR
                    maxFileSize: <long>
                    fileSize: <long>
                unsupported-asset-type-error:
                  value:
                    code: UNSUPPORTED_ASSET_TYPE_ERROR
                    assetType: <assettype>
                unsupported-media-type-error:
                  value:
                    code: UNSUPPORTED_MEDIA_TYPE_ERROR
                    mediaType: <string>
                    supportedMediaTypes: <list>
        '429':
          description: |-
            Rate limited: 20 requests / minute per shop (effective limit).

            All applicable limits:
            - `open-api-medium-rate-limiter` — 20 requests / minute per shop
            - `open-api-rate-limiter` — 100 requests / 10 seconds per shop
          content:
            application/json:
              examples:
                too-many-requests:
                  value:
                    code: OPEN_API_TOO_MANY_REQUESTS
                    title: Too many requests
                    status: 429
      security:
        - oauth:
            - media_write
        - basicAuth: []
components:
  schemas:
    com.fourthwall.openapi.model.media.RequestUploadUrlV1:
      type: object
      properties:
        fileName:
          type: string
        contentType:
          type: string
        size:
          type: integer
          format: int64
      required:
        - contentType
        - fileName
        - size
      title: Request Upload Url
    com.fourthwall.openapi.model.media.UploadUrlResponseV1:
      type: object
      properties:
        uploadUrl:
          type: string
        fileUrl:
          type: string
        expiresAt:
          type: string
          format: date-time
      required:
        - fileUrl
        - uploadUrl
      title: Upload Url Response
  securitySchemes:
    oauth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: >-
            https://auth.staging.fourthwall.com/auth/realms/Fourthwall/protocol/openid-connect/auth
          scopes:
            donation_read: donation_read
            order_read: order_read
            order_write: order_write
            fulfillment_write: fulfillment_write
            giveaway_read: giveaway_read
            giveaway_write: giveaway_write
            memberships_read: memberships_read
            memberships_write: memberships_write
            promotions_write: promotions_write
            promotions_read: promotions_read
            offer_read: offer_read
            offer_write: offer_write
            shop_read: shop_read
            thankyou_read: thankyou_read
            thankyou_write: thankyou_write
            webhook_read: webhook_read
            webhook_write: webhook_write
            media_read: media_read
            media_write: media_write
            analytics_read: analytics_read
            samples_read: samples_read
            samples_write: samples_write
            dns_read: dns_read
            dns_write: dns_write
            settings_read: settings_read
            payout_read: payout_read
            integrations_read: integrations_read
    basicAuth:
      type: http
      scheme: basic

````