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

# Import asset

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Downloads a file from a public URL and stores a copy in the app's media library, so you don't have to download and upload it yourself. To add a file by URL without copying it, use [Create asset](/api-reference/create-asset).

The file name, from `file_name` or else the end of the URL's path, decides what's accepted, the same as [Upload asset](/api-reference/upload-asset), except that `svg`, `glb` and `fbx` files can't be imported: upload them instead. The copy is stored at a public URL, returned in `file_url`.

To retry safely, send an `Idempotency-Key` header. A retry with the same key and body within 24 hours returns the asset the first request added instead of importing the file again.

In this response, `created_date` and `updated_date` include a `+00:00` offset. [List assets](/api-reference/list-assets) returns them without one.

This endpoint is limited to 60 requests per minute, shared with Upload asset. Some workspaces have a different limit.

<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app, or a workspace API key, which acts as the workspace owner. A read-only key is refused.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time. Send only the fields documented here. Other request fields are not supported and their behavior can change.</Warning>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/assets/import
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/assets/import:
    post:
      summary: Import asset
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Downloads a file from a public URL and stores a copy in the app's media
        library, so you don't have to download and upload it yourself. To add a
        file by URL without copying it, use [Create
        asset](/api-reference/create-asset).


        The file name, from `file_name` or else the end of the URL's path,
        decides what's accepted, the same as [Upload
        asset](/api-reference/upload-asset), except that `svg`, `glb` and `fbx`
        files can't be imported: upload them instead. The copy is stored at a
        public URL, returned in `file_url`.


        To retry safely, send an `Idempotency-Key` header. A retry with the same
        key and body within 24 hours returns the asset the first request added
        instead of importing the file again.


        In this response, `created_date` and `updated_date` include a `+00:00`
        offset. [List assets](/api-reference/list-assets) returns them without
        one.


        This endpoint is limited to 60 requests per minute, shared with Upload
        asset. Some workspaces have a different limit.


        <Note>This endpoint accepts a personal API key belonging to a user with
        editor access to the app, or a workspace API key, which acts as the
        workspace owner. A read-only key is refused.</Note>


        <Warning>The response includes fields beyond the ones documented here.
        Don't rely on undocumented response fields, as they can change at any
        time. Send only the fields documented here. Other request fields are not
        supported and their behavior can change.</Warning>
      operationId: import_asset_api_apps__app_id__assets_import_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app whose media library to change.
            title: App Id
          description: ID of the app whose media library to change.
          example: 6820f3a4e7b91d003c45a1f2
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 128
            description: >-
              One key per import. A retry with the same key and body within 24
              hours returns the first asset.
            examples:
              - import-shoe-red-7f3c9a
            title: Idempotency-Key
          description: >-
            One key per import. A retry with the same key and body within 24
            hours returns the first asset.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportAssetRequest'
            example:
              url: https://cdn.acme.com/catalog/shoe-red.jpg
              file_name: shoe-red.jpg
      responses:
        '200':
          description: The new asset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetSummary'
              example:
                id: 68b0e1f2a3c4d5e6f7a8b9c0
                app_id: 6820f3a4e7b91d003c45a1f2
                file_name: shoe-red.jpg
                file_url: >-
                  https://media.base44.com/images/public/6820f3a4e7b91d003c45a1f2/a1b2c3d4e_shoe-red.jpg
                source_type: upload
                file_type: jpg
                created_date: '2026-01-15T09:23:41+00:00'
                updated_date: '2026-01-15T09:23:41+00:00'
        '400':
          description: >-
            `invalid_url`: `url` isn't an `https` URL, or points to an address
            that isn't allowed. `unsupported_file_type`: The file name has no
            supported extension, or the type can't be imported.
            `file_too_large`: The file is over the size limit for its type.
          content:
            application/json:
              examples:
                invalid_url:
                  summary: invalid_url
                  value:
                    error:
                      code: invalid_url
                      message: url must be a public https URL
                      details: {}
                unsupported_file_type:
                  summary: unsupported_file_type
                  value:
                    error:
                      code: unsupported_file_type
                      message: svg files can't be imported. Upload them instead.
                      details: {}
                file_too_large:
                  summary: file_too_large
                  value:
                    error:
                      code: file_too_large
                      message: The file is over the 40 MB limit for jpg files
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '401':
          description: >-
            `unauthenticated`: Missing or invalid credentials, or credentials
            sent as an `api_key` query parameter.
          content:
            application/json:
              examples:
                unauthenticated:
                  summary: unauthenticated
                  value:
                    error:
                      code: unauthenticated
                      message: 'Use Authorization: Bearer credentials.'
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '403':
          description: >-
            `forbidden`: You don't have editor access to this app, the app is
            blocked, or your API key is read-only.
          content:
            application/json:
              examples:
                forbidden:
                  summary: forbidden
                  value:
                    error:
                      code: forbidden
                      message: You do not have admin access to this app
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '404':
          description: '`not_found`: The app doesn''t exist.'
          content:
            application/json:
              examples:
                not_found:
                  summary: not_found
                  value:
                    error:
                      code: not_found
                      message: App not found
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '409':
          description: >-
            `import_in_progress`: A request with this `Idempotency-Key` is still
            importing. Retry the same request shortly.
          content:
            application/json:
              examples:
                import_in_progress:
                  summary: import_in_progress
                  value:
                    error:
                      code: import_in_progress
                      message: >-
                        This import is still running. Try again in a few
                        seconds.
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '422':
          description: >-
            `invalid_request`: The body is missing, or `url` isn't a string.
            `file_unavailable`: The URL didn't return a file, for example
            because it needs a login or the file doesn't exist.
            `idempotency_key_reused`: The `Idempotency-Key` was already used
            with a different body.
          content:
            application/json:
              examples:
                invalid_request:
                  summary: invalid_request
                  value:
                    error:
                      code: invalid_request
                      message: Invalid request
                      details: {}
                file_unavailable:
                  summary: file_unavailable
                  value:
                    error:
                      code: file_unavailable
                      message: Couldn't download the file at url
                      details: {}
                idempotency_key_reused:
                  summary: idempotency_key_reused
                  value:
                    error:
                      code: idempotency_key_reused
                      message: >-
                        This Idempotency-Key was already used with a different
                        body.
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '429':
          description: >-
            `rate_limited`: Rate limit exceeded. The base limit is 60 requests
            per minute. See [Rate
            limits](/developers/references/apps-api/get-started/rate-limits) for
            the multiplier your plan gets.
          content:
            application/json:
              examples:
                rate_limited:
                  summary: rate_limited
                  value:
                    error:
                      code: rate_limited
                      message: Rate limit exceeded
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '503':
          description: >-
            Database temporarily unavailable (`database_unavailable`): the data
            cluster did not answer in time. Retry after the `Retry-After`
            seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
              examples:
                database_unavailable:
                  summary: database_unavailable
                  value:
                    error:
                      code: database_unavailable
                      message: Database temporarily unavailable, please retry
                      details: {}
      security:
        - PersonalAccessTokenAuth:
            - full_access
        - WorkspaceApiKeyAuth:
            - full_access
        - WorkspaceApiKeyBearerAuth:
            - full_access
components:
  schemas:
    ImportAssetRequest:
      properties:
        url:
          type: string
          title: Url
          description: >-
            Public `https` URL of the file. Base44 downloads it once and stores
            a copy. Addresses on private networks and Base44's own hosts, other
            than its media CDN, are refused.
          example: https://cdn.acme.com/catalog/shoe-red.jpg
        file_name:
          anyOf:
            - type: string
            - type: 'null'
          title: File Name
          description: >-
            Name of the file, with its extension. Defaults to the end of the
            URL's path. Characters other than letters, digits, `_`, `.` and `-`
            become `_`, anything up to the last `/` is dropped, and an empty
            name becomes `untitled`.
          example: shoe-red.jpg
      type: object
      required:
        - url
      title: ImportAssetRequest
    AssetSummary:
      properties:
        id:
          type: string
          title: Id
          description: ID of the asset.
          example: 68b0e1f2a3c4d5e6f7a8b9c0
        app_id:
          type: string
          title: App Id
          description: ID of the app the asset belongs to.
          example: 6820f3a4e7b91d003c45a1f2
        file_name:
          type: string
          title: File Name
          description: Name of the file.
          example: Logo-dark.png
        file_url:
          type: string
          title: File Url
          description: URL of the file.
          example: >-
            https://media.base44.com/files/public/6820f3a4e7b91d003c45a1f2/Logo-dark.png
        source_type:
          type: string
          enum:
            - upload
            - generated
          title: Source Type
          description: >-
            How the file got into the library. `upload` for a file someone
            uploaded, and `generated` for most files Base44 created for the app,
            such as AI-generated images and videos or a Figma import.
          example: upload
        file_type:
          anyOf:
            - type: string
            - type: 'null'
          title: File Type
          description: >-
            File extension without the dot, usually lowercase, such as `png` or
            `mp4`. The value is `null` when the file was added without one.
          example: png
        created_date:
          type: string
          title: Created Date
          description: >-
            When the asset was added to the library, as a UTC timestamp in ISO
            8601 format.
          example: '2026-01-15T09:23:41'
        updated_date:
          type: string
          title: Updated Date
          description: >-
            When the asset was last changed, such as renamed, as a UTC timestamp
            in ISO 8601 format.
          example: '2026-01-15T09:31:07'
      type: object
      required:
        - id
        - app_id
        - file_name
        - file_url
        - source_type
        - file_type
        - created_date
        - updated_date
      title: AssetSummary
      description: A file in the app's media library.
    StandardErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/StandardError'
          description: What went wrong.
      type: object
      required:
        - error
      title: StandardErrorEnvelope
      description: The error body returned in the standard envelope.
    StandardError:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Stable machine-readable cause of the failure. Match on this, not on
            `message`.
          example: not_found
        message:
          type: string
          title: Message
          description: Human-readable explanation. It isn't a stable contract.
          example: App not found
        details:
          additionalProperties: true
          type: object
          title: Details
          description: >-
            Structured context for the failure, or an empty object when there's
            none.
          example: {}
      type: object
      required:
        - code
        - message
      title: StandardError
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: >-
        Personal access token, sent as `Authorization: Bearer <token>`. Each
        operation lists the permission it needs: `read_only` or `full_access`. A
        full-access token can call every operation. A read-only token can call
        only the operations that list `read_only`; anything else returns 403
        `read_only_credential_route_not_allowed`.
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: >-
        Workspace API key, sent as `api_key: <key>`. Each operation that accepts
        one lists what the key needs: a permission, `read_only` or
        `full_access`, like a personal access token, or a scope. A key without
        the scope gets 403 `workspace_api_key_scope_required`.
    WorkspaceApiKeyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key, sent as `Authorization: Bearer <key>`. Accepted
        wherever `api_key` is, with the same permission.

````

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