API Reference

Copy section

Description

Asynchronously copies a section given details about the copy's destination within the same or another document. Options are specified using a SectionCopy object.

Copies only the section's content — not any labels, comments, tasks, or formatting from a style guide. Unless otherwise specified, the copy appears at the top level of its destination document, with an index of 0, and with the same name as the original section.

POST /documents/{documentId}/sections/{sectionId}/copy

🚧

Required OAuth Scopes:

file:write

Parameters

ParameterInTypeRequiredDescription
documentIdpathstringtrueThe unique identifier of the document
sectionIdpathstringtrueThe unique identifier of the section
bodybodySectionCopytrueA SectionCopy object

Body parameter example

{
  "document": "327afa1a152f372fa1aeadb35ed28925d",
  "sectionIndex": 2,
  "sectionName": "October 2020",
  "sectionParent": "327afa1a152f372fa1aeadb35ed28925d_1"
}

Code Samples

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

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

print(r.headers['Location'])

Returns

202 - Accepted

HeaderDescription
LocationThe location to poll for the operation result.
Retry-AfterThe number of seconds to wait before polling for a result and between polling attempts.