Attachments

Upload, download, and manage file attachments for leads, contacts, companies, deals, tasks, and contracts.

All Attachments endpoints require JWT authentication via the Authorization: Bearer <token> header.

Core Endpoints

GET /attachments/{entityType}/{entityId} List attachments
JWT Required

List file attachments for an entity. Supported types: lead, contact, company, deal, task, contract.

Path Parameters

NameTypeRequiredDescription
entityType string Required Values: lead, contact, company, deal, task, contract
entityId integer Required

Response

Attachment list

{
    "success": true,
    "data": [
        {
            "id": 1,
            "filename": "proposal.pdf",
            "original_name": "proposal.pdf",
            "mime_type": "application/pdf",
            "size": 245760,
            "note": "Final version",
            "uploaded_by": 1,
            "uploaded_by_name": "...",
            "created_at": "2026-01-15T09:30:00.000000Z"
        }
    ]
}

Code Examples

curl -X GET "https://crm.revorbit.com/api/attachments/{entityType}/{entityId}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/attachments/{entityType}/{entityId}",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
POST /attachments/{entityType}/{entityId} Upload attachment
JWT Required

Upload a file attachment (max 10MB). Optionally include a note.

Path Parameters

NameTypeRequiredDescription
entityType string Required Values: lead, contact, company, deal, task, contract
entityId integer Required

Request Body

NameTypeRequiredDescription
file file Optional
note string Optional Optional description (max 500 chars)

Code Examples

curl -X POST "https://crm.revorbit.com/api/attachments/{entityType}/{entityId}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -F "file=@/path/to/file"
const response = await fetch(
  "https://crm.revorbit.com/api/attachments/{entityType}/{entityId}",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
GET /attachments/{id}/download Download attachment
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

curl -X GET "https://crm.revorbit.com/api/attachments/{id}/download" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/attachments/{id}/download",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
PUT /attachments/{id} Update attachment note
JWT Required

Update the note/description on an attachment.

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Request Body

NameTypeRequiredDescription
note string Optional

Code Examples

curl -X PUT "https://crm.revorbit.com/api/attachments/{id}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"note":"..."}'
const response = await fetch(
  "https://crm.revorbit.com/api/attachments/{id}",
  {
    method: "PUT",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "note": "..."
      }
    )
  }
);
const data = await response.json();
DELETE /attachments/{id} Delete attachment
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

curl -X DELETE "https://crm.revorbit.com/api/attachments/{id}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/attachments/{id}",
  {
    method: "DELETE",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();