Documents

Update a document

PATCH
updates a single document, for only the body and title

Path parameters

spaceIdstringRequired
ID of space to return
documentIdstringRequired
ID of document to return

Request

This endpoint expects an object.
title
stringRequired
body
stringRequired
treatments
list of stringsOptional
Certain treatments will cause your Document to look or behave differently.
actions
list of objectsOptional

Response

This endpoint returns an object
data
object
A document (markdown components) belong to a space

Errors

PATCH
$curl -X PATCH https://api.x.flatfile.com/v1/spaces/us_sp_YOUR_ID/documents/us_dc_YOUR_ID \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "title": "Updated Title",
> "body": "Updated My information"
>}'
Response
1{
2 "data": {
3 "body": "Updated My information",
4 "createdAt": "2022-09-18T00:19:57.007Z",
5 "id": "us_dc_YOUR_ID",
6 "title": "Updated Title",
7 "updatedAt": "2022-09-18T00:19:57.007Z",
8 "actions": [
9 {
10 "label": "Submit",
11 "operation": "submitAction",
12 "mode": "foreground",
13 "description": "Submit data to webhook.site",
14 "primary": true
15 }
16 ],
17 "environmentId": "us_env_YOUR_ID",
18 "spaceId": "us_sp_YOUR_ID",
19 "treatments": []
20 }
21}