Records›Get Record Documents

Get Record Documents

Lists the documents attached to a record, or returns one document’s details, with a temporary download link for each.

GEThttps://secure-api.setshape.com/api/lead/documents/{crmid}

Replace {crmid} with your CRM ID, the Shape system ID that belongs to your API key. Send the standard headers on every request: Authorization: YOUR_API_AUTHORIZATION_KEY and Content-Type: application/json. See Authentication.

Parameters

Parameter Where Required Description
crmid Path Required Your Shape system ID.
lead_id Query Required The ID of the record whose documents you want.
documentId Query Optional Return only this document. Leave it out to list every document on the record.

Example request

curl --request GET 
  --url "https://secure-api.setshape.com/api/lead/documents/YOUR_CRM_ID?lead_id=281944" 
  --header "Authorization: YOUR_API_AUTHORIZATION_KEY"

A JSON body also works when the request sends Content-Type: application/json.

Response

The response is {"success": true, "data": [ … ]}, documents newest first.

{
  "success": true,
  "data": [
    {
      "id": 55,
      "file_name": "sample-document.pdf",
      "file_type": "pdf",
      "upload_date": "2026-11-02 15:04:11",
      "file_size": "23.50KB",
      "download_url": "https://secure-api.setshape.com/api/lead/281944/document/55/2290?expires=1793836800&signature=3f1c0e…"
    }
  ]
}
Field Type Description
id integer The document ID. Use it as documentId or in documentIds.
file_name string The file’s name as stored in Shape.
file_type string The file extension, such as jpg or pdf.
upload_date string When the file was uploaded, as YYYY-MM-DD HH:MM:SS, in UTC.
file_size string A readable size, such as 23.50KB. It’s text, not a number.
download_url string A signed link that opens the file. It expires after 1 hour.
Download links expire after 1 hour. Each link opens one document. Request the document list again whenever you need a fresh link, and don’t store links. Links issued before November 1, 2026 no longer work.

Errors

Situation Status Response
lead_id missing 400 {"message": "Please provide lead ID [leadid]"}
documentId sent but empty 400 {"message": "Please provide document ID [documentId]"}
Record not found 404 {"message": "Record not found."}
documentId not on that record 200 {"success": true, "data": []}
Record has no documents 200 {"success": true, "data": []}
Download link expired or altered 403 {"message": "This link is not valid or has expired. Please request a new document list."}
Document deleted after the list was fetched 404 {"message": "Document not found."}