Skip to main content
POST
/
files
Upload file
const form = new FormData();
form.append('file', '<string>');
form.append('purpose', '<string>');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

fetch('https://api.phaseo.app/v1/files', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "<string>",
  "object": "<string>",
  "bytes": 123,
  "created_at": 123,
  "filename": "<string>",
  "purpose": "<string>",
  "status": "<string>",
  "status_details": {}
}
Save the returned file_id and reuse it with:
The public files routes are currently mounted but temporarily disabled, so requests currently return 501 not_implemented.
  • POST /v1/batches
  • GET /v1/files/{file_id}
  • GET /v1/files/{file_id}/content
GET /v1/files is not currently supported on the shared gateway key, so the upload response is the canonical place to capture the file id.

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

multipart/form-data
file
file
required
purpose
string
required

Response

Uploaded file metadata

id
string
object
string
bytes
integer
created_at
integer
filename
string
purpose
string
status
string
status_details
object
Last modified on May 19, 2026