Skip to main content

Endpoints

MethodPathPurpose
GET/dealsList, paginated. ?expand=primary_company,primary_person
POST/dealsCreate
GET/deals/:idFetch one. Same ?expand= options
PATCH/deals/:idUpdate
DELETE/deals/:idDelete

Fields

FieldTypeNotes
iduuid
namestringRequired
stagestringDefaults to "open". Free-form — no enum enforcement in v1
value_centsstring | nullbigint serialized as a string (avoids JS precision loss)
currencystring | nullDefaults to "USD"; 3 chars
primary_company_iduuid | null
primary_person_iduuid | null
custom_attributesobjectValidated by the schema engine
closed_atdatetime | nullSet when stage moves to a closed state
created_at, updated_atdatetime

Create

curl -X POST $SALTY_API/deals \
  -H "Authorization: Bearer $SALTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme - Enterprise Q3",
    "stage": "negotiation",
    "value_cents": "15000000",
    "currency": "USD",
    "primary_company_id": "<company-uuid>",
    "primary_person_id": "<person-uuid>"
  }'
value_cents is a string in JSON because Postgres bigint exceeds JavaScript’s Number.MAX_SAFE_INTEGER. Parse it client-side with BigInt(deal.value_cents) if you need to do arithmetic.

Expand both relations

curl "$SALTY_API/deals/<id>?expand=primary_company,primary_person" \
  -H "Authorization: Bearer $SALTY_API_KEY"
The response inlines primary_company and primary_person using the same serializers as /companies/:id and /people/:id.