API Object Shapes

This is a reference area where you can learn about the shapes of many of our API's shared objects. Many of our GraphQL and REST endpoints will require these shapes as part of their input parameters or output results.

FontSize

(integer) The font size to be used when filling a field.

TextColor

(string) The color to use for the relevant text in a field. Must be a 6 digit HEX color reference. e.g. #abc123

Rectangle

An object representing the rectangular area of a field on a document page:

x: (number) required The x coordinate of the left-hand side of the rectangle.
y: (number) required The y coordinate of the top of the rectangle.
height: (number) required The height of the rectangle.
width: (number) required The width of the rectangle.

GraphQLUpload

A binary file uploaded via a GraphQL operation. All GraphQL operations containing binary file uploads are expected to adhere to the GraphQL multipart request specification. If you are unfamiliar/uncomfortable with this pattern, we strongly recommend using our Anvil Node Client to simplify interacting with our API when binary uploads are involved.

Base64Upload

We support the uploading of files as base64 encoded strings via the following structure:

data: (string) required The actual base64 encoded data.
filename: (string) required A filename to store this upload as.
mimetype: (string) required A string representing the MIME type of the file. E.g. "application/pdf".

CastField

An object specifying the configuration of a field in a Cast/PDF:

id: (string) required An ID with which to reference this field in its PDF. Must be unique within the PDF itself.
type: (string) required The type of field. E.g. "signature".
format: (string) The special format, if any, of the field.
name: (string) The human-friendly name of the field.
pageNum: (integer) required The page number in the document where this field is located. Starts at 0.
rect: (Rectangle) required The rectangular area/location of the field on its page.
fontSize: (FontSize) The font size to be used when filling out this field.
textColor: (TextColor) The text color to be used when filling out this field.
alignment: (string) The alignment of text within the field.
fontWeight: (string) The font weight to use when filling out this field.
textStyle: (string) The text style to use when filling out this field.

SignerField

An object representing what fields that the signer should be required to fill out:

fileId: (string) required ID of the file for the corresponding fieldId.
fieldId: (string) required ID or AliasID of the field to be signed on the relevant file.

EtchSigner

An object representing a signer to be used in an Etch Packet:

id: (string) required An ID with which to reference this Signer on various fields. Must be unique in the Etch Packet.
name: (string) The name of this Signer to be used in greetings.
email: (string) The email address for this Signer.
routingOrder: (integer) What position in the signing order this Signer should be. Defaults to its position in the array that contains it.
signerType: (enum["email", "embedded"]) Whether the signer should be prompted via email, or if you plan to embed the signature completion into one of your own flows. Defaults to "email".
redirectURL: (string) A URL that you would like us to redirect your signer to after they complete their signature(s).
fields: (array[SignerField]) required Array of file + field combinations that this Signer is responsible for.

EtchUpload

An object representing a new file being uploaded for use with Etch:

id: (string) required An ID with which to refer to this file in various places.
title: (string) The title of the document to be used.
file: (GraphQLUpload|Base64Upload) required The actual file being uploaded.
fields: (array[CastField]) Array of fields to configure on the new file.
fontSize: (FontSize) Default font size to use on fields in this file.
textColor: (TextColor) Default text color to use on fields in this file.

CastReference

An object for representing an existing Cast to be used with Signature Templates:

castEid: (string) required The EID of an existing Cast to be used.
id: (string) required An ID with which to refer to this file in various places.
title: (string) The title of the document to be used.
fontSize: (FontSize) Default font size to use on fields in this file.
textColor: (TextColor) Default text color to use on fields in this file.

EtchFillData

An object that allows for providing payload data for PDFs in the Etch Packet, as well as for providing/overriding signer information:

signers: (object) An object where each key is a signer ID and each value is a PacketSigner.
payloads: (object) An object where each key is a document Alias ID and each value is a PDFFill.

Submission Payloads

Submission payloads will be an Object keyed by fieldId. Values will be an Object with a String type and value keys e.g.

{
[fieldId]: {
type: String,
value: Any, // can be a string, number, object, etc depending on the type
},
...other ids...
}

For example:

{
email: {
type: 'shortText',
value: 'bobby@tables.com'
},
name: {
type: 'fullName',
value: {
firstName: 'Bobby',
mi: '',
lastName: 'Tables'
}
},
...other ids...
}

Array types are represented similarly

{
beneficiaries: {
type: 'array',
value: [{
email: {
type: 'shortText',
value: 'bobby@tables.com'
},
name: {
type: 'fullName',
value: {
firstName: 'Bobby',
mi: '',
lastName: 'Tables'
}
},
}, ...]
}
},

Submission Payload Types

// Strings
shortText: String
longText: String
email: String
ssn: String in format '123121234'
ein: String in format '121234567'
date: String in the format 'YYYY-MM-DD'
select: String ID of the option selected
// Numbers
number: Number
dollar: Number
integer: Number
// Bools
checkbox: Boolean
// Complex types
phone: Object {
region: 'US',
num: '555113333'
}
fullName: Object {
firstName: 'Bobby',
mi: 'W',
lastName: 'Jones'
}
usAddress: Object {
street1: '123 Main St',
city: 'San Francisco',
state: 'CA',
zip: '94106',
country: 'US' // ISO 3166 country code
}
file: Object {
src: 'https://urlToFile',
mimetype: 'image/png',
name: 'cats.png'
}
// Arrays will have n Objects and will contain the types above
array: Array [{
anId: ...one of the above...,
anotherId: ...one of the above...,
...
}, {...}]

Get started today

Start filling, generating, and signing PDFs from your app. Every account comes with free access to the Developer API.