---
title: "Upload a file"
method: POST
path: "/public/files/upload"
tags: ["Files"]
---

# Upload a file

`POST /public/files/upload`

## Request

- Base URL: `https://api.johnsessentials.com/api/v1`
- URL: `https://api.johnsessentials.com/api/v1/public/files/upload`
- Auth: HTTP bearer

## Headers

- `Idempotency-Key` string

## Response `200`

File registered.

- object
  - `data` object: Handler payload on success; null on error.
    - `created_at` string, date-time, required
    - `id` string, required
    - `mime_type` string
    - `name` string, required
    - `size` integer, required
  - `error` ErrorBody: Additional fields per code (validation errors, retry_after, hints) appear at this level. additionalProperties: true is intentional.
    - `code` 'auth_missing_header' | 'auth_malformed_header' | 'auth_invalid_key' | 'auth_expired_key' | 'auth_inactive_key' | 'auth_scope_missing' | 'quota_calls_exceeded' | 'quota_cost_exceeded' | 'quota_storage_exceeded' | 'quota_agent_runs_exceeded' | 'credit_exhausted' | 'tool_not_found' | 'tool_input_invalid' | 'tool_file_too_large' | 'tool_file_not_found' | 'tool_unsupported' | 'tool_timeout' | 'tool_internal' | 'idempotency_key_in_use' | 'agent_max_iterations' | 'agent_unauthorized_tool' | 'agent_invalid_plan' | 'workflow_not_found' | 'workflow_invalid' | 'bad_request' | 'forbidden' | 'not_found' | 'conflict' | 'internal_error' | 'service_unavailable', required: Stable canonical code from the taxonomy. Branch on this, not on `message`. Full list at /api/errors.
    - `doc_url` string, uri, required
    - `message` string, required
    - `request_id` string, uuid
  - `meta` EnvelopeMeta, required
    - `rate_limit` object
      - `limit` integer
      - `remaining` integer
      - `reset` integer: Unix seconds
    - `timestamp` string, date-time, required
    - `version` string, required
  - `request_id` string, uuid, required
  - `success` boolean, required

## Other responses

- `413`: Uploaded file exceeds the per-tier size limit.

---

[API](https://skmtc.dev/johnsessentials/apis/john-s-essentials-api.md) · [All operations](https://skmtc.dev/johnsessentials/apis/john-s-essentials-api/llms.txt) · [OpenAPI document](https://skmtc.dev/johnsessentials/apis/john-s-essentials-api/revisions/56586ff78e6d?raw)
