Skip to content
Documentation
Hevia for developers

Deals

Deals in the sales pipeline, with value in cents and the stage they are in.

Deals in the sales pipeline, with value in cents and the stage they are in.

List deals

GET /deals

ScopePackageIdempotency-Key
deals:readScale (API)not used

updated_since must be an ISO date-time; otherwise 400 invalid_request with field updated_since.

Parameters

NameInTypeDescription
limitqueryinteger1 to 100. Default 25.
offsetqueryintegerDefault 0.
stagequerystring
contact_idquerystringContact id (e:…, p:…, m:…).
updated_sincequerystring (date-time)ISO moment; only records changed at or after it.

Request

curl "https://hevia.app/api/v1/deals?updated_since=2026-11-01T00:00:00Z" \
  -H "Authorization: Bearer $HEVIA_KEY"

Response

200 OK.

JSON
{
  "data": [
    {
      "id": "3f1c2a9e-5b7d-4e21-9c0a-6d8e2f4b1a70",
      "title": "Website relaunch",
      "value_cents": 480000,
      "currency": "EUR",
      "stage": "proposal",
      "contact_id": "e:anna@example.com",
      "company_id": "3f1c2a9e-5b7d-4e21-9c0a-6d8e2f4b1a70",
      "expected_close": "2026-12-15",
      "created_at": "2026-11-10T09:30:00.000Z",
      "updated_at": "2026-11-10T09:30:00.000Z",
      "closed_at": "2026-11-10T09:30:00.000Z"
    }
  ],
  "pagination": {
    "limit": 25,
    "offset": 0,
    "total": 1,
    "next_offset": null
  }
}

Fields of Deal:

FieldTypeDescription
idstring (uuid)
titlestring
value_centsinteger
currencystring
stagestring
contact_idstring | null
company_idstring | null
expected_closestring | null
created_atstring (date-time)
updated_atstring (date-time)
closed_atstring | null

Errors

StatusCodeWhen
400invalid_requestInvalid request
401unauthorizedMissing or invalid key
403insufficient_scopeThe key or token does not have the scope of the endpoint.
403plan_requiredThe business's package does not include the API (Scale) or the feature of the endpoint.
429rate_limitedRate limit (120 requests per minute and key); see the RateLimit-* headers

One deal

GET /deals/{id}

ScopePackageIdempotency-Key
deals:readScale (API)not used

Parameters

NameInTypeDescription
id (required)pathstring (uuid)Id

Request

curl "https://hevia.app/api/v1/deals/3f1c2a9e-5b7d-4e21-9c0a-6d8e2f4b1a70" \
  -H "Authorization: Bearer $HEVIA_KEY"

Response

200 OK.

JSON
{
  "data": {
    "id": "3f1c2a9e-5b7d-4e21-9c0a-6d8e2f4b1a70",
    "title": "Website relaunch",
    "value_cents": 480000,
    "currency": "EUR",
    "stage": "proposal",
    "contact_id": "e:anna@example.com",
    "company_id": "3f1c2a9e-5b7d-4e21-9c0a-6d8e2f4b1a70",
    "expected_close": "2026-12-15",
    "created_at": "2026-11-10T09:30:00.000Z",
    "updated_at": "2026-11-10T09:30:00.000Z",
    "closed_at": "2026-11-10T09:30:00.000Z"
  }
}

Fields of Deal:

FieldTypeDescription
idstring (uuid)
titlestring
value_centsinteger
currencystring
stagestring
contact_idstring | null
company_idstring | null
expected_closestring | null
created_atstring (date-time)
updated_atstring (date-time)
closed_atstring | null

Errors

StatusCodeWhen
401unauthorizedMissing or invalid key
403insufficient_scopeThe key or token does not have the scope of the endpoint.
403plan_requiredThe business's package does not include the API (Scale) or the feature of the endpoint.
404not_foundNot found
429rate_limitedRate limit (120 requests per minute and key); see the RateLimit-* headers

Create a deal

POST /deals

ScopePackageIdempotency-Key
deals:writeScale (API)honoured

value_cents is a whole number from 0 to 1 000 000 000 000. Without stage the deal starts in the first open stage of the pipeline.

Request body

JSON object DealInput.

FieldTypeDescription
title (required)string
value_centsinteger
currencystring
stagestringStage id of the pipeline; default: the first open stage.
contact_idstring
company_idstring (uuid)
expected_closestring (date)
notestring

Request

curl -X POST "https://hevia.app/api/v1/deals" \
  -H "Authorization: Bearer $HEVIA_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"title":"Website relaunch","value_cents":480000,"currency":"EUR","contact_id":"e:anna@example.com"}'

Response

200 Updated or replayed, 201 Created.

JSON
{
  "data": {
    "id": "3f1c2a9e-5b7d-4e21-9c0a-6d8e2f4b1a70",
    "title": "Website relaunch",
    "value_cents": 480000,
    "currency": "EUR",
    "stage": "proposal",
    "contact_id": "e:anna@example.com",
    "company_id": "3f1c2a9e-5b7d-4e21-9c0a-6d8e2f4b1a70",
    "expected_close": "2026-12-15",
    "created_at": "2026-11-10T09:30:00.000Z",
    "updated_at": "2026-11-10T09:30:00.000Z",
    "closed_at": "2026-11-10T09:30:00.000Z"
  },
  "created": true
}

Fields of Deal:

FieldTypeDescription
idstring (uuid)
titlestring
value_centsinteger
currencystring
stagestring
contact_idstring | null
company_idstring | null
expected_closestring | null
created_atstring (date-time)
updated_atstring (date-time)
closed_atstring | null

Errors

StatusCodeWhen
400invalid_requestInvalid request
401unauthorizedMissing or invalid key
403insufficient_scopeThe key or token does not have the scope of the endpoint.
403plan_requiredThe business's package does not include the API (Scale) or the feature of the endpoint.
409conflictIdempotency-Key conflict (same key, different request, or still running)
413payload_too_largeBody too large
422invalid_requestInvalid body
429rate_limitedRate limit (120 requests per minute and key); see the RateLimit-* headers

Generated from the product's own registries, so the reference matches the API.