Contracts

Generate contracts from templates with merge tags. Manage contract lifecycle including PDF/DOCX export, executed file upload, notes, and tasks.

All Contracts endpoints require JWT authentication via the Authorization: Bearer <token> header. Some endpoints require Admin role.

Core Endpoints

GET /contracts List contracts
JWT Required

Query Parameters

NameTypeRequiredDescription
page integer Optional Page number for pagination. Default: 1
per_page integer Optional Number of results per page (max 100). Default: 25. Max: 100
search string Optional Search term to filter results
status string Optional Filter by status. Supports comma-separated values for multi-status filtering (e.g. draft,active). Values: draft, active, executed, expired, terminated, archived
deal_id integer Optional
expiring_within integer Optional Show contracts expiring within N days (only active/executed contracts)
sort_by string Optional Sort field (default: contract_number). Values: contract_number, name, company_name, deal_title, status, effective_date, termination_date, created_at
sort_dir string Optional Sort direction (default: ASC). Values: ASC, DESC

Code Examples

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

Generate a contract from a template with merge tag resolution.

Request Body

NameTypeRequiredDescription
deal_id integer Required
template_id integer Required
title string Required
start_date date Optional
end_date date Optional
auto_renew boolean Optional
partner_ref string Optional
content string Optional

Code Examples

curl -X POST "https://crm.revorbit.com/api/contracts" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "deal_id": 1,
    "template_id": 1,
    "title": "...",
    "start_date": "2026-01-15",
    "end_date": "2026-01-15",
    "auto_renew": true,
    "partner_ref": "...",
    "content": "..."
}'
const response = await fetch(
  "https://crm.revorbit.com/api/contracts",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "deal_id": 1,
          "template_id": 1,
          "title": "...",
          "start_date": "2026-01-15",
          "end_date": "2026-01-15",
          "auto_renew": true,
          "partner_ref": "...",
          "content": "..."
      }
    )
  }
);
const data = await response.json();
GET /contracts/{id} Get contract
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

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

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Request Body

NameTypeRequiredDescription
deal_id integer Required
template_id integer Required
title string Required
start_date date Optional
end_date date Optional
auto_renew boolean Optional
partner_ref string Optional
content string Optional

Code Examples

curl -X PUT "https://crm.revorbit.com/api/contracts/{id}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "deal_id": 1,
    "template_id": 1,
    "title": "...",
    "start_date": "2026-01-15",
    "end_date": "2026-01-15",
    "auto_renew": true,
    "partner_ref": "...",
    "content": "..."
}'
const response = await fetch(
  "https://crm.revorbit.com/api/contracts/{id}",
  {
    method: "PUT",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "deal_id": 1,
          "template_id": 1,
          "title": "...",
          "start_date": "2026-01-15",
          "end_date": "2026-01-15",
          "auto_renew": true,
          "partner_ref": "...",
          "content": "..."
      }
    )
  }
);
const data = await response.json();
DELETE /contracts/{id} Delete contract
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

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

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Response

PDF file (binary file download)

Code Examples

curl -X GET "https://crm.revorbit.com/api/contracts/{id}/pdf" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/contracts/{id}/pdf",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
GET /contracts/{id}/docx Export as Word
JWT Required

Download the contract as a .docx Word document.

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

curl -X GET "https://crm.revorbit.com/api/contracts/{id}/docx" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/contracts/{id}/docx",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
PUT /contracts/{id}/regenerate Regenerate contract
JWT Required

Re-apply the template and merge tags to regenerate contract content.

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

curl -X PUT "https://crm.revorbit.com/api/contracts/{id}/regenerate" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/contracts/{id}/regenerate",
  {
    method: "PUT",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
POST /contracts/{id}/notes Add note to contract
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Request Body

NameTypeRequiredDescription
content string Required

Code Examples

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

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID
noteId integer Required

Code Examples

curl -X DELETE "https://crm.revorbit.com/api/contracts/{id}/notes/{noteId}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/contracts/{id}/notes/{noteId}",
  {
    method: "DELETE",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
POST /contracts/{id}/tasks Add task to contract
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Request Body

NameTypeRequiredDescription
title string Required
description string Optional
due_date date Optional
due_time string Optional
priority string Optional Values: low, medium, high
assigned_to integer Optional
contact_id integer Optional
company_id integer Optional
deal_id integer Optional

Code Examples

curl -X POST "https://crm.revorbit.com/api/contracts/{id}/tasks" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "...",
    "description": "...",
    "due_date": "2026-01-15",
    "due_time": "...",
    "priority": "low",
    "assigned_to": 1,
    "contact_id": 1,
    "company_id": 1,
    "deal_id": 1
}'
const response = await fetch(
  "https://crm.revorbit.com/api/contracts/{id}/tasks",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "title": "...",
          "description": "...",
          "due_date": "2026-01-15",
          "due_time": "...",
          "priority": "low",
          "assigned_to": 1,
          "contact_id": 1,
          "company_id": 1,
          "deal_id": 1
      }
    )
  }
);
const data = await response.json();
PUT /contracts/{id}/tasks/{taskId} Update contract task
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID
taskId integer Required

Request Body

NameTypeRequiredDescription
title string Required
description string Optional
due_date date Optional
due_time string Optional
priority string Optional Values: low, medium, high
assigned_to integer Optional
contact_id integer Optional
company_id integer Optional
deal_id integer Optional

Code Examples

curl -X PUT "https://crm.revorbit.com/api/contracts/{id}/tasks/{taskId}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "...",
    "description": "...",
    "due_date": "2026-01-15",
    "due_time": "...",
    "priority": "low",
    "assigned_to": 1,
    "contact_id": 1,
    "company_id": 1,
    "deal_id": 1
}'
const response = await fetch(
  "https://crm.revorbit.com/api/contracts/{id}/tasks/{taskId}",
  {
    method: "PUT",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "title": "...",
          "description": "...",
          "due_date": "2026-01-15",
          "due_time": "...",
          "priority": "low",
          "assigned_to": 1,
          "contact_id": 1,
          "company_id": 1,
          "deal_id": 1
      }
    )
  }
);
const data = await response.json();
DELETE /contracts/{id}/tasks/{taskId} Delete contract task
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID
taskId integer Required

Code Examples

curl -X DELETE "https://crm.revorbit.com/api/contracts/{id}/tasks/{taskId}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/contracts/{id}/tasks/{taskId}",
  {
    method: "DELETE",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
POST /contracts/{id}/executed Upload executed contract
JWT Required

Upload a signed/executed copy of the contract.

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Request Body

NameTypeRequiredDescription
file file Optional

Code Examples

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

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

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

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

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

Contract Templates

GET /contract-templates List templates
Admin Required

Code Examples

curl -X GET "https://crm.revorbit.com/api/contract-templates" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/contract-templates",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
POST /contract-templates Create template
Admin Required

Request Body

NameTypeRequiredDescription
name string Required
content string Required HTML template with merge tags
number_prefix string Optional Contract number prefix (default: RO)
default_term_months integer Optional Default contract term in months (default: 36)
header_left string Optional
header_center string Optional
header_right string Optional
footer_left string Optional
footer_center string Optional
footer_right string Optional

Code Examples

curl -X POST "https://crm.revorbit.com/api/contract-templates" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "...",
    "content": "...",
    "number_prefix": "...",
    "default_term_months": 1,
    "header_left": "...",
    "header_center": "...",
    "header_right": "...",
    "footer_left": "...",
    "footer_center": "...",
    "footer_right": "..."
}'
const response = await fetch(
  "https://crm.revorbit.com/api/contract-templates",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "name": "...",
          "content": "...",
          "number_prefix": "...",
          "default_term_months": 1,
          "header_left": "...",
          "header_center": "...",
          "header_right": "...",
          "footer_left": "...",
          "footer_center": "...",
          "footer_right": "..."
      }
    )
  }
);
const data = await response.json();
GET /contract-templates/{id} Get template
Admin Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

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

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Request Body

NameTypeRequiredDescription
name string Optional
content string Optional
number_prefix string Optional
default_term_months integer Optional Default contract term in months
header_left string Optional
header_center string Optional
header_right string Optional
footer_left string Optional
footer_center string Optional
footer_right string Optional

Code Examples

curl -X PUT "https://crm.revorbit.com/api/contract-templates/{id}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "...",
    "content": "...",
    "number_prefix": "...",
    "default_term_months": 1,
    "header_left": "...",
    "header_center": "...",
    "header_right": "...",
    "footer_left": "...",
    "footer_center": "...",
    "footer_right": "..."
}'
const response = await fetch(
  "https://crm.revorbit.com/api/contract-templates/{id}",
  {
    method: "PUT",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "name": "...",
          "content": "...",
          "number_prefix": "...",
          "default_term_months": 1,
          "header_left": "...",
          "header_center": "...",
          "header_right": "...",
          "footer_left": "...",
          "footer_center": "...",
          "footer_right": "..."
      }
    )
  }
);
const data = await response.json();
DELETE /contract-templates/{id} Delete template
Admin Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

curl -X DELETE "https://crm.revorbit.com/api/contract-templates/{id}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/contract-templates/{id}",
  {
    method: "DELETE",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
GET /contract-templates/tags Get merge tags
Admin Required

Retrieve available merge tags grouped by entity (Licensee, Deal, Quote, Contract).

Code Examples

curl -X GET "https://crm.revorbit.com/api/contract-templates/tags" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/contract-templates/tags",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
GET /contract-templates/tags/pdf Get merge tags PDF
Admin Required

Download a PDF reference of all available merge tags.

Code Examples

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