Salesly API
API Reference

Upload a document to an opportunity

Uploads a file and attaches it to the opportunity. Maximum size 20 MB.

POST
/opportunities/{id}/documents

Authorization

x-api-key<token>

Your tenant API key

In: header

Request Body

multipart/form-dataRequired
file
Required
file

Max 20 MB. Allowed types: pdf, doc, docx, xls, xlsx, csv, txt, png, jpg, jpeg, gif, webp. The extension must match the file's actual content.

Format: "binary"
namestring

Defaults to the uploaded file's base name.

Maximum length: 255
document_category_idinteger

Defaults to the workspace's general category.

Path Parameters

id
Required
integer
curl -X POST "https://rest.salesly.app/api/v1/developers/opportunities/0/documents" \
  -H "x-api-key: <token>" \
  -F file="string" \
  -F name="string" \
  -F document_category_id="0"

Document created and attached

{
  "data": {
    "id": 12,
    "name": "Signed contract",
    "filename": "6f1c8e2a-6b1e-4c8a-9f2d-0b7a1c3d5e9f_contract.pdf",
    "extension": "PDF",
    "mime_type": "application/pdf",
    "size_bytes": 184320,
    "contact_id": 42,
    "category_id": 1,
    "opportunity_ids": [
      0
    ],
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}