Rename a document, move it, or change who writes it
PATCH
/api/v1/documents/{id}
const url = 'https://deck.example.com/api/v1/documents/1';const options = { method: 'PATCH', headers: {cookie: 'qd_auth=<qd_auth>', 'Content-Type': 'application/json'}, body: '{"clear_writer":null,"name":null,"position":null,"tab":null,"writer_node":null,"writer_tab":null}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://deck.example.com/api/v1/documents/1 \ --header 'Content-Type: application/json' \ --cookie qd_auth=<qd_auth> \ --data '{ "clear_writer": null, "name": null, "position": null, "tab": null, "writer_node": null, "writer_tab": null }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer format: int64
Request Bodyrequired
Section titled “Request Bodyrequired”A change to a document: only the fields given change. clear_writer makes it writable by any agent.
Media typeapplication/json
A change to a document: only the fields given change. clear_writer makes it writable by any agent.
object
clear_writer
Any agent may write it from now on.
boolean | null
name
string | null
position
integer | null format: int64
tab
string | null
writer_node
A new writer (both or neither).
string | null
writer_tab
string | null
key
additional properties
Responses
Section titled “Responses”Media typeapplication/json
object
id
required
integer format: int64
kind
required
name
required
What the person calls it, shown as its sub-tab: free text.
string
position
required
Its order among the documents, lowest first; top-level tabs follow their first document.
integer format: int64
slug
required
Its name in URLs and ?doc=: inbox, work, docspring.
string
tab
required
The top-level tab it sits under: free text (“Inbox”, “Work”).
string
writer_node
The agent that writes it: an agent’s report commands go to the document it writes. None: any agent may (the Inbox, as before documents).
string | null
writer_tab
string | null
Example
{ "kind": "inbox"}default
Section titled “default”An error, with its message.
Media typeapplication/json
Every error the REST API returns, with an HTTP status.
object
error
required
string
Example generated
{ "error": "example"}