---
title: "Import a LoRA weights file from a link"
method: POST
path: "/api/v1/files/import"
tags: ["Media"]
---

# Import a LoRA weights file from a link

`POST /api/v1/files/import`

## Request

- Base URL: `https://api.popnow.ai`
- URL: `https://api.popnow.ai/api/v1/files/import`
- Auth: HTTP bearer

Downloads a `.safetensors` LoRA file once and stores it as your upload, so a
file that needs a sign-in can still be used without making it public. `url`
accepts a Hugging Face repo id (`owner/repo`, when the repo has exactly one
`.safetensors` file), a Hugging Face repo or file page, or any direct https
link. `token` is optional: a Hugging Face access token, or a Civitai API key,
used only for this download and never stored. The response matches the
commit endpoint; put its popnow:// URI in `loras[].path`. Imported files are
kept for the same time as other uploads. Public links can also be passed to
`loras[].path` directly, without importing.

## Request body

- LoraImportRequest
  - `url` string, required: Hugging Face repo id (owner/repo), a Hugging Face repo or file page, or a direct https link to a .safetensors file.
  - `token` string: Optional Hugging Face access token or Civitai API key, used only for this download and never stored.

## Response `200`

Ready tenant-scoped file reference.

- FileCommitEnvelope
  - `code` 200, required
  - `msg` 'success', required
  - `request_id` string, required: Correlation identifier. Include it in support requests.
  - `data` FileCommitResponse, required
    - `fileId` string, required
    - `status` 'ready', required
    - `bytes` integer, required
    - `contentType` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif' | 'video/mp4' | 'video/webm' | 'audio/mpeg' | 'audio/wav' | 'application/pdf' | 'application/msword' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' | 'application/vnd.ms-excel' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'application/vnd.ms-powerpoint' | 'application/vnd.openxmlformats-officedocument.presentationml.presentation' | 'application/vnd.apple.keynote' | 'application/vnd.apple.pages' | 'application/vnd.apple.numbers' | 'text/plain' | 'text/markdown', required
    - `sha256` string, required
    - `uri` string, required
    - `expiresAt` string, date-time, required
    - `durationSeconds` string: Measured audio/video duration in seconds.
    - `width` integer
    - `height` integer

## Other responses

- `400`: Invalid JSON, query, callback URL, model input, or media declaration. Invalid callBackUrl values return code 400 and msg "Invalid callback URL" with request_id. Submitted hosts, IP addresses, and DNS diagnostics are not echoed.
- `401`: Missing, malformed, expired, revoked, or otherwise invalid API key.
- `403`: Account, model, API-key, IP, or region authorization failed.
- `429`: Account-level request limit exceeded.
- `500`: Internal failure. Details are not exposed; report `request_id` to support.
- `503`: HTTP 503 carries one of three business codes. `50301`: no usable deployment or effective customer price exists for the selected model. `503`: a dependency is temporarily unavailable; retry after the `Retry-After` header when it is present. `50302`: a synchronous generation failed upstream and the charge was refunded. Nothing was charged, but send the retry with a **new** `Idempotency-Key`: reusing the original one replays the recorded failure instead of generating again.

---

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