RaabtaHQ
Create a deal

Create a deal

POST/api/v1/deals

scope deals:writeIdempotent

Creates a deal. Omit pipeline_id to use the account’s first pipeline, and stage_id to use that pipeline’s first stage. A stage must belong to the chosen pipeline.

Body

application/json
NameTypeDescription
titlerequired
string
valueoptional
numberDefaults to 0
currencyoptional
stringISO 4217; defaults to USD
pipeline_idoptional
string (uuid)UUID
stage_idoptional
string (uuid)UUID
contact_idoptional
string (uuid) | null
conversation_idoptional
string (uuid) | null
assigned_tooptional
string (uuid) | nullMember user id from GET /members
notesoptional
string | null
expected_close_dateoptional
string | null
Request
curl -X POST "https://your-crm.example.com/api/v1/deals" \
  -H "Authorization: Bearer $RAABTA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2a9e-3b4d-4c5e-8f7a-9b0c1d2e3f4a" \
  -d '{
    "title": "Khan Trading — annual package",
    "value": 12000,
    "currency": "AED",
    "contact_id": "9d7e4c11-5a2b-4f7c-8e3d-2a1b0c9d8e7f",
    "stage_id": "c3d4e5f6-a7b8-4c9d-8e1f-2a3b4c5d6e7f",
    "expected_close_date": "2026-10-15"
  }'
Response · 201 Created
{
  "data": {
    "id": "e5f6a7b8-c9d0-4e1f-8a3b-4c5d6e7f8a9b",
    "title": "Khan Trading — annual package",
    "value": 12000,
    "currency": "AED",
    "status": "open",
    "pipeline_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
    "stage_id": "c3d4e5f6-a7b8-4c9d-8e1f-2a3b4c5d6e7f",
    "stage": {
      "id": "c3d4e5f6-a7b8-4c9d-8e1f-2a3b4c5d6e7f",
      "name": "Qualified"
    },
    "contact_id": "9d7e4c11-5a2b-4f7c-8e3d-2a1b0c9d8e7f",
    "conversation_id": null,
    "assigned_to": "2f3e4d5c-6b7a-4c8d-9e0f-1a2b3c4d5e6f",
    "notes": null,
    "expected_close_date": "2026-10-15",
    "created_at": "2026-09-01T08:15:00.000Z",
    "updated_at": "2026-09-02T10:00:00.000Z"
  }
}

Response

Wrapped in { data: … }
NameTypeDescription
idrequired
string (uuid)UUID
titlerequired
stringWhat the deal is for
valuerequired
numberDeal value as a number (the API coerces the decimal column)
currencyrequired
string | nullISO 4217 code
statusrequired
string (enum)Outcome; a deal is open until it is closedopenwonlost
pipeline_idrequired
string (uuid)UUID
stage_idrequired
string (uuid)UUID
stagerequired
object | nullThe stage the deal currently sits in
stage.idrequired
string (uuid)UUID
stage.namerequired
stringStage name
contact_idrequired
string (uuid) | null
conversation_idrequired
string (uuid) | null
assigned_torequired
string (uuid) | nullMember user id
notesrequired
string | nullFree-text notes on the deal
expected_close_daterequired
string | nullYYYY-MM-DD
created_atrequired
string (date-time)ISO 8601 timestamp
updated_atrequired
string (date-time)ISO 8601 timestamp

Errors

StatusCodeWhen
400bad_requestThe request could not be parsed: malformed JSON, an invalid cursor, or a query parameter of the wrong shape.
400validation_errorThe body or query failed validation. `details` lists each failing field with a `path` and a `message`.
401unauthorizedNo usable API key: the Authorization header is missing or malformed, or the key is unknown, revoked or expired. The three are deliberately indistinguishable.
403forbiddenThe key is valid but lacks the scope this endpoint requires, or the request came from an address outside the key’s IP allowlist. The message says which.
403account_suspendedThe account this key belongs to is suspended. Rotating the key will not help; contact support.
409conflictThe request conflicts with current state: a duplicate phone number on create, an invalid state transition, or an idempotent request that is still in flight.
422unprocessableThe request was well-formed but cannot be carried out. `reason` is a stable string saying why (for example `outside_window` or `stage_not_in_pipeline`).
429rate_limitedThe per-key budget, or the per-IP budget for failed authentication, is exhausted. Honour `Retry-After` before retrying.
500internalSomething failed on our side. Safe to retry with the same Idempotency-Key; quote `request_id` if it persists.