Edit Process
/{resource}/editprivate keyprk_This service lets you put a process into edit state so you can send it again with changes: replace the PDF, correct a contract's data, or add and remove documents from a package.
Editing takes two steps. First you mark the process with this service, then you overwrite it by resending the full payload to the matching creation service. The process keeps its identifier.
{resource} says what you are editing and accepts two values:
| Resource | What it edits | Identifier |
|---|---|---|
document | A document or a contract | code, 9 or 10 characters |
package | A package and all of its documents | package, 24 characters |
Putting a process into edit resets the signatures. Collected signatures, identity validations and the links already sent to participants are discarded. When you resend it, everyone is notified again with new links.
There is no way to cancel an edit: a marked process waits until you resend it.
Authentication
Include your private key in the Authorization header.
Authorization: prk_xxx...
Mark the process
Parameters
| Name | Type | Description |
|---|---|---|
code | String conditional | Code of the document or contract. Only for /document/edit. |
package | String conditional | Package identifier, 24 characters. Only for /package/edit. |
Process requirements
You can only edit a process that is not signed, rejected, expired or already in edit. A contract must also be in approved status.
A document that belongs to a package is not edited on its own: edit the whole package.
- curl
- Python
- Node.js
curl --location 'https://api.auco.ai/v1.5/ext/package/edit' \
--header 'Authorization: prk_private_key_company' \
--header 'Content-Type: application/json' \
--data-raw '{
"package": "6a95b55966dd1c779500b962"
}'
import requests
import json
url = "https://api.auco.ai/v1.5/ext/package/edit"
payload = json.dumps({
"package": "6a95b55966dd1c779500b962"
})
headers = {
'Authorization': 'prk_private_key_company',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let data = JSON.stringify({
package: '6a95b55966dd1c779500b962',
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.auco.ai/v1.5/ext/package/edit',
headers: {
Authorization: 'prk_private_key_company',
'Content-Type': 'application/json',
},
data: data,
};
axios
.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Response
{
"message": "PACKAGE_MODIFIED"
}
For a document the response is DOCUMENT_MODIFIED.
Read the process in edit
/{resource}/editprivate keyprk_Returns the marked process, with download links for its PDFs valid for 5 minutes. Use it to inspect what is in edit; the payload you resend is your own.
| Name | Type | Description |
|---|---|---|
code | String conditional | Code of the document or contract. Only for /document/edit. |
package | String conditional | Package identifier. Only for /package/edit. |
curl --location 'https://api.auco.ai/v1.5/ext/package/edit?package=6a95b55966dd1c779500b962' \
--header 'Authorization: prk_private_key_company'
A package returns its data and the detail of every document under documents:
{
"name": "Lease agreements",
"subject": "Sign the agreements",
"message": "Please sign the attached documents",
"signers": [{ "name": "Luz Marina López", "email": "luz@example.com", "status": "pending" }],
"documents": [
{
"code": "CRSD8I9AJ1",
"name": "Lease agreement",
"url": "https://documents.auco.ai/...",
"signProfile": [{ "name": "Luz Marina López", "email": "luz@example.com" }]
}
]
}
Overwrite the process
Once marked, resend the process to its creation service along with its identifier. The payload is the same as a regular creation, plus one field:
| Process | Service | Identifier field |
|---|---|---|
| Document or contract | Upload PDF or Create from template | code |
| Package | Create package | package |
Whatever you leave out is removed. Omit folder and the process moves to the root; omit tags and it ends up with none. Resend the full payload, not only what changed.
The identifier and the creation date are preserved.
In a package, the documents from the previous submission are deleted and new codes are generated — that is what lets you add and remove files freely. The credits of the previous package are refunded and the new ones are charged, so you end up paying for the final number of documents.
curl --location 'https://api.auco.ai/v1.5/ext/document/many' \
--header 'Authorization: prk_private_key_company' \
--header 'Content-Type: application/json' \
--data-raw '{
"package": "6a95b55966dd1c779500b962",
"email": "manager@auco.ai",
"name": "Lease agreements",
"documents": [
{
"name": "Lease agreement",
"signProfile": [
{ "name": "Luz Marina López", "email": "luz@example.com", "type": "signature" }
]
}
]
}'
Errors
| Message | Cause |
|---|---|
DOCUMENT_NOT_FOUND | The document does not exist, is not yours, or is not in an editable state |
PACKAGE_NOT_FOUND | Same for a package. On overwrite, also when the package is not marked for edit |
PACKAGE_ID_INVALID | The package identifier is not 24 hexadecimal characters |
INVALID_RESOURCE | The {resource} in the path is neither document nor package |