---
title: "PUT /api/v1/file-views/{spaceId}/text"
method: PUT
path: "/api/v1/file-views/{spaceId}/text"
---

# PUT /api/v1/file-views/{spaceId}/text

`PUT /api/v1/file-views/{spaceId}/text`

## Request

- Base URL: `https://falconer.com` (the document declares no server; this is the origin it was published from)
- URL: `https://falconer.com/api/v1/file-views/{spaceId}/text`
- Auth: none declared

## Path parameters

- `spaceId` integer, required: Space id, from GET /spaces.

## Headers

- `x-organization-id` string: Required when using OAuth bearer tokens.

## Request body

- WriteTextFileRequest
  - `path` string, required: Path relative to the Space root, such as guides/setup.mdx.
  - `content` string, required
  - `ifMatch` string: etag from the read; * skips the check. The If-Match header wins when both are set.

## Response `200`

File updated

- TextFile
  - `path` string, required
  - `fileNodeId` string, required
  - `content` string, required
  - `sourceContent` string, nullable, required: What the repository held at last sync, or null if it never had the file.
  - `matchesSource` boolean, required
  - `etag` string, required: Pass back as ifMatch (or If-Match) so a write cannot clobber an edit you never saw.

## Other responses

- `201`: File created
- `400`: Bad request, such as a missing parent folder
- `403`: Permission is missing
- `404`: Space not found, or file not found
- `411`: Content-Length is required
- `412`: The file changed since the etag was read
- `413`: Text files are capped at 5 MB
- `422`: Not a text file; edit pages with PUT /docs/{id}

---

[API](https://skmtc.dev/falconer/apis/falconer-public-api.md) · [All operations](https://skmtc.dev/falconer/apis/falconer-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/falconer/apis/falconer-public-api/revisions/7b303b7ddf6a?raw)
