Skip to content

Draft a document for signature

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

Drafts a contract or proposal from a template or text, its variables filled from the contact, workspace and quote, with signers who sign in the order given. With send, it goes to the first signer straight away.

Needs the crm:write permission.

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
required
string
>= 1 characters <= 160 characters
kind
string
Allowed values: contract proposal other
templateId
Any of:
string
>= 1 characters <= 64 characters
body
string
<= 60000 characters
contactId
Any of:
string
>= 1 characters <= 64 characters
opportunityId
Any of:
string
>= 1 characters <= 64 characters
quoteId
Any of:
string
>= 1 characters <= 64 characters
signers
required
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
variables

Values for {{variables}} the contact and workspace don’t fill.

object
key
additional properties
string
<= 2000 characters
send
boolean

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
emailed
required
boolean

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"
}
}