---
title: "Create a download URL"
method: POST
path: "/v1/files/{file_id}/url"
tags: ["Files"]
---

# Create a download URL

`POST /v1/files/{file_id}/url`

## Request

- Base URL: `https://api.dexto.ai`
- URL: `https://api.dexto.ai/v1/files/{file_id}/url`
- Auth: HTTP bearer

A URL anyone can download the file from, without an API key, until it expires (an hour by default, at most a day). Overwriting or deleting the file ends it.

## Path parameters

- `file_id` string, required

## Request body

- object
  - `expires_in` integer: Seconds until the URL stops working; at most 86400.

## Response `200`

Successful response.

- object
  - `expires_at` string, date-time, required
  - `object` 'file.url', required
  - `url` string, uri, required

## Other responses

- `400`: Invalid JSON or request fields.
- `401`: Missing or invalid API key.
- `402`: The account has insufficient credits.
- `403`: The account cannot perform this operation.
- `404`: The requested resource was not found.
- `409`: The request conflicts with existing resource state.
- `429`: The account exceeded this operation's request rate.
- `500`: Unexpected Dexto failure.
- `502`: The upstream model provider failed.
- `503`: A required Dexto service is temporarily unavailable.

---

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