Upload attachments

Attach files to a lead's proposal before bidding.

POST /v1/campaigns/:campaignId/leads/:leadId/attachments
Content-Type: multipart/form-data

Uploads files that will be attached to this lead's proposal. Files uploaded here override the campaign's configured attachments (fixed or Smart Attachments) for this one bid, so upload before you call /bid.

Request

Send multipart/form-data with one or more parts named files:

curl -X POST \
  "https://api.lancer.app/v1/campaigns/CAMPAIGN_ID/leads/LEAD_ID/attachments" \
  -H "Authorization: Bearer lk_..." \
  -F "files=@portfolio.pdf" \
  -F "files=@case-study.pdf"

Limits and restrictions

  • Up to 5 files per lead, counted cumulatively across calls.
  • Up to 25 MB per file.
  • Duplicate file names on the same lead are rejected.
  • Executable and script file types are rejected (.exe, .bat, .cmd, .js-adjacent script formats, .jar, .vbs, and similar). Stick to documents, images, and archives.
  • If any file in a batch fails validation, the whole batch is rolled back.

Response

The lead's full current attachment list:

[
  {
    "id": "att_123",
    "originalName": "portfolio.pdf",
    "safeName": "portfolio.pdf",
    "contentType": "application/pdf",
    "sizeBytes": 1048576,
    "storagePath": "organizations/org_123/leads/lead_abc123/att_123",
    "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "createdAt": 1754450000000
  }
]

Errors

StatusWhen
400At least one file is required.
400Upload up to 5 files. (too many in one request)
400A lead can have up to 5 attachments. (cumulative limit)
400Per-file type or size violations, with the file name in the message.
404Lead not found.

On this page