---
search:
  tags:
    - Sandboxes
    - PUT
seo:
  description: >-
    Writes one or several files in one call. A retry with the same
    Idempotency-Key gets… Reference for the PUT /v1/sandboxes/{id}/files
    endpoint in the Ibby API.
sidebar:
  label: Write files
  badge: PUT
title: Write files
type: openapi-operation
---
Writes one or several files in one call. A retry with the same `Idempotency-Key` gets the first result.

`PUT /v1/sandboxes/{id}/files`

**Request body** (`multipart/form-data`, required)

- `manifest` (WriteFilesManifest, required) — Which part holds which file. Paths live only here, never in part names, so any path survives every client's multipart encoding.

Request body example:

```json
{
  "manifest": {
    "files": [
      {
        "part": "file_0",
        "path": "string"
      }
    ]
  },
  "property1": "string",
  "property2": "string"
}
```

**Responses**

- `200` — The files written.
- `400` — \`invalid\_request\`: The request does not match the contract.
- `401` — \`unauthorized\`: The API key is missing, unknown or revoked.
- `404` — \`not\_found\`: No such resource in this key's lane. Another lane's ids are not found either.
- `409` — \`sandbox\_stopped\`: The sandbox has stopped: its lifetime or size limit was reached, or it was removed. \`in\_progress\`: A call with this \`Idempotency-Key\` is still running, or the sandbox is still being created. Retry later. \`idempotency\_mismatch\`: The \`Idempotency-Key\` was used before with a different body.
- `413` — \`payload\_too\_large\`: The request body is larger than 32 MiB, all files together.
- `500` — \`internal\_error\`: The platform failed. A retry may succeed; for a call that creates or writes, retry with the same Idempotency-Key.
- `503` — \`unavailable\`: A service behind the API could not be reached. Retry after a short wait; for a call that creates or writes, with the same Idempotency-Key.

Response example, 200:

```json
{
  "files": [
    {
      "path": "string",
      "size_bytes": 0
    }
  ]
}
```
