Deal

Deal

https://api.planhat.com/deals

Deals in Planhat represent a sales opportunity or contract associated with one of your customers. Deals are used to track pipeline stages, revenue, and contract timelines. They can contain line items of type subscriptions or fee, and are associated with a company.

It is worth noting that the stage field has two immutable options - "Closed Won" and "Closed Lost". Setting the deal as Closed Won is the only way to denote the deal as being contracted / recognised. Other deal stage options can be added and edited at will.

Also worth noting that the deal fromDate and toDate are purely calculated fields, based on the start and end dates of attached line items.

Finally, deal mrr, arr, and total can be written while there are no line items attached, but are take the average of attached line items once line items are attached to the deal.

Property

Required

Type

Description

_id


objectId

Planhat identifier.

name


string

Deal name.

companyId

Yes

objectId

Related company id (Planhat identifier).

companyName


string

Company name. (Autogenerated).

externalId


string

The deal id in your own system.

sourceId


string

The deal id from an integration (Salesforce, HubSpot, etc).

stage


string

The current pipeline stage of the deal.

ownerId


objectId

The Planhat user assigned as owner of the deal.

followers


array

Array of Planhat user ids following the deal.

mrr


number

Monthly Recurring Revenue.

arr


number

Annual Recurring Revenue. Calculated from MRR. (Autogenerated).

total


number

Total Contract Value.

fees


number

Total fees associated with the deal.

currency


string

Currency of the deal.

closeDate


date

Expected or actual close date of the deal.

renewalDate


date

Earliest renewal date derived from subscriptions. (Autogenerated).

startDate


date

Start date derived from subscriptions. (Autogenerated).

endDate


date

End date derived from subscriptions. (Autogenerated).

subscriptionsCount


number

Number of subscriptions on the deal. (Autogenerated).

feesCount


number

Number of fee line items on the deal. (Autogenerated).

activeSubscriptionsCount


number

Number of currently active subscriptions. (Autogenerated).

comment


string

Free text comment on the deal.

custom


object

A flexible object with custom data.

path


array

Array of objects describing the hierarchical path. Each element contains id

(objectId) and model (string). For a Deal this typically contains one element

pointing to the parent Company. (Autogenerated)

createdAt


date time

ISO date when deal was created. (Autogenerated).

updatedAt


date time

ISO date when deal was last updated. (Autogenerated).

https://api.planhat.com/deals

Deals in Planhat represent a sales opportunity or contract associated with one of your customers. Deals are used to track pipeline stages, revenue, and contract timelines. They can contain line items of type subscriptions or fee, and are associated with a company.

It is worth noting that the stage field has two immutable options - "Closed Won" and "Closed Lost". Setting the deal as Closed Won is the only way to denote the deal as being contracted / recognised. Other deal stage options can be added and edited at will.

Also worth noting that the deal fromDate and toDate are purely calculated fields, based on the start and end dates of attached line items.

Finally, deal mrr, arr, and total can be written while there are no line items attached, but are take the average of attached line items once line items are attached to the deal.

Property

Required

Type

Description

_id


objectId

Planhat identifier.

name


string

Deal name.

companyId

Yes

objectId

Related company id (Planhat identifier).

companyName


string

Company name. (Autogenerated).

externalId


string

The deal id in your own system.

sourceId


string

The deal id from an integration (Salesforce, HubSpot, etc).

stage


string

The current pipeline stage of the deal.

ownerId


objectId

The Planhat user assigned as owner of the deal.

followers


array

Array of Planhat user ids following the deal.

mrr


number

Monthly Recurring Revenue.

arr


number

Annual Recurring Revenue. Calculated from MRR. (Autogenerated).

total


number

Total Contract Value.

fees


number

Total fees associated with the deal.

currency


string

Currency of the deal.

closeDate


date

Expected or actual close date of the deal.

renewalDate


date

Earliest renewal date derived from subscriptions. (Autogenerated).

startDate


date

Start date derived from subscriptions. (Autogenerated).

endDate


date

End date derived from subscriptions. (Autogenerated).

subscriptionsCount


number

Number of subscriptions on the deal. (Autogenerated).

feesCount


number

Number of fee line items on the deal. (Autogenerated).

activeSubscriptionsCount


number

Number of currently active subscriptions. (Autogenerated).

comment


string

Free text comment on the deal.

custom


object

A flexible object with custom data.

path


array

Array of objects describing the hierarchical path. Each element contains id

(objectId) and model (string). For a Deal this typically contains one element

pointing to the parent Company. (Autogenerated)

createdAt


date time

ISO date when deal was created. (Autogenerated).

updatedAt


date time

ISO date when deal was last updated. (Autogenerated).

https://api.planhat.com/deals

Deals in Planhat represent a sales opportunity or contract associated with one of your customers. Deals are used to track pipeline stages, revenue, and contract timelines. They can contain line items of type subscriptions or fee, and are associated with a company.

It is worth noting that the stage field has two immutable options - "Closed Won" and "Closed Lost". Setting the deal as Closed Won is the only way to denote the deal as being contracted / recognised. Other deal stage options can be added and edited at will.

Also worth noting that the deal fromDate and toDate are purely calculated fields, based on the start and end dates of attached line items.

Finally, deal mrr, arr, and total can be written while there are no line items attached, but are take the average of attached line items once line items are attached to the deal.

Property

Required

Type

Description

_id


objectId

Planhat identifier.

name


string

Deal name.

companyId

Yes

objectId

Related company id (Planhat identifier).

companyName


string

Company name. (Autogenerated).

externalId


string

The deal id in your own system.

sourceId


string

The deal id from an integration (Salesforce, HubSpot, etc).

stage


string

The current pipeline stage of the deal.

ownerId


objectId

The Planhat user assigned as owner of the deal.

followers


array

Array of Planhat user ids following the deal.

mrr


number

Monthly Recurring Revenue.

arr


number

Annual Recurring Revenue. Calculated from MRR. (Autogenerated).

total


number

Total Contract Value.

fees


number

Total fees associated with the deal.

currency


string

Currency of the deal.

closeDate


date

Expected or actual close date of the deal.

renewalDate


date

Earliest renewal date derived from subscriptions. (Autogenerated).

startDate


date

Start date derived from subscriptions. (Autogenerated).

endDate


date

End date derived from subscriptions. (Autogenerated).

subscriptionsCount


number

Number of subscriptions on the deal. (Autogenerated).

feesCount


number

Number of fee line items on the deal. (Autogenerated).

activeSubscriptionsCount


number

Number of currently active subscriptions. (Autogenerated).

comment


string

Free text comment on the deal.

custom


object

A flexible object with custom data.

path


array

Array of objects describing the hierarchical path. Each element contains id

(objectId) and model (string). For a Deal this typically contains one element

pointing to the parent Company. (Autogenerated)

createdAt


date time

ISO date when deal was created. (Autogenerated).

updatedAt


date time

ISO date when deal was last updated. (Autogenerated).

To create a deal it is required to define a companyId in the payload. You can reference the company using its externalId or sourceId with the following structure: "companyId": "extid-[company externalId]" or "companyId": "srcid-[company sourceId]".

Example Request
  curl --location -g --request POST 'https://api.planhat.com/deals' \
    --header 'Content-Type: application/json' \                                                                                                                                                             
    --header 'Authorization: Bearer {{apiToken}}' \                                                                                                                                                         
    --data-raw '{                                  
      "name": "Acme Renewal 2026",                                                                                                                                                                          
      "companyId": "61006bc89a3e0b702ed8ea49",                                                                                                                                                              
      "stage": "Negotiation",
      "mrr": 5000,                                                                                                                                                                                          
      "closeDate": "2026-09-30"
    }'


Example Response
  Example Response
  {
    "_id": "610091916d643a7c418aef42",
    "name": "Acme Renewal 2026",      
    "companyId": "61006bc89a3e0b702ed8ea49",                                                                                                                                                                
    "companyName": "Acme",                  
    "stage": "Negotiation",                                                                                                                                                                                 
    "mrr": 5000,           
    "arr": 60000,                                                                                                                                                                                           
    "closeDate": "2026-09-30T00:00:00.000Z",
    "subscriptionsCount": 0,                                                                                                                                                                                
    "feesCount": 0,         
    "activeSubscriptionsCount": 0,                                                                                                                                                                          
    "followers": [],              
    "custom": {},                                                                                                                                                                                           
    "createdAt": "2026-05-11T10:00:00.000Z",
    "updatedAt": "2026-05-11T10:00:00.000Z"
  }

To create a deal it is required to define a companyId in the payload. You can reference the company using its externalId or sourceId with the following structure: "companyId": "extid-[company externalId]" or "companyId": "srcid-[company sourceId]".

Example Request
  curl --location -g --request POST 'https://api.planhat.com/deals' \
    --header 'Content-Type: application/json' \                                                                                                                                                             
    --header 'Authorization: Bearer {{apiToken}}' \                                                                                                                                                         
    --data-raw '{                                  
      "name": "Acme Renewal 2026",                                                                                                                                                                          
      "companyId": "61006bc89a3e0b702ed8ea49",                                                                                                                                                              
      "stage": "Negotiation",
      "mrr": 5000,                                                                                                                                                                                          
      "closeDate": "2026-09-30"
    }'


Example Response
  Example Response
  {
    "_id": "610091916d643a7c418aef42",
    "name": "Acme Renewal 2026",      
    "companyId": "61006bc89a3e0b702ed8ea49",                                                                                                                                                                
    "companyName": "Acme",                  
    "stage": "Negotiation",                                                                                                                                                                                 
    "mrr": 5000,           
    "arr": 60000,                                                                                                                                                                                           
    "closeDate": "2026-09-30T00:00:00.000Z",
    "subscriptionsCount": 0,                                                                                                                                                                                
    "feesCount": 0,         
    "activeSubscriptionsCount": 0,                                                                                                                                                                          
    "followers": [],              
    "custom": {},                                                                                                                                                                                           
    "createdAt": "2026-05-11T10:00:00.000Z",
    "updatedAt": "2026-05-11T10:00:00.000Z"
  }

To create a deal it is required to define a companyId in the payload. You can reference the company using its externalId or sourceId with the following structure: "companyId": "extid-[company externalId]" or "companyId": "srcid-[company sourceId]".

Example Request
  curl --location -g --request POST 'https://api.planhat.com/deals' \
    --header 'Content-Type: application/json' \                                                                                                                                                             
    --header 'Authorization: Bearer {{apiToken}}' \                                                                                                                                                         
    --data-raw '{                                  
      "name": "Acme Renewal 2026",                                                                                                                                                                          
      "companyId": "61006bc89a3e0b702ed8ea49",                                                                                                                                                              
      "stage": "Negotiation",
      "mrr": 5000,                                                                                                                                                                                          
      "closeDate": "2026-09-30"
    }'


Example Response
  Example Response
  {
    "_id": "610091916d643a7c418aef42",
    "name": "Acme Renewal 2026",      
    "companyId": "61006bc89a3e0b702ed8ea49",                                                                                                                                                                
    "companyName": "Acme",                  
    "stage": "Negotiation",                                                                                                                                                                                 
    "mrr": 5000,           
    "arr": 60000,                                                                                                                                                                                           
    "closeDate": "2026-09-30T00:00:00.000Z",
    "subscriptionsCount": 0,                                                                                                                                                                                
    "feesCount": 0,         
    "activeSubscriptionsCount": 0,                                                                                                                                                                          
    "followers": [],              
    "custom": {},                                                                                                                                                                                           
    "createdAt": "2026-05-11T10:00:00.000Z",
    "updatedAt": "2026-05-11T10:00:00.000Z"
  }
https://api.planhat.com/deals/:_id

To update a deal it is required to pass the _id in the request URL as a parameter. Alternatively it is possible to update using the deal externalId or sourceId by adding a prefix: https://api.planhat.com/deals/extid-{{externalId}}

or

https://api.planhat.com/deals/srcid-{{sourceId}}

Example Request
 curl --location -g --request PUT 'https://api.planhat.com/deals/610091916d643a7c418aef42' \
    --header 'Content-Type: application/json' \                                              
    --header 'Authorization: Bearer {{apiToken}}' \                                                                                                                                                         
    --data-raw '{                                  
      "stage": "Closed Won",                                                                                                                                                                                
      "closeDate": "2026-05-10"
    }' 
Example Response
 Example Response
  {                                                                                                                                                                                                         
    "_id": "610091916d643a7c418aef42",
    "name": "Acme Renewal 2026",      
    "companyId": "61006bc89a3e0b702ed8ea49",
    "companyName": "Acme",                  
    "stage": "Closed Won",                                                                                                                                                                                  
    "mrr": 5000,          
    "arr": 60000,                                                                                                                                                                                           
    "closeDate": "2026-05-10T00:00:00.000Z",
    "updatedAt": "2026-05-11T10:05:00.000Z"
  }

https://api.planhat.com/deals/:_id

To update a deal it is required to pass the _id in the request URL as a parameter. Alternatively it is possible to update using the deal externalId or sourceId by adding a prefix: https://api.planhat.com/deals/extid-{{externalId}}

or

https://api.planhat.com/deals/srcid-{{sourceId}}

Example Request
 curl --location -g --request PUT 'https://api.planhat.com/deals/610091916d643a7c418aef42' \
    --header 'Content-Type: application/json' \                                              
    --header 'Authorization: Bearer {{apiToken}}' \                                                                                                                                                         
    --data-raw '{                                  
      "stage": "Closed Won",                                                                                                                                                                                
      "closeDate": "2026-05-10"
    }' 
Example Response
 Example Response
  {                                                                                                                                                                                                         
    "_id": "610091916d643a7c418aef42",
    "name": "Acme Renewal 2026",      
    "companyId": "61006bc89a3e0b702ed8ea49",
    "companyName": "Acme",                  
    "stage": "Closed Won",                                                                                                                                                                                  
    "mrr": 5000,          
    "arr": 60000,                                                                                                                                                                                           
    "closeDate": "2026-05-10T00:00:00.000Z",
    "updatedAt": "2026-05-11T10:05:00.000Z"
  }

https://api.planhat.com/deals/:_id

To update a deal it is required to pass the _id in the request URL as a parameter. Alternatively it is possible to update using the deal externalId or sourceId by adding a prefix: https://api.planhat.com/deals/extid-{{externalId}}

or

https://api.planhat.com/deals/srcid-{{sourceId}}

Example Request
 curl --location -g --request PUT 'https://api.planhat.com/deals/610091916d643a7c418aef42' \
    --header 'Content-Type: application/json' \                                              
    --header 'Authorization: Bearer {{apiToken}}' \                                                                                                                                                         
    --data-raw '{                                  
      "stage": "Closed Won",                                                                                                                                                                                
      "closeDate": "2026-05-10"
    }' 
Example Response
 Example Response
  {                                                                                                                                                                                                         
    "_id": "610091916d643a7c418aef42",
    "name": "Acme Renewal 2026",      
    "companyId": "61006bc89a3e0b702ed8ea49",
    "companyName": "Acme",                  
    "stage": "Closed Won",                                                                                                                                                                                  
    "mrr": 5000,          
    "arr": 60000,                                                                                                                                                                                           
    "closeDate": "2026-05-10T00:00:00.000Z",
    "updatedAt": "2026-05-11T10:05:00.000Z"
  }

https://api.planhat.com/deals/:_id

To get a specific deal it is required to pass the _id in the request URL as a parameter. Alternatively it is possible to get a deal using its externalId or sourceId:

https://api.planhat.com/deals/extid-{{externalId}}

or

https://api.planhat.com/deals/srcid-{{sourceId}}

Example Request
curl --location -g --request GET 'https://api.planhat.com/deals/610091916d643a7c418aef42' \
    --header 'Content-Type: application/json' \                                                                                                                                                             
    --header 'Authorization: Bearer {{apiToken}}'

Example Response
{
    "_id": "610091916d643a7c418aef42",                                                                                                                                                                      
    "name": "Acme Renewal 2026",      
    "companyId": "61006bc89a3e0b702ed8ea49",
    "companyName": "Acme",                  
    "stage": "Closed Won",                                                                                                                                                                                  
    "ownerId": "60f1b2c3d4e5f6a7b8c9d0e1",
    "mrr": 5000,                                                                                                                                                                                            
    "arr": 60000,                                                                                                                                                                                           
    "total": 60000,
    "closeDate": "2026-05-10T00:00:00.000Z",                                                                                                                                                                
    "renewalDate": "2027-05-10T00:00:00.000Z",
    "startDate": "2026-06-01T00:00:00.000Z",                                                                                                                                                                
    "endDate": "2027-05-31T00:00:00.000Z",                                                                                                                                                                  
    "subscriptionsCount": 1,              
    "feesCount": 0,                                                                                                                                                                                         
    "activeSubscriptionsCount": 1,
    "followers": [],                                                                                                                                                                                        
    "custom": {},   
    "createdAt": "2026-05-11T10:00:00.000Z",
    "updatedAt": "2026-05-11T10:05:00.000Z"
  }
https://api.planhat.com/deals/:_id

To get a specific deal it is required to pass the _id in the request URL as a parameter. Alternatively it is possible to get a deal using its externalId or sourceId:

https://api.planhat.com/deals/extid-{{externalId}}

or

https://api.planhat.com/deals/srcid-{{sourceId}}

Example Request
curl --location -g --request GET 'https://api.planhat.com/deals/610091916d643a7c418aef42' \
    --header 'Content-Type: application/json' \                                                                                                                                                             
    --header 'Authorization: Bearer {{apiToken}}'

Example Response
{
    "_id": "610091916d643a7c418aef42",                                                                                                                                                                      
    "name": "Acme Renewal 2026",      
    "companyId": "61006bc89a3e0b702ed8ea49",
    "companyName": "Acme",                  
    "stage": "Closed Won",                                                                                                                                                                                  
    "ownerId": "60f1b2c3d4e5f6a7b8c9d0e1",
    "mrr": 5000,                                                                                                                                                                                            
    "arr": 60000,                                                                                                                                                                                           
    "total": 60000,
    "closeDate": "2026-05-10T00:00:00.000Z",                                                                                                                                                                
    "renewalDate": "2027-05-10T00:00:00.000Z",
    "startDate": "2026-06-01T00:00:00.000Z",                                                                                                                                                                
    "endDate": "2027-05-31T00:00:00.000Z",                                                                                                                                                                  
    "subscriptionsCount": 1,              
    "feesCount": 0,                                                                                                                                                                                         
    "activeSubscriptionsCount": 1,
    "followers": [],                                                                                                                                                                                        
    "custom": {},   
    "createdAt": "2026-05-11T10:00:00.000Z",
    "updatedAt": "2026-05-11T10:05:00.000Z"
  }
https://api.planhat.com/deals/:_id

To get a specific deal it is required to pass the _id in the request URL as a parameter. Alternatively it is possible to get a deal using its externalId or sourceId:

https://api.planhat.com/deals/extid-{{externalId}}

or

https://api.planhat.com/deals/srcid-{{sourceId}}

Example Request
curl --location -g --request GET 'https://api.planhat.com/deals/610091916d643a7c418aef42' \
    --header 'Content-Type: application/json' \                                                                                                                                                             
    --header 'Authorization: Bearer {{apiToken}}'

Example Response
{
    "_id": "610091916d643a7c418aef42",                                                                                                                                                                      
    "name": "Acme Renewal 2026",      
    "companyId": "61006bc89a3e0b702ed8ea49",
    "companyName": "Acme",                  
    "stage": "Closed Won",                                                                                                                                                                                  
    "ownerId": "60f1b2c3d4e5f6a7b8c9d0e1",
    "mrr": 5000,                                                                                                                                                                                            
    "arr": 60000,                                                                                                                                                                                           
    "total": 60000,
    "closeDate": "2026-05-10T00:00:00.000Z",                                                                                                                                                                
    "renewalDate": "2027-05-10T00:00:00.000Z",
    "startDate": "2026-06-01T00:00:00.000Z",                                                                                                                                                                
    "endDate": "2027-05-31T00:00:00.000Z",                                                                                                                                                                  
    "subscriptionsCount": 1,              
    "feesCount": 0,                                                                                                                                                                                         
    "activeSubscriptionsCount": 1,
    "followers": [],                                                                                                                                                                                        
    "custom": {},   
    "createdAt": "2026-05-11T10:00:00.000Z",
    "updatedAt": "2026-05-11T10:05:00.000Z"
  }
https://api.planhat.com/deals

To create a deal, companyId is required along with at least one of: externalId, sourceId, or name.

To update a deal, specify one of the following keyables (in order of priority): _id, sourceId, externalId.

This endpoint supports creating and updating up to 5,000 deals in a single request.

Example Request
curl --location -g --request PUT 'https://api.planhat.com/deals' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {{apiToken}}' \
  --data-raw '[
    {
      "externalId": "deal-001",
      "companyId": "61006bc89a3e0b702ed8ea49",
      "name": "Acme Renewal 2026",
      "mrr": 5000,
      "stage": "Negotiation"
    },
    {
      "externalId": "deal-002",
      "companyId": "extid-acme-corp",
      "name": "Acme Expansion",
      "mrr": 2000,
      "stage": "Prospecting"
    }
  ]

Example Response
{
  "created": 1,
  "createdErrors": [],
  "insertsKeys": [
    {
      "_id": "610096a46d643a7c418af043",
      "externalId": "deal-002"
    }
  ],
  "updated": 1,
  "updatedErrors": [],
  "updatesKeys": [
    {
      "_id": "610091916d643a7c418aef42",
      "externalId": "deal-001"
    }
  ],
  "nonupdates": 0,
  "modified": [],
  "upsertedIds": ["610096a46d643a7c418af043"],
  "permissionErrors": []
}
https://api.planhat.com/deals

To create a deal, companyId is required along with at least one of: externalId, sourceId, or name.

To update a deal, specify one of the following keyables (in order of priority): _id, sourceId, externalId.

This endpoint supports creating and updating up to 5,000 deals in a single request.

Example Request
curl --location -g --request PUT 'https://api.planhat.com/deals' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {{apiToken}}' \
  --data-raw '[
    {
      "externalId": "deal-001",
      "companyId": "61006bc89a3e0b702ed8ea49",
      "name": "Acme Renewal 2026",
      "mrr": 5000,
      "stage": "Negotiation"
    },
    {
      "externalId": "deal-002",
      "companyId": "extid-acme-corp",
      "name": "Acme Expansion",
      "mrr": 2000,
      "stage": "Prospecting"
    }
  ]

Example Response
{
  "created": 1,
  "createdErrors": [],
  "insertsKeys": [
    {
      "_id": "610096a46d643a7c418af043",
      "externalId": "deal-002"
    }
  ],
  "updated": 1,
  "updatedErrors": [],
  "updatesKeys": [
    {
      "_id": "610091916d643a7c418aef42",
      "externalId": "deal-001"
    }
  ],
  "nonupdates": 0,
  "modified": [],
  "upsertedIds": ["610096a46d643a7c418af043"],
  "permissionErrors": []
}
https://api.planhat.com/deals

To create a deal, companyId is required along with at least one of: externalId, sourceId, or name.

To update a deal, specify one of the following keyables (in order of priority): _id, sourceId, externalId.

This endpoint supports creating and updating up to 5,000 deals in a single request.

Example Request
curl --location -g --request PUT 'https://api.planhat.com/deals' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {{apiToken}}' \
  --data-raw '[
    {
      "externalId": "deal-001",
      "companyId": "61006bc89a3e0b702ed8ea49",
      "name": "Acme Renewal 2026",
      "mrr": 5000,
      "stage": "Negotiation"
    },
    {
      "externalId": "deal-002",
      "companyId": "extid-acme-corp",
      "name": "Acme Expansion",
      "mrr": 2000,
      "stage": "Prospecting"
    }
  ]

Example Response
{
  "created": 1,
  "createdErrors": [],
  "insertsKeys": [
    {
      "_id": "610096a46d643a7c418af043",
      "externalId": "deal-002"
    }
  ],
  "updated": 1,
  "updatedErrors": [],
  "updatesKeys": [
    {
      "_id": "610091916d643a7c418aef42",
      "externalId": "deal-001"
    }
  ],
  "nonupdates": 0,
  "modified": [],
  "upsertedIds": ["610096a46d643a7c418af043"],
  "permissionErrors": []
}
https://api.planhat.com/deals/:_id

To delete a deal it is required to pass the _id in the request URL as a parameter.

Example Request
curl --location -g --request DELETE 'https://api.planhat.com/deals/610091916d643a7c418aef42' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {{apiToken}}'
Example Response
{
  "n": 1,
  "ok": 1,
  "deletedCount": 1
}
https://api.planhat.com/deals/:_id

To delete a deal it is required to pass the _id in the request URL as a parameter.

Example Request
curl --location -g --request DELETE 'https://api.planhat.com/deals/610091916d643a7c418aef42' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {{apiToken}}'
Example Response
{
  "n": 1,
  "ok": 1,
  "deletedCount": 1
}
https://api.planhat.com/deals/:_id

To delete a deal it is required to pass the _id in the request URL as a parameter.

Example Request
curl --location -g --request DELETE 'https://api.planhat.com/deals/610091916d643a7c418aef42' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {{apiToken}}'
Example Response
{
  "n": 1,
  "ok": 1,
  "deletedCount": 1
}
https://api.planhat.com/deals

To create a deal, companyId is required along with at least one of: externalId, sourceId, or name.

To update a deal, specify one of the following keyables (in order of priority): _id, sourceId, externalId.

This endpoint supports creating and updating up to 5,000 deals in a single request.

Example Request
curl --location -g --request PUT 'https://api.planhat.com/deals' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {{apiToken}}' \
  --data-raw '[
    {
      "externalId": "deal-001",
      "companyId": "61006bc89a3e0b702ed8ea49",
      "name": "Acme Renewal 2026",
      "mrr": 5000,
      "stage": "Negotiation"
    },
    {
      "externalId": "deal-002",
      "companyId": "extid-acme-corp",
      "name": "Acme Expansion",
      "mrr": 2000,
      "stage": "Prospecting"
    }
  ]

Example Response
{
  "created": 1,
  "createdErrors": [],
  "insertsKeys": [
    {
      "_id": "610096a46d643a7c418af043",
      "externalId": "deal-002"
    }
  ],
  "updated": 1,
  "updatedErrors": [],
  "updatesKeys": [
    {
      "_id": "610091916d643a7c418aef42",
      "externalId": "deal-001"
    }
  ],
  "nonupdates": 0,
  "modified": [],
  "upsertedIds": ["610096a46d643a7c418af043"],
  "permissionErrors": []
}
https://api.planhat.com/deals

To create a deal, companyId is required along with at least one of: externalId, sourceId, or name.

To update a deal, specify one of the following keyables (in order of priority): _id, sourceId, externalId.

This endpoint supports creating and updating up to 5,000 deals in a single request.

Example Request
curl --location -g --request PUT 'https://api.planhat.com/deals' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {{apiToken}}' \
  --data-raw '[
    {
      "externalId": "deal-001",
      "companyId": "61006bc89a3e0b702ed8ea49",
      "name": "Acme Renewal 2026",
      "mrr": 5000,
      "stage": "Negotiation"
    },
    {
      "externalId": "deal-002",
      "companyId": "extid-acme-corp",
      "name": "Acme Expansion",
      "mrr": 2000,
      "stage": "Prospecting"
    }
  ]

Example Response
{
  "created": 1,
  "createdErrors": [],
  "insertsKeys": [
    {
      "_id": "610096a46d643a7c418af043",
      "externalId": "deal-002"
    }
  ],
  "updated": 1,
  "updatedErrors": [],
  "updatesKeys": [
    {
      "_id": "610091916d643a7c418aef42",
      "externalId": "deal-001"
    }
  ],
  "nonupdates": 0,
  "modified": [],
  "upsertedIds": ["610096a46d643a7c418af043"],
  "permissionErrors": []
}
https://api.planhat.com/deals

To create a deal, companyId is required along with at least one of: externalId, sourceId, or name.

To update a deal, specify one of the following keyables (in order of priority): _id, sourceId, externalId.

This endpoint supports creating and updating up to 5,000 deals in a single request.

Example Request
curl --location -g --request PUT 'https://api.planhat.com/deals' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {{apiToken}}' \
  --data-raw '[
    {
      "externalId": "deal-001",
      "companyId": "61006bc89a3e0b702ed8ea49",
      "name": "Acme Renewal 2026",
      "mrr": 5000,
      "stage": "Negotiation"
    },
    {
      "externalId": "deal-002",
      "companyId": "extid-acme-corp",
      "name": "Acme Expansion",
      "mrr": 2000,
      "stage": "Prospecting"
    }
  ]

Example Response
{
  "created": 1,
  "createdErrors": [],
  "insertsKeys": [
    {
      "_id": "610096a46d643a7c418af043",
      "externalId": "deal-002"
    }
  ],
  "updated": 1,
  "updatedErrors": [],
  "updatesKeys": [
    {
      "_id": "610091916d643a7c418aef42",
      "externalId": "deal-001"
    }
  ],
  "nonupdates": 0,
  "modified": [],
  "upsertedIds": ["610096a46d643a7c418af043"],
  "permissionErrors": []
}