Deals

Track sales opportunities through your pipeline stages. Manage deal notes, tasks, emails, and risk scoring. Import and export deal data.

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

Core Endpoints

GET /deals List deals
JWT Required

Retrieve a paginated list of deals. Includes risk scoring for open deals.

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
stage_id integer Optional Filter by pipeline stage
assigned_to integer Optional
won string Optional Filter won/lost deals. Values: 0, 1
stage_ids string Optional Comma-separated list of stage IDs to filter by
date_from string Optional Filter by date range start (YYYY-MM-DD)
date_to string Optional Filter by date range end (YYYY-MM-DD)
date_field string Optional Date field to filter on (default: expected_close_date). Values: expected_close_date, closed_at, created_at
scope string Optional Filter by user scope (me, team, company). Values: me, team, company
sort_by string Optional Sort field (default: title). Values: title, contact_name, company_name, stage_name, value, expected_close_date, closed_at, assigned_to_name, created_at
sort_dir string Optional Sort direction (default: ASC). Values: ASC, DESC

Response

Paginated deal list

{
    "data": [
        {
            "id": 10,
            "name": "Acme Enterprise License",
            "value": 50000,
            "stage_id": 3,
            "stage_name": "Proposal",
            "contact_id": 1,
            "contact_name": "Jane Smith",
            "company_id": 1,
            "company_name": "Acme Corp",
            "probability": 60,
            "expected_close_date": "2026-03-15",
            "is_won": false,
            "is_lost": false,
            "loss_reason": "...",
            "assigned_to": 1,
            "assigned_name": "...",
            "notes": "...",
            "tags": "...",
            "partner_id": 1,
            "reseller_id": 1,
            "reseller_name": "Channel Partners Inc",
            "reseller_contact_name": "Bob Wilson",
            "risk": {
                "risk_level": "medium",
                "risk_score": 45,
                "risk_factors": [
                    {
                        "label": "...",
                        "detail": "...",
                        "weight": "..."
                    }
                ]
            },
            "created_at": "2026-01-15T09:30:00.000000Z",
            "updated_at": "2026-01-15T09:30:00.000000Z"
        }
    ],
    "current_page": 1,
    "last_page": 1,
    "per_page": 1,
    "total": 1
}

Code Examples

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

Request Body

NameTypeRequiredDescription
name string Required Deal name/title
value number Optional Monetary value
stage_id integer Required Pipeline stage ID
contact_id integer Optional Ship To contact ID
bill_to_contact_id integer Optional Bill To contact ID
company_id integer Optional Associated company (Ship To) ID
partner_id integer Optional Bill To company ID. Nullable
reseller_id integer Optional Reseller company ID. Nullable
reseller_contact_id integer Optional Reseller contact ID. Nullable
probability integer Optional Win probability percentage (0-100)
expected_close_date date Optional Expected close date (YYYY-MM-DD)
assigned_to integer Optional
notes string Optional
tags string Optional

Code Examples

curl -X POST "https://crm.revorbit.com/api/deals" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "...",
    "value": 1,
    "stage_id": 1,
    "contact_id": 1,
    "bill_to_contact_id": 1,
    "company_id": 1,
    "partner_id": 1,
    "reseller_id": 1,
    "reseller_contact_id": 1,
    "probability": 1,
    "expected_close_date": "2026-01-15",
    "assigned_to": 1,
    "notes": "...",
    "tags": "..."
}'
const response = await fetch(
  "https://crm.revorbit.com/api/deals",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "name": "...",
          "value": 1,
          "stage_id": 1,
          "contact_id": 1,
          "bill_to_contact_id": 1,
          "company_id": 1,
          "partner_id": 1,
          "reseller_id": 1,
          "reseller_contact_id": 1,
          "probability": 1,
          "expected_close_date": "2026-01-15",
          "assigned_to": 1,
          "notes": "...",
          "tags": "..."
      }
    )
  }
);
const data = await response.json();
GET /deals/pipeline Pipeline view
JWT Required

Retrieve deals grouped by pipeline stage for Kanban view. Includes risk scoring. Supports optional date range, scope, and assignee filtering.

Query Parameters

NameTypeRequiredDescription
date_from string Optional Filter start date
date_to string Optional Filter end date
date_field string Optional Date field to filter on. Values: expected_close_date, closed_at, created_at. Default: expected_close_date
scope string Optional Scope filter. Values: me, team, company
assigned_to integer Optional Filter by assigned user ID

Code Examples

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

Retrieve all pipeline stages with display order.

Response

Stage list

{
    "success": true,
    "data": [
        {
            "id": 3,
            "name": "Proposal",
            "display_order": 3,
            "probability": 50,
            "is_won": false,
            "is_lost": false,
            "color": "#3b82f6"
        }
    ]
}

Code Examples

curl -X GET "https://crm.revorbit.com/api/deals/stages" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/deals/stages",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
GET /deals/stats Pipeline statistics
JWT Required

Aggregate pipeline statistics (total value, count, win rate, etc.).

Code Examples

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

Retrieve a single deal with full details including risk score.

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Response

Deal details

{
    "success": true,
    "data": {
        "id": 10,
        "name": "Acme Enterprise License",
        "value": 50000,
        "stage_id": 3,
        "stage_name": "Proposal",
        "contact_id": 1,
        "contact_name": "Jane Smith",
        "company_id": 1,
        "company_name": "Acme Corp",
        "probability": 60,
        "expected_close_date": "2026-03-15",
        "is_won": false,
        "is_lost": false,
        "loss_reason": "...",
        "assigned_to": 1,
        "assigned_name": "...",
        "notes": "...",
        "tags": "...",
        "partner_id": 1,
        "reseller_id": 1,
        "reseller_name": "Channel Partners Inc",
        "reseller_contact_name": "Bob Wilson",
        "risk": {
            "risk_level": "medium",
            "risk_score": 45,
            "risk_factors": [
                {
                    "label": "No activity",
                    "detail": "25 days",
                    "weight": 25
                }
            ]
        },
        "created_at": "2026-01-15T09:30:00.000000Z",
        "updated_at": "2026-01-15T09:30:00.000000Z"
    }
}

Code Examples

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

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Request Body

NameTypeRequiredDescription
name string Required Deal name/title
value number Optional Monetary value
stage_id integer Required Pipeline stage ID
contact_id integer Optional Ship To contact ID
bill_to_contact_id integer Optional Bill To contact ID
company_id integer Optional Associated company (Ship To) ID
partner_id integer Optional Bill To company ID. Nullable
reseller_id integer Optional Reseller company ID. Nullable
reseller_contact_id integer Optional Reseller contact ID. Nullable
probability integer Optional Win probability percentage (0-100)
expected_close_date date Optional Expected close date (YYYY-MM-DD)
assigned_to integer Optional
notes string Optional
tags string Optional

Code Examples

curl -X PUT "https://crm.revorbit.com/api/deals/{id}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "...",
    "value": 1,
    "stage_id": 1,
    "contact_id": 1,
    "bill_to_contact_id": 1,
    "company_id": 1,
    "partner_id": 1,
    "reseller_id": 1,
    "reseller_contact_id": 1,
    "probability": 1,
    "expected_close_date": "2026-01-15",
    "assigned_to": 1,
    "notes": "...",
    "tags": "..."
}'
const response = await fetch(
  "https://crm.revorbit.com/api/deals/{id}",
  {
    method: "PUT",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "name": "...",
          "value": 1,
          "stage_id": 1,
          "contact_id": 1,
          "bill_to_contact_id": 1,
          "company_id": 1,
          "partner_id": 1,
          "reseller_id": 1,
          "reseller_contact_id": 1,
          "probability": 1,
          "expected_close_date": "2026-01-15",
          "assigned_to": 1,
          "notes": "...",
          "tags": "..."
      }
    )
  }
);
const data = await response.json();
DELETE /deals/{id} Delete deal
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

curl -X DELETE "https://crm.revorbit.com/api/deals/{id}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/deals/{id}",
  {
    method: "DELETE",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
PUT /deals/{id}/stage Move deal to stage
JWT Required

Move a deal to a different pipeline stage.

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Request Body

NameTypeRequiredDescription
stage_id integer Required

Code Examples

curl -X PUT "https://crm.revorbit.com/api/deals/{id}/stage" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"stage_id":1}'
const response = await fetch(
  "https://crm.revorbit.com/api/deals/{id}/stage",
  {
    method: "PUT",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "stage_id": 1
      }
    )
  }
);
const data = await response.json();
PUT /deals/{id}/primary-quote Set primary quote
JWT Required

Set which quote is the primary quote for this deal.

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Request Body

NameTypeRequiredDescription
quote_id integer Required

Code Examples

curl -X PUT "https://crm.revorbit.com/api/deals/{id}/primary-quote" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"quote_id":1}'
const response = await fetch(
  "https://crm.revorbit.com/api/deals/{id}/primary-quote",
  {
    method: "PUT",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "quote_id": 1
      }
    )
  }
);
const data = await response.json();
POST /deals/{id}/notes Add note to deal
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/deals/{id}/notes" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"..."}'
const response = await fetch(
  "https://crm.revorbit.com/api/deals/{id}/notes",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "content": "..."
      }
    )
  }
);
const data = await response.json();
DELETE /deals/{id}/notes/{noteId} Delete deal note
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID
noteId integer Required

Code Examples

curl -X DELETE "https://crm.revorbit.com/api/deals/{id}/notes/{noteId}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/deals/{id}/notes/{noteId}",
  {
    method: "DELETE",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
GET /deals/{id}/tasks Get deal tasks
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

curl -X GET "https://crm.revorbit.com/api/deals/{id}/tasks" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/deals/{id}/tasks",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
POST /deals/{id}/tasks Add task to deal
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/deals/{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/deals/{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 /deals/{id}/tasks/{taskId} Update deal 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/deals/{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/deals/{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 /deals/{id}/tasks/{taskId} Delete deal task
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID
taskId integer Required

Code Examples

curl -X DELETE "https://crm.revorbit.com/api/deals/{id}/tasks/{taskId}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/deals/{id}/tasks/{taskId}",
  {
    method: "DELETE",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
GET /deals/{id}/timeline Deal email timeline
JWT Required

Combined timeline of all emails linked to a deal.

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

curl -X GET "https://crm.revorbit.com/api/deals/{id}/timeline" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/deals/{id}/timeline",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
GET /deals/{id}/linked-emails Get deal linked emails
JWT Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

curl -X GET "https://crm.revorbit.com/api/deals/{id}/linked-emails" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch(
  "https://crm.revorbit.com/api/deals/{id}/linked-emails",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();
GET /deals/export Export deals
Admin Required

Code Examples

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

Code Examples

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

Request Body

NameTypeRequiredDescription
file file Optional

Code Examples

curl -X POST "https://crm.revorbit.com/api/deals/import" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -F "file=@/path/to/file"
const response = await fetch(
  "https://crm.revorbit.com/api/deals/import",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
    }
  }
);
const data = await response.json();

Pipeline Stages

POST /pipeline-stages Create stage
Admin Required

Create a new pipeline stage.

Request Body

NameTypeRequiredDescription
name string Required
probability integer Optional
color string Optional
is_won boolean Optional
is_lost boolean Optional

Code Examples

curl -X POST "https://crm.revorbit.com/api/pipeline-stages" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"...","probability":1,"color":"...","is_won":true,"is_lost":true}'
const response = await fetch(
  "https://crm.revorbit.com/api/pipeline-stages",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "name": "...",
          "probability": 1,
          "color": "...",
          "is_won": true,
          "is_lost": true
      }
    )
  }
);
const data = await response.json();
PUT /pipeline-stages/reorder Reorder stages
Admin Required

Batch-update display order of all pipeline stages.

Request Body

NameTypeRequiredDescription
order array[integer] Required Array of stage IDs in desired display order

Code Examples

curl -X PUT "https://crm.revorbit.com/api/pipeline-stages/reorder" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"order":[1]}'
const response = await fetch(
  "https://crm.revorbit.com/api/pipeline-stages/reorder",
  {
    method: "PUT",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "order": [
              1
          ]
      }
    )
  }
);
const data = await response.json();
PUT /pipeline-stages/{id} Update stage
Admin Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Request Body

NameTypeRequiredDescription
name string Optional
color string Optional
is_won boolean Optional
is_lost boolean Optional

Code Examples

curl -X PUT "https://crm.revorbit.com/api/pipeline-stages/{id}" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"...","color":"...","is_won":true,"is_lost":true}'
const response = await fetch(
  "https://crm.revorbit.com/api/pipeline-stages/{id}",
  {
    method: "PUT",
    headers: {
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {
          "name": "...",
          "color": "...",
          "is_won": true,
          "is_lost": true
      }
    )
  }
);
const data = await response.json();
DELETE /pipeline-stages/{id} Delete stage
Admin Required

Path Parameters

NameTypeRequiredDescription
id integer Required Resource ID

Code Examples

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