SautiDesk
SautiDesk API
Sales

Open a lead for a contact

POST
/v1/desk/leads

Opens a lead for a contact, for a phone number (making the contact if needed) or from a ticket. A contact has at most one open lead: when there is one already the answer is 200 with opened false and that lead, otherwise 201 with opened true. Without source_id the source comes from the ticket's channel, and 422 lead.source_required when there is none. Answers 403 desk.sales_off while Sales is switched off.

Requires: desk.write scope, Converse or Contacts licence, Pro plan.

Authorization

bearerAuth
AuthorizationBearer <token>

A SautiDesk API key. An owner or admin makes it under Settings in SautiDesk for a named person and picks the scopes. The key is shown once. Send it as Authorization: Bearer <key>. It acts as that person and as nobody else.

In: header

Request Body

application/json

Response

OK

Example

{  "opened": false,  "id": "3f2b8c1e-5a4d-4e7b-9c10-2d6a8e4f1b37"}
FieldTypeDescription
openedrequiredany
idrequiredstring (uuid)
curl -X POST "https://api.sautidesk.com/v1/desk/leads" \  -H "Content-Type: application/json" \  -d '{    "contact_id": "e370603e-5791-443e-9fb1-26dedb014cd9",    "to": "+254712345678",    "name": "Amina Wanjiru",    "ticket_id": "b1e8bf6f-7f06-4c91-96dd-a1eb7abe504b",    "source_id": "2e953c78-1606-4098-9709-061f8b3d7860",    "stage_id": "bfed4519-9865-4baf-930a-0ac87c16a093",    "value_minor": 1,    "currency": "KES",    "temperature": "example",    "queue_id": "c70c2d37-4d65-4ba4-9843-5e8aaf2dae40",    "owner_id": "1dc86aaf-2f65-4b1b-9ef7-7dabe869da64",    "tags": [      "example"    ],    "company": "Example Ltd",    "lead_name": "example"  }'