curl --request POST \
--url https://api.pomerado.ai/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"media_type": "<string>",
"size": 1
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', media_type: '<string>', size: 1})
};
fetch('https://api.pomerado.ai/v1/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pomerado.ai/v1/files"
payload = {
"name": "<string>",
"media_type": "<string>",
"size": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "file_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190",
"name": "<string>",
"media_type": "<string>",
"size": 123,
"sha256": "<string>",
"status": "awaiting_upload",
"direction": "input",
"job_id": "job_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190",
"created_at": "<string>",
"expires_at": "<string>",
"upload_url": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}Upload a file
Start an upload for a run’s file input: answers the file’s ID and a one-time upload_url. PUT the bytes there (at most 25 MiB unless the deployment says otherwise; executables are refused and the first bytes must match media_type), then pass the ID as the file field’s value in a run’s input. A file serves one run, is erased when that run’s job ends, and is erased after an hour if unused. A run’s file field also takes an https URL or a data: URI of at most 512 KB instead.
curl --request POST \
--url https://api.pomerado.ai/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"media_type": "<string>",
"size": 1
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', media_type: '<string>', size: 1})
};
fetch('https://api.pomerado.ai/v1/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pomerado.ai/v1/files"
payload = {
"name": "<string>",
"media_type": "<string>",
"size": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "file_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190",
"name": "<string>",
"media_type": "<string>",
"size": 123,
"sha256": "<string>",
"status": "awaiting_upload",
"direction": "input",
"job_id": "job_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190",
"created_at": "<string>",
"expires_at": "<string>",
"upload_url": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}Authorization: Bearer <token> with Dashboard session, Pomerado MCP OAuth token, API key, integration API key.
Permission: runs:create.
Effect: Write: creates or changes something in your account.
Errors: invalid_request (400), sign_in_required (401), unauthorized (401), reauthentication_required (401), forbidden (403), file_too_large (413), request_too_large (413), file_type_refused (415), internal_error (500), not_configured (501), temporarily_unavailable (503). Every error has the same envelope.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The file's name, as the website will see it, for example receipt.pdf
1 - 255The file's media type, for example application/pdf; its first bytes must match it
1 - 255The file's size in bytes; when given, the upload's Content-Length must equal it
x >= 0Response
The new file, awaiting its upload
a file ID: file_ and 32 lowercase hex digits
"file_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190"
The file's name, as given
The file's media type, as checked
Bytes: the size given at creation until the upload arrives, then the size received; null when none was given
The SHA-256 of the bytes, lowercase hex, once they arrived
awaiting_upload until its bytes arrive at upload_url, ready to pass to a run, in_use once a run took it
awaiting_upload, ready, in_use input for a file sent to a run, output for one a run collected
input, output The run's job the file is bound to: an input in use, and every output
"job_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190"
a string to be decoded into a Date
When the file is erased unless used first; null for an input in use, which is erased when its job ends
PUT the file's bytes here once, with its Content-Type and Content-Length and no Authorization header, for example curl -T receipt.pdf -H 'Content-Type: application/pdf' <upload_url>. Valid until expires_at.