API Reference

Create a new section in a document

Description

Creates a new section in a document, given its properties. By default, the new section appears at the top-most position.

POST /documents/{documentId}/sections

🚧

Required OAuth Scopes:

file:write

Parameters

ParameterInTypeRequiredDescription
documentIdpathstringtrueThe unique identifier of the document
bodybodySectiontrueThe properties of the section to create

Body parameter example

{
  "name": "Risk Factor",
  "parent": {
    "id": "a8b3adb687644b27fafcb3a9875f0f0d_18"
  }
}

Code Samples

curl -X POST https://api.app.wdesk.com/platform/v1/documents/{documentId}/sections  \ 
-H 'Content-Type: application/json' \ 
-H 'Accept: application/json' \ 
-H 'Authorization: Bearer {access-token}'
http POST https://api.app.wdesk.com/platform/v1/documents/{documentId}/sections  \ 
Content-Type:application/json \ 
Accept:application/json \ 
Authorization:"Bearer {access-token}"
wget --method=POST "https://api.app.wdesk.com/platform/v1/documents/{documentId}/sections" \
 --output-document -  \ 
 --header 'Content-Type: application/json' \ 
 --header 'Accept: application/json' \ 
 --header 'Authorization: Bearer {access-token}'
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://api.app.wdesk.com/platform/v1/documents/{documentId}/sections', headers = headers)

print(r.json())

Returns

201 - Created

Returns a Section object containing details about the newly created Section.

Example Responses


{
  "id": "b9b3ddb587744a27aafda3c9865f1f0a_1",
  "name": "January",
  "parent": null,
  "index": 0,
  "children": []
}