Skip to main content
The Files API is in preview. Preview APIs aren’t available in sandbox or production yet and can change before beta. Use these pages to plan your integration. You can’t call a preview API yet. Beta is planned for December 2026. See Versioning and backwards compatibility.
A file is a collection of bytes that Lead stores, along with a small amount of declared metadata, including the file type. You create a file using POST /v2/files. You can read a file’s declared metadata with GET /v2/files/{id}, however you cannot download the original file. Lead extracts file_name and content_type from the multipart header. uploaded_by is either partner or lead.

Fields

Accepted File Content-Types

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

Create

You send files with POST /v2/files. Set Content-Type to multipart/form-data. A success response means Lead has received the bytes. POST requires an Idempotency-Key header of up to 255 characters. See Idempotency. The request body accepts the following fields:
You cannot modify a file once you create it. If you made an error, you must create a new file.

The type enum

Every file has one type, which you set when you upload it. The type decides which objects the file can link to, and no type belongs to more than one group. Use the table for the object you’re linking to.
If you create a file with the incorrect type, you must upload a new file with the correct type declared.

Entity identification documents

Types for identification_documents[] on an Entity. Which ones an entity accepts depends on its type; see Accepted types by entity type.

Entity additional documents

Types for additional_documents[] on an Entity.

Application or User Account documents

Types for documents[] on an Application or a User Account. The list is the same for both.

Retrieve

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

Linking a File to a Document

Once you create a file, you can link it 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 before you can link it. You can link a file to an unlimited number of objects, but you can only link it to the same object once. For more information, review each object.