Creating a document
To create a document/send a document for signature
Creating documents differs slightly from other mutations because it involves uploading a file. First, we need to write the mutation:
mutation CreateDocumentMutation(
$document: DocumentInput!, # Definition of the $document variable
$signers: [SignerInput!]!, # $signers and $file, with its respective
$file: Upload! # types. (The "!" indicate that are
) { # mandatory parameters)
createDocument(
document: $document, # Pass the variable values to the mutation parameters
signers: $signers, #
file: $file, #
organization_id: 123, # OPTIONAL: Creates in other user organizations, otherwise uses the current one
folder_id: "a1b2c3" # OPtIONAL: Creates archived in a folder
) {
id
name
refusable
sortable
created_at
signatures {
public_id
name
email
created_at
action { name }
link { short_link }
user { id name email }
}
}
}Next, we need the values of the variables defined in the mutation in a JSON:
Notice that no value has been provided for the $file variable? That's because since the file is being uploaded, the request needs to be sent as multipart/form-data, so the file must be handled a bit differently. You can do this directly in Altair:

If you're unsure how document submission works for your integration, this repository provides more information and examples on how to handle the upload: https://github.com/jaydenseric/graphql-multipart-request-spec.
Creating documents on Sandbox
Our API also supports sending test documents, which do not consume document credits, making integration easier for those who have not yet acquired a plan with unlimited documents. To learn how to do this, visit our sandbox page.
More options:
Additional Validations
You can implement additional validations in your documents. These configurations must be included in the security_verifications list of the signer object, using the type field to define the desired challenge modality. In addition to the types, fields such as verify_phone and cpf assist in the delivery of security codes and in the precise identification of the signer.
verify_phone
The signer must validate a mobile number through a code sent via SMS. You can pre-fill the number or leave it blank so the signer can provide it themselves.
cpf
Configuration that ensures only the signer with the specified CPF can sign the document. If defined, the system forces the entry or validation of this data in the signer's account
MANUAL
The signer will attach a photo ID and take a selfie. You or a member of your organization can then approve or reject the submitted documents and selfie
UPLOAD
The signer must attach the front and back of a photo ID using their smartphone or computer
LIVE
The signer will need to attach a photo ID, take a selfie with their smartphone, and perform a liveness check (video). The document photo will be automatically compared to the selfie to verify the degree of similarity
PF_FACIAL
The signer takes a selfie which is validated by SERPRO, comparing it to Brazilian government registration photos linked to the informed CPF
BIOMETRIC_AND_TEXT_EXTRACTION
The signer will need to photograph an ID document and take a selfie, the document photo will be compared with the selfie to determine the similarity score.
LIVENESS_AND_TEXT_EXTRACTION
The signer will need to perform a liveness check and photograph a photo ID. Document information will be automatically extracted and compared to verify the similarity score.
Last updated