Skip to content

Change a draft document

PATCH
/api/v1/documents/{id}
curl --request PATCH \
--url https://digize.com/api/v1/documents/example \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "title": "example", "body": "example", "signers": [ { "name": "example", "email": "hello@example.com", "contactId": "example" } ] }'

Changes a draft’s title, text or signers. Once it’s sent its text is final.

Needs the crm:write permission.

id
required
string
>= 1 characters <= 64 characters
Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
title
string
>= 1 characters <= 160 characters
body
string
<= 60000 characters
signers
Array<object>
>= 1 items <= 10 items
object
name
required
string
>= 1 characters <= 120 characters
email
required
string format: email
<= 254 characters /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/
contactId
Any of:
string
>= 1 characters <= 64 characters

Example generated

{
"title": "example",
"body": "example",
"signers": [
{
"name": "example",
"email": "hello@example.com",
"contactId": "example"
}
]
}

Done

Media typeapplication/json
object
id
required
string
title
required
string
kind
required
string
Allowed values: contract proposal other
body
required
string
templateId
required
string | null
contact
required
Any of:
object
id
required

The contact’s id.

string
name
required
string
email
required
string
opportunityId
required
string | null
quoteId
required
string | null
status
required
string
Allowed values: draft sent completed declined void
signers
required

In the order they sign.

Array<object>
object
id
required
string
position
required
number
name
required
string
email
required
string
contactId
required
string | null
status
required
string
Allowed values: waiting sent viewed signed declined
sentAt
required
Any of:
string format: date-time
viewedAt
required
Any of:
string format: date-time
signedAt
required
Any of:
string format: date-time
declinedAt
required
Any of:
string format: date-time
declineReason
required
string | null
acceptance
required
Any of:
object
name
required
string
ip
required
string
at
required
string format: date-time
url
required

Their own signing link.

string
contentHash
required

SHA-256 of the title and text, from when it was sent.

string | null
signedPdf
required

Whether its signed PDF is kept.

boolean
sentAt
required
Any of:
string format: date-time
completedAt
required
Any of:
string format: date-time
declinedAt
required
Any of:
string format: date-time
voidedAt
required
Any of:
string format: date-time
createdAt
required
string format: date-time

Example

{
"kind": "contract",
"status": "draft",
"signers": [
{
"status": "waiting"
}
]
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}