---
title: "Create an image upload link"
url: https://docs.gleap.ai/en/reference/rest-api/create-upload-link
method: POST
path: "/uploads/links"
api: "API Reference"
tag: "Uploads"
operationId: "CreateUploadLink"
updatedAt: "2026-11-01T18:40:15.677Z"
language: en
---

# Create an image upload link

`POST https://api.gleap.io/v3/uploads/links`

Create a single-use link that accepts one image upload into this project, for tools that can run `curl` but hold no Gleap credentials (e.g. an AI agent connected through the Gleap MCP server). The link expires after 15 minutes and works once:

`curl -sS -F "file=@cover.png" "<uploadUrl>"`

Accepts PNG, JPEG, GIF and WebP up to 20 MB (judged by the file's bytes, not its name). The response carries the image's permanent public `fileUrl`.

## Authorization

- `Authorization` (header, required): `Bearer <token>`

## Headers

- `project` (string, required)

## Example request

```bash
curl --request POST \
  --url https://api.gleap.io/v3/uploads/links \
  --header 'Authorization: Bearer <token>' \
  --header 'project: <project>'
```

## Responses

### 200 (`application/json`)

Ok

- `uploadUrl` (string, required): POST one image here as multipart/form-data, field `file`. No auth header needed.
- `expiresAt` (string, required): ISO timestamp after which the link no longer works.
- `maxBytes` (number<double>, required)
- `allowedTypes` (string[], required)

```json
{
  "uploadUrl": "string",
  "expiresAt": "string",
  "maxBytes": 0,
  "allowedTypes": [
    "string"
  ]
}
```
