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

# Update Asset

> Updates an asset in the Assets Library.



## OpenAPI

````yaml openapi-assets-api.json PUT /components/v1/asset/{name}
openapi: 3.0.3
info:
  title: Assets API
  version: 1.0.0
servers:
  - url: https://api-sandbox.appcharge.com
security:
  - PublisherTokenAuth: []
tags:
  - name: Assets
paths:
  /components/v1/asset/{name}:
    parameters:
      - in: path
        name: name
        required: true
        schema:
          type: string
          example: gold_coins_icon
        description: Asset name.
    put:
      tags:
        - Assets
      description: Updates an asset in the Assets Library.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AssetUpdate'
          application/json:
            schema:
              $ref: '#/components/schemas/AssetUpdate'
      responses:
        '200':
          description: Asset updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetResponse'
        '400':
          description: Bad request. Invalid input or validation failure.
        '404':
          description: Asset not found.
components:
  schemas:
    AssetUpdate:
      type: object
      properties:
        type:
          type: string
          description: Asset category.
          enum:
            - product
            - badge
            - bgMobile
            - bgDesk
            - logo
            - favicon
            - bgBundle
            - bgPopup
            - general
            - section
            - productPrefix
            - playerLevel
            - banner
            - addToHomeButtonImage
            - addToHomeIconImage
            - playerProfileImage
            - offerHeader
            - backToGameButtonImage
            - animation
            - trait
          example: bgMobile
        name:
          type: string
          description: Asset name.
          example: main_menu_background
        file:
          type: string
          format: binary
          description: A valid PNG or JPEG image file. Maximum size is 2 MB.
          example: gold_coins_icon.png
        externalImageUrl:
          type: string
          format: url
          description: >-
            URL to a valid, publicly accessible image. Appcharge saves and uses
            this URL as-is and doesn't download, copy, upload, or host the image
            on Appcharge CDN. The image must remain available at the provided
            URL.


            We recommend uploading image files instead of using external URLs
            when possible. Appcharge hosts uploaded files on its CDN. Maximum
            size is 2 MB. Must be in PNG or JPEG format.
          example: https://example.com/assets/main_menu_background_updated.png
    AssetResponse:
      type: object
      properties:
        id:
          type: string
          description: Asset ID.
          example: 507f1f77bcf86cd799439011
        name:
          type: string
          description: Asset name.
          example: gold_coins_icon
        type:
          type: string
          description: Asset category.
          enum:
            - product
            - badge
            - bgMobile
            - bgDesk
            - logo
            - favicon
            - bgBundle
            - bgPopup
            - general
            - section
            - productPrefix
            - playerLevel
            - banner
            - addToHomeButtonImage
            - addToHomeIconImage
            - playerProfileImage
            - offerHeader
            - backToGameButtonImage
            - animation
            - trait
          example: product
        imageUrl:
          type: string
          format: url
          description: >-
            Image URL. For uploaded files, this is the Appcharge-hosted CDN URL.
            For external image URLs, this is the original image URL served from
            your CDN at the provided URL.
          example: https://media.appcharge.com/media/691d8c9f127412f152236889baf5
        contentType:
          type: string
          description: >-
            Image [MIME
            type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types).
          example: image/png
        externalImageUrl:
          type: string
          format: url
          description: >-
            Original image URL if the asset uses an external image URL. This URL
            is served from your CDN at the provided URL.
          example: https://example.com/assets/gold_coins_icon.png
  securitySchemes:
    PublisherTokenAuth:
      type: apiKey
      in: header
      name: x-publisher-token
      description: Publisher token, as displayed in the Publisher Dashboard.

````