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

# Get Asset upload URL

> This endpoint enables you to upload a file to the resource. Returns a presigned URL and the asset's public URL. Call PUT with the file as the body to upload the asset using the presigned URL.



## OpenAPI

````yaml /api-reference/openapi.documented.json post /api/assets
openapi: 3.0.2
info:
  title: Snag Solutions - API Docs
  description: >-
    Documentation for Loyalty & Socials APIs. Some endpoints require an API key
    to authenticate. To obtain a key, reach out to the Snag Solutions team at
    support@snagsolutions.io.
  version: '0.1'
servers:
  - url: https://admin.snagsolutions.io/
    description: Production
security: []
paths:
  /api/assets:
    post:
      tags:
        - Asset
      summary: Get Asset upload URL
      description: >-
        This endpoint enables you to upload a file to the resource. Returns a
        presigned URL and the asset's public URL. Call PUT with the file as the
        body to upload the asset using the presigned URL.
      parameters: []
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type: object
              properties:
                organizationId:
                  type: string
                  format: uuid
                  title: Organization ID
                  description: UUID of the organization (optional, converted to lowercase)
                  example: 123e4567-e89b-12d3-a456-426614174222
                websiteId:
                  type: string
                  format: uuid
                  title: Website ID
                  description: UUID of the website (optional, converted to lowercase)
                  example: 123e4567-e89b-12d3-a456-426614174111
                userId:
                  type: string
                  format: uuid
                  title: User ID
                  description: UUID of the user (optional, converted to lowercase)
                  example: 123e4567-e89b-12d3-a456-426614174333
                filePath:
                  type: string
                  enum:
                    - images
                    - videos
                    - banners
                    - fonts
                    - posts
                    - profiles
                    - minting
                    - loyalty
                    - tokenClaims
                    - dapps
                  title: File Path
                  description: The file path, must be a valid enum value.
                  example: images
                fileName:
                  type: string
                  pattern: ^[^\/\\]+$
                  title: File Name
                  description: >-
                    The name of the file, must match the regex pattern
                    (converted to lowercase) and have a valid extension.
                  example: example.png
                fileSize:
                  type: number
                  title: File Size
                  description: >-
                    Size of the file in bytes. Uploaded file must match this
                    file size. 1mb for images and 10mb for videos.
                  example: 1024
              required:
                - fileName
                - fileSize
              title: Upload Asset Schema
              description: >-
                Schema for uploading an asset with organization, website, and
                user details.
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  signedUrl:
                    type: string
                    format: uri
                    title: Signed URL
                    description: The pre-signed URL to be used for uploading the file.
                    example: >-
                      https://assets.snagsolutions.io/organizations/123e4567-e89b-12d3-a456-426614174222/websites/123e4567-e89b-12d3-a456-426614174111/images/example.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=ABJSSMZGO3T2ZKBVJOG2%2F20240702%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20240702T072637Z&X-Amz-Expires=60&X-Amz-Signature=6f7952568b7861edd14afb0915870970c9b048ba5237f7a70a16b0f10b96587e&X-Amz-SignedHeaders=host&x-id=PutObject
                  url:
                    type: string
                    format: uri
                    title: File URL
                    description: The URL of the uploaded file.
                    example: >-
                      https://assets.snagsolutions.io/organizations/123e4567-e89b-12d3-a456-426614174222/websites/123e4567-e89b-12d3-a456-426614174111/images/example.png
                required:
                  - signedUrl
                  - url
                title: Upload Asset Success Response
                description: >-
                  Response returned upon successful generation of the signed URL
                  for uploading the file.
        '400':
          description: '400'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Request body is invalid
                required:
                  - message
                title: Bad Request Response
                description: Schema for bad request response
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Forbidden, Could not validate api key
                required:
                  - message
                title: Forbidden Response
                description: Schema for forbidden response
                example: Forbidden, Could not validate api key
        '500':
          description: '500'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    title: Success
                    description: Indicates operation success
                    example: false
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Internal server error
                  debugInfo:
                    type: string
                    title: Debug Info
                    description: Optional debug information
                    example: Stack trace or additional error details
                required:
                  - success
                  - message
                title: Internal Server Error Response
                description: Schema for internal server error response
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````