Skip to content

Upload a file to a lead ​

Adds a file to a lead, such as a signed quotation or an ID proof. The file shows up on the lead's timeline as added by telecrm.

It takes two requests:

  1. Request an upload link. Send the file's name, type and size to this endpoint.
  2. Upload the file. Send the file to the link you got back, within 15 minutes.
FieldValue
MethodPOST
URLhttps://next.telecrm.in/autoupdate/v2/enterprise/{enterpriseId}/lead/{leadId}/file
AuthBearer token (Sync-typed). See Authentication.
json
{
  "file_name": "quotation.pdf",
  "content_type": "application/pdf",
  "file_size": 87645,
  "note": "Signed quotation"
}
FieldTypeRequiredDescription
file_namestringyesThe name shown on the lead, with its extension, such as quotation.pdf. Can't contain ? or /.
content_typestringyesThe file's type, such as application/pdf or image/jpeg. Send the same value in step 2.
file_sizenumberyesThe file's exact size in bytes. Up to 26214400 (25 MB).
notestringnoA note shown next to the file on the timeline.

Response ​

201 Created

json
{
  "presigned_url": "https://s3.ap-south-1.amazonaws.com/..."
}

presigned_url is your upload link.

Step 2: Upload the file ​

Send the file to the upload link with a PUT request:

bash
curl -X PUT "PASTE_THE_PRESIGNED_URL_HERE" \
  -H "Content-Type: application/pdf" \
  --data-binary @quotation.pdf
  • Use the same Content-Type you sent as content_type in step 1.
  • Send exactly file_size bytes. If the size doesn't match, the upload is rejected. curl --data-binary sets the size for you.
  • Leave out your telecrm token. The link carries its own permission, so don't add an Authorization header.
  • Upload within 15 minutes. After that the link stops working.

If the upload fails

The file is added to the lead as soon as step 1 succeeds, before you upload anything. If step 2 fails, the timeline shows the file but it can't be opened.

To fix it, upload again to the same link while it still works. Once the link has expired, start over from step 1. This adds a new file to the timeline, and the first entry stays without a file.

Errors ​

StatusCause
400A field is missing or invalid, the file is larger than 25 MB, or its file type is blocked.
401The token is missing or invalid.
404There's no lead with this ID in the workspace.