---
title: "Write one file into a draft"
method: PUT
path: "/v1/skill-drafts/{draft_id}/files"
tags: ["skill-drafts"]
---

# Write one file into a draft

`PUT /v1/skill-drafts/{draft_id}/files`

## Request

- Base URL: `https://api.patricia.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.patricia.app/v1/skill-drafts/{draft_id}/files`
- Auth: HTTP bearer

Create or replace ONE file by its bundle-relative path — this is the route that makes editing a skill cost one file instead of a whole re-upload. Returns the draft's file list. The same per-file and per-skill size caps a published skill obeys apply here, so a draft can never grow into something publishing would refuse.

## Path parameters

- `draft_id` string, uuid, required

## Headers

- `X-Tenant-Id` string, nullable

## Request body

- PutDraftFileRequest: Write one file into a draft, addressed by its bundle-relative path.
  - `path` string, required: The bundle-relative path, e.g. 'references/api.md'.
  - `kind` string, required: skill_md · reference · script · asset.
  - `content` string, required: The file's text.

## Response `200`

Successful Response

- DraftFileSummary[]
  - `path` string, required
  - `kind` string, required
  - `size_bytes` integer, required
  - `sha256` string, required

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden. Inspect response body `code` for the specific reason (for example: PERMISSION_DENIED, EMAIL_NOT_VERIFIED, TENANT_ACCESS_REQUIRED, ROLE_UNRESOLVED)
- `404`: Not found
- `409`: Conflict
- `422`: Validation error

---

[API](https://skmtc.dev/patricia/apis/patricia-api.md) · [All operations](https://skmtc.dev/patricia/apis/patricia-api/llms.txt) · [OpenAPI document](https://skmtc.dev/patricia/apis/patricia-api/revisions/0dfb44495ea1?raw)
