---
title: "Import asset from URL"
method: POST
path: "/v1/assets/import"
tags: ["Assets and Media Delivery"]
---

# Import asset from URL

`POST /v1/assets/import`

## Request

- Base URL: `https://getsocialclaw.com`
- URL: `https://getsocialclaw.com/v1/assets/import`
- Auth: HTTP bearer

Downloads an image or video from a public URL into the media library. Returns 201 with a ready asset when the import finishes within about 40 seconds, otherwise 202 with status uploading while it continues in the background.

Note: On 202, poll GET /v1/assets/{assetId} until status is ready before using publicUrl as media_link. A failed import reports status failed with an error message.

Note: Files up to 1 GB. The URL must be a direct link to the file, not a web page.

## Request body

- AssetImportRequest: Imports media from a public URL. The server streams the file straight into storage.
  - `sourceUrl` string, required: Direct public http(s) URL of the image or video file.
  - `filename` string, nullable: Optional file name with extension. Inferred from the URL or Content-Type when omitted.

## Response `201`

Successful response.

- AssetResponse: Single asset response.
  - `ok` unknown, required
  - `asset` Asset, required: SocialClaw-managed media asset.
    - `id` string, required: Asset id.
    - `tenantId` string, nullable: Workspace id.
    - `storage` string, nullable: Storage driver.
    - `objectKey` string, nullable: Internal object key.
    - `originalFilename` string, nullable: Original file name.
    - `mime` string, required: MIME type.
    - `kind` 'image' | 'video' | 'audio' | 'other', required
    - `size` integer: Size in bytes.
    - `status` string, nullable: ready, uploading, draft, pending_delete, or provider-specific state.
    - `publicUrl` string, uri, nullable: Public delivery URL.
    - `preview` object, nullable: Thumbnail, poster, or preview URLs.
    - `createdAt` string, date-time, nullable: Creation time.

## Other responses

- `400`: Invalid request.
- `401`: Missing, invalid, or unauthorized credentials.
- `404`: Requested resource was not found.
- `422`: Request body or semantic validation failed.

---

[API](https://skmtc.dev/getsocialclaw/apis/socialclaw-api.md) · [All operations](https://skmtc.dev/getsocialclaw/apis/socialclaw-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getsocialclaw/apis/socialclaw-api/revisions/a11a6a5b9bc6?raw)
