---
title: "Upload file"
method: POST
path: "/files"
tags: ["files"]
---

# Upload file

`POST /files`

Upload a JSONL file for batch processing.

Each line must be a valid JSON object containing `custom_id`, `method`, `url`, and `body` fields. The `model` field in the body must reference a model your API key has access to.

## Response `201`

File uploaded and validated successfully.

- FileResponse — File object response (OpenAI-compatible)
  - `bytes` integer, required
  - `context_name` string, nullable — Context name: "Personal" for individual files, or the organization name
  - `context_type` string, nullable — Context type: "personal" or "organization"
  - `created_at` integer, required
  - `created_by_email` string, nullable — Email of the individual who created this file (resolved from api_key attribution)
  - `expires_at` integer, nullable
  - `filename` string, required
  - `id` string, required
  - `object` 'file', required — Object type - always "file"
  - `purpose` 'batch' | 'batch_output' | 'batch_error', required — Purpose for file
  - `source` string, nullable — Source: "sync" if ingested from an external connection, absent for uploaded files
  - `source_name` string, nullable — Name of the source connection (e.g. "prod-s3-inputs")

## Other responses

- `400` — Invalid file format, malformed JSON, missing required fields, etc.
- `403` — Model referenced in the file is not configured or not accessible to your account.
- `413` — File exceeds the maximum allowed size.
- `422` — A referenced image URL could not be retrieved because its origin refused access (e.g. 403/404). The file is well-formed but references an image that is forbidden, gated, or missing.
- `429` — Too many concurrent uploads. Retry after a short delay.
- `500` — An unexpected error occurred. Retry the request or contact support if the issue persists.
- `503` — A referenced image could not be fetched due to a transient upstream/store error, or the service is briefly overloaded. Retry after a short delay.

---

[API](https://skmtc.dev/doubleword/apis/doubleword-api.md) · [All operations](https://skmtc.dev/doubleword/apis/doubleword-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/doubleword/doubleword-api/revisions/6617202865d8/schema)
