> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.athenaintel.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.athenaintel.com/_mcp/server.

# Create a one-time link to upload a file

POST https://api.athenaintel.com/api/v0/assets/upload-links
Content-Type: application/json

Mint a one-time link that takes one file without an API key, for a caller that can run a shell command but holds no key, such as an agent connected through an Athena MCP server. The file's name decides what it becomes, as with POST /api/v0/assets/create-from-file: a .md, .markdown, .txt or .text file an Athena document, a .html or .htm file a user interface, a .docx file a Word document and a .pptx, .potx, .ppt or .pps file a presentation. The gates of create-from-file run now (membership in the workspace, EDIT on parent_folder_id, the deployment's offering, an agent run's tool policy) and again when the file arrives. Send the file's bytes as the body of one PUT to upload_url with the X-Athena-Upload-Token header (the curl field is that command); its answer is the new asset. A link works once, for 15 minutes.

Reference: https://docs.athenaintel.com/api-reference/assets/create-upload-link

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Body (application/json)

This endpoint expects a CreateUploadLinkRequestIn.

- `file_name` (string, required) — The name of the file you will send, which decides what it becomes, as in POST /api/v0/assets/create-from-file: a .md, .markdown, .txt or .text file an Athena document, a .html or .htm file a user interface, a .docx file a Word document and a .pptx, .potx, .ppt or .pps file a presentation
- `parent_folder_id` (string, optional, nullable) — Folder to put the new asset in; you need EDIT on it
- `title` (string, optional, nullable) — Title for the new asset; defaults to the file's name
- `workspace_id` (string, optional, nullable) — Workspace to create the asset in; defaults to parent_folder_id's, else your current one

## Response

### 200

The link, its header and a curl command

- `asset_type` (string, required) — What the file becomes
- `curl` (string, required) — A curl command that sends the file, every argument shell-quoted; replace the path placeholder with your file's path. It prints the new asset as JSON
- `expires_at` (string, required) — When the link stops working (UTC)
- `file_name` (string, required) — The file the link takes
- `headers` (map from string to string, required) — Headers the upload must carry: X-Athena-Upload-Token, the link's one-time credential. It works once, until expires_at
- `link_id` (string, required) — ID of the link
- `max_bytes` (integer, required) — The largest file the link takes
- `upload_url` (string, required) — Where to send the file: one PUT, its body the file's bytes
- `method` ("PUT", optional, default: PUT) — The HTTP method the upload uses

## Errors

### 403 Forbidden Error

Not a member of the workspace, cannot edit parent_folder_id, the deployment does not offer the asset type, or an agent run's tool policy refuses it

- `map from string to any`

### 404 Not Found Error

parent_folder_id not found

- `map from string to any`

### 422 Unprocessable Entity Error

The file name is not a .md, .markdown, .txt, .text, .html, .htm, .docx, .pptx, .potx, .ppt or .pps

- `map from string to any`

### 503 Service Unavailable Error

This deployment cannot mint upload links

- `map from string to any`

## Examples

**Request**

```json
{
  "file_name": "notes.md",
  "parent_folder_id": "asset_folder_12345",
  "title": "Quarterly notes"
}
```

**Response**

```json
{
  "asset_type": "document",
  "curl": "curl -sS -T '<path to notes.md>' -H 'X-Athena-Upload-Token: athupl_<one-time token>' https://api.athenaintel.com/api/v0/assets/upload-links/4f1c2d3e0a9b4c8d9e7f6a5b4c3d2e1f",
  "expires_at": "2026-11-08T21:15:00+00:00",
  "file_name": "notes.md",
  "headers": {
    "X-Athena-Upload-Token": "athupl_<one-time token>"
  },
  "link_id": "4f1c2d3e0a9b4c8d9e7f6a5b4c3d2e1f",
  "max_bytes": 2097152,
  "upload_url": "https://api.athenaintel.com/api/v0/assets/upload-links/4f1c2d3e0a9b4c8d9e7f6a5b4c3d2e1f",
  "method": "PUT"
}
```

**SDK Code**

```python
import requests

url = "https://api.athenaintel.com/api/v0/assets/upload-links"

payload = {
    "file_name": "notes.md",
    "parent_folder_id": "asset_folder_12345",
    "title": "Quarterly notes"
}
headers = {
    "X-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.athenaintel.com/api/v0/assets/upload-links';
const options = {
  method: 'POST',
  headers: {'X-API-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"file_name":"notes.md","parent_folder_id":"asset_folder_12345","title":"Quarterly notes"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.athenaintel.com/api/v0/assets/upload-links"

	payload := strings.NewReader("{\n  \"file_name\": \"notes.md\",\n  \"parent_folder_id\": \"asset_folder_12345\",\n  \"title\": \"Quarterly notes\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.athenaintel.com/api/v0/assets/upload-links")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"file_name\": \"notes.md\",\n  \"parent_folder_id\": \"asset_folder_12345\",\n  \"title\": \"Quarterly notes\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.athenaintel.com/api/v0/assets/upload-links")
  .header("X-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"file_name\": \"notes.md\",\n  \"parent_folder_id\": \"asset_folder_12345\",\n  \"title\": \"Quarterly notes\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.athenaintel.com/api/v0/assets/upload-links', [
  'body' => '{
  "file_name": "notes.md",
  "parent_folder_id": "asset_folder_12345",
  "title": "Quarterly notes"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.athenaintel.com/api/v0/assets/upload-links");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"file_name\": \"notes.md\",\n  \"parent_folder_id\": \"asset_folder_12345\",\n  \"title\": \"Quarterly notes\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "file_name": "notes.md",
  "parent_folder_id": "asset_folder_12345",
  "title": "Quarterly notes"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.athenaintel.com/api/v0/assets/upload-links")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```