Skip to main content
A file is bytes Lead holds plus a small amount of declared metadata, including type. You create a file using POST /v2/files. You can read a file’s declared metadata with GET /v2/files/{id}, however the original file is not available for download. file_name and content_type are taken from the multipart header. source is either lead_uploaded or partner_uploaded.

Fields

Accepted file Content-Types

Lead accepts the following file types: PDF, JPG, JPEG, PNG, and HTML. If the bytes do not match the declared type, the request is rejected.

Create

Files are sent with POST /v2/files. Content-Type should be set to multipart/form-data. A success response means we have the bytes. POST requires an Idempotency-Key header of up to 255 characters. See Idempotency. The request body accepts the following fields:
Files cannot be modified once created. If you made an error, you must create a new file.

The type enum

Every file has a type that declares what is inside of the file. The type also dictates what objects the file can be linked to. If a file is created with the incorrect type, a new file must be uploaded with the correct type declared.

Retrieve

GET /v2/files/{id} lists the file object’s metadata.

Linking a file to a document

Once a file is created, it can be linked to an Entity, Application, or User Account, using each object’s specified document structure. A file’s type must match the object’s list of allowed types, in order for it to be linked. A file can be linked to an unlimited number of objects, but can only be linked to the same object once. For more information, review each object.