DocumentService
Revoke Document
Recalls an in-flight document (status ON_APPROVAL or ON_SIGN), cancelling its route. Requires the cancel capability (initiator or a manager).
Required scope: documents:write
Error Codes:
- DEVELOPER.SCOPE_INSUFFICIENT: The key lacks the documents:write scope.
- DOCUMENT_NOT_FOUND: No document with that id is accessible to the key.
- INVALID_ARGUMENT: The document cannot be revoked in its current state.
POST
/
developer
/
v1
/
documents
/
{document_id}
/
_revoke
Revoke Document
curl --request POST \
--url https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_revoke \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"document_id": "<string>"
}
'import requests
url = "https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_revoke"
payload = { "document_id": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({document_id: '<string>'})
};
fetch('https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_revoke"
payload := strings.NewReader("{\n \"document_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"document": {
"completed_at": "2023-11-07T05:31:56Z",
"create_time": "2023-11-07T05:31:56Z",
"date": "<string>",
"department_id": "<string>",
"files": [
{
"file_id": "<string>",
"file_type": "FILE_TYPE_UNSPECIFIED"
}
],
"id": "<string>",
"initiator_employee_id": "<string>",
"number": "<string>",
"organization_id": "<string>",
"route": {
"active": true,
"id": "<string>",
"status": "ROUTE_STATUS_UNSPECIFIED",
"steps": [
{
"id": "<string>",
"index": 123,
"participants": [
{
"employee_id": "<string>",
"id": "<string>",
"key_type": "<string>",
"status": "PARTICIPANT_STATUS_UNSPECIFIED"
}
],
"rule": "STEP_RULE_UNSPECIFIED",
"status": "STEP_STATUS_UNSPECIFIED",
"step_type": "STEP_TYPE_UNSPECIFIED"
}
]
},
"status": "DOCUMENT_STATUS_UNSPECIFIED",
"subject_employee_ids": [
"<string>"
],
"title": "<string>",
"type_id": "<string>",
"update_time": "2023-11-07T05:31:56Z"
}
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}⌘I
Revoke Document
curl --request POST \
--url https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_revoke \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"document_id": "<string>"
}
'import requests
url = "https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_revoke"
payload = { "document_id": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({document_id: '<string>'})
};
fetch('https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.doodocs.kz/api/developer/v1/documents/{document_id}/_revoke"
payload := strings.NewReader("{\n \"document_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"document": {
"completed_at": "2023-11-07T05:31:56Z",
"create_time": "2023-11-07T05:31:56Z",
"date": "<string>",
"department_id": "<string>",
"files": [
{
"file_id": "<string>",
"file_type": "FILE_TYPE_UNSPECIFIED"
}
],
"id": "<string>",
"initiator_employee_id": "<string>",
"number": "<string>",
"organization_id": "<string>",
"route": {
"active": true,
"id": "<string>",
"status": "ROUTE_STATUS_UNSPECIFIED",
"steps": [
{
"id": "<string>",
"index": 123,
"participants": [
{
"employee_id": "<string>",
"id": "<string>",
"key_type": "<string>",
"status": "PARTICIPANT_STATUS_UNSPECIFIED"
}
],
"rule": "STEP_RULE_UNSPECIFIED",
"status": "STEP_STATUS_UNSPECIFIED",
"step_type": "STEP_TYPE_UNSPECIFIED"
}
]
},
"status": "DOCUMENT_STATUS_UNSPECIFIED",
"subject_employee_ids": [
"<string>"
],
"title": "<string>",
"type_id": "<string>",
"update_time": "2023-11-07T05:31:56Z"
}
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}