---
title: "Import file from URL"
method: POST
path: "/api/repos/{namespace}/{repo_name}/import/{resource}"
tags: ["Import"]
---

# Import file from URL

`POST /api/repos/{namespace}/{repo_name}/import/{resource}`

## Request

- Base URL: `https://hub.oxen.ai`
- URL: `https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/import/{resource}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/oxen/apis/oxen-server/docs/api/repos/:namespace/:repo_name/import/:resource/post.ts> (a function with typed inputs; its response is checked against the schema)

Import a file from a remote URL and commit it to the repository.

## Path parameters

- `namespace` string, required
- `repo_name` string, required
- `resource` string, required

## Request body

- ImportFileBody: Body for importing a file from a URL
  - `auth` string, nullable
  - `download_url` string, required
  - `email` string, nullable
  - `filename` string, nullable
  - `message` string, nullable
  - `name` string, nullable

## Response `200`

File imported and committed

- CommitResponse
  - `oxen_version` string, nullable
  - `status` string, required
  - `status_message` string, required
  - `commit` Commit, required
    - `author` string, required
    - `email` string, required
    - `id` string, required
    - `message` string, required
    - `parent_ids` string[], required
    - `timestamp` string, date-time, required

## Other responses

- `400`: Bad Request / Invalid URL

---

[API](https://skmtc.dev/oxen/apis/oxen-server.md) - [All operations](https://skmtc.dev/oxen/apis/oxen-server/llms.txt) - [OpenAPI document](https://skmtc.dev/oxen/apis/oxen-server/revisions/2ae578129949?raw)
