Synq
Skip to content
[ synq / docs ]Synq home

Leads and offers

Staff inbox, takeover, invitations, offers and policy validation.

A lead is an outside prospect talking to a business through a private link. The sales agent answers while handling is AGENT; staff can take over (HUMAN), hand back, freeze offers or escalate. Takeover uses optimistic concurrency: send expectedVersion and a stale value answers 409 VERSION_CONFLICT. Staff messages and offers are accepted only while handling is HUMAN (otherwise 409 TAKEOVER_REQUIRED).

Offers are checked by deterministic commercial policy code, never by the model. A send that fails a check returns sent: false with the failed checks. A send above the owner threshold needs an owner signature from the approvals inbox. Invitation creation is throttled to 30 a minute per workspace; redeeming to 10 a minute per principal.

Routes#

GET /v3/workspaces/{workspaceId}/inbox#

Private leads, newest activity first.

Route idworkspace.inbox
AuthSession (bearer or cookie)
Who may callOWNER, ADMIN
StatusIMPLEMENTED

Path parameters: workspaceId (UUIDs unless stated).

Query parameters

FieldTypeRequiredNotes
cursorstring (max 200, min 1)no
limitinteger (min 1, max 100)no
stageLEAD_OPEN, DISCOVERY, QUALIFIED, OFFER_DRAFTED, OFFER_VALIDATED, OFFER_SENT, NEGOTIATING, AGREED_PENDING_SIGNATURES, SIGNED, FUNDING_PENDING, FUNDED, ACTIVE, DELIVERED, ACCEPTANCE_PENDING, RELEASED, REFUNDED, DISPUTED, CANCELLEDno
handlingAGENT, HUMAN, FROZENno

Response (InboxPage)

FieldTypeRequiredNotes
itemsLeadSummary[]yes
nextCursorstring (max 200, min 1) or nullyes

Example response (synthetic fixture):

json
{
  "items": [
    {
      "leadId": "00000000-0000-4000-8000-000000000003",
      "workspaceId": "00000000-0000-4000-8000-000000000001",
      "label": "Telegram lead · 4F2A",
      "source": "TELEGRAM",
      "stage": "NEGOTIATING",
      "handling": "AGENT",
      "needsOwner": false,
      "unread": 2,
      "lastActivityAt": "2026-10-17T10:03:00.000Z"
    }
  ],
  "nextCursor": null
}

GET /v3/workspaces/{workspaceId}/leads/{leadId}#

Lead summary, consented transcript and offer versions.

Route idworkspace.lead
AuthSession (bearer or cookie)
Who may callOWNER, ADMIN
StatusIMPLEMENTED

Path parameters: workspaceId, leadId (UUIDs unless stated).

Response (LeadDetail)

FieldTypeRequiredNotes
leadLeadSummaryyes
handlingVersioninteger (min 0)yes
consentobjectyes
consent.grantedbooleanyes
consent.grantedAtISO-8601 time or nullyes
consent.scopestring (max 200)yes
messagesLeadMessage[]yes
olderMessagesCursorstring (max 200, min 1) or nullyes
offersOfferVersion[]yes

Example response (synthetic fixture):

json
{
  "lead": {
    "leadId": "00000000-0000-4000-8000-000000000003",
    "workspaceId": "00000000-0000-4000-8000-000000000001",
    "label": "Telegram lead · 4F2A",
    "source": "TELEGRAM",
    "stage": "NEGOTIATING",
    "handling": "AGENT",
    "needsOwner": false,
    "unread": 2,
    "lastActivityAt": "2026-10-17T10:03:00.000Z"
  },
  "handlingVersion": 3,
  "consent": {
    "granted": true,
    "grantedAt": "2026-10-17T10:01:00.000Z",
    "scope": "The business may read this private conversation."
  },
  "messages": [
    {
      "messageId": "00000000-0000-4000-8000-000000000014",
      "author": "LEAD",
      "text": "Can you do a logo and two banners by Friday?",
      "offerVersion": null,
      "createdAt": "2026-10-17T10:02:00.000Z"
    },
    {
      "messageId": "00000000-0000-4000-8000-000000000015",
      "author": "AGENT",
      "text": "Yes. Here is an offer for 120 USDC in two milestones.",
      "offerVersion": 1,
      "createdAt": "2026-10-17T10:03:00.000Z"
    }
  ],
  "olderMessagesCursor": null,
  "offers": [
    {
      "offerId": "00000000-0000-4000-8000-000000000005",
      "version": 1,
      "termsHash": "0xc71c916768de28c0c224036e9c9fd7976ff24124a24445f4b37b571ff78d8075",
      "previousTermsHash": null,
      "policyVersion": 2,
      "status": "SENT",
      "createdBy": "AGENT",
      "total": {
        "assetId": "arc-testnet:USDC",
        "symbol": "USDC",
        "chainId": 5042002,
        "decimals": 6,
        "units": "120000000"
      },
      "lines": [
        {
          "description": "Logo and two banners",
          "quantity": 1,
          "unitUnits": "120000000",
          "totalUnits": "120000000"
        }
      ],
      "milestones": [
        {
          "label": "Drafts",
          "units": "60000000",
          "dueAt": "2026-10-19T10:00:00.000Z"
        },
        {
          "label": "Final files",
          "units": "60000000",
          "dueAt": "2026-10-21T10:00:00.000Z"
        }
      ],
      "expiresAt": "2026-10-18T10:00:00.000Z",
      "createdAt": "2026-10-17T10:03:00.000Z"
    }
  ]
}

POST /v3/workspaces/{workspaceId}/leads/{leadId}/message#

Staff message to the lead.

Route idworkspace.leadMessage
AuthSession + Idempotency-Key (+ same origin for cookies)
Who may callOWNER, ADMIN (only while handling is HUMAN)
StatusIMPLEMENTED

Path parameters: workspaceId, leadId (UUIDs unless stated).

Request body (LeadMessageRequest)

FieldTypeRequiredNotes
textstring (max 4000, min 1)yes

Response (LeadMessage)

FieldTypeRequiredNotes
messageIduuidyes
authorLEAD, AGENT, STAFF, SYSTEMyes
textstring (max 4000)yes
offerVersioninteger or nullyes
createdAtISO-8601 timeyesUTC ISO-8601 timestamp

POST /v3/workspaces/{workspaceId}/leads/{leadId}/takeover#

Take over, hand back, freeze offers or escalate; 409 on a stale version.

Route idworkspace.leadTakeover
AuthSession + Idempotency-Key (+ same origin for cookies)
Who may callOWNER, ADMIN
StatusIMPLEMENTED

Path parameters: workspaceId, leadId (UUIDs unless stated).

Request body (TakeoverRequest)

FieldTypeRequiredNotes
actionHUMAN_TAKEOVER, HAND_BACK_TO_AGENT, FREEZE_OFFERS, ESCALATE_TO_OWNERyes
expectedVersioninteger (min 0)yes

Response (TakeoverResult)

FieldTypeRequiredNotes
handlingLeadHandlingyes
handlingVersioninteger (min 0)yes

POST /v3/workspaces/{workspaceId}/lead-invites#

Single-use private invitation link for a prospect.

Route idworkspace.leadInvite
AuthSession + Idempotency-Key (+ same origin for cookies)
Who may callOWNER, ADMIN
StatusIMPLEMENTED

Path parameters: workspaceId (UUIDs unless stated).

Request body (LeadInviteRequest)

FieldTypeRequiredNotes
sourceTELEGRAM, WEByes
expiresInSecondsinteger (min 300, max 604800)yes

Response (LeadInvite)

FieldTypeRequiredNotes
inviteIduuidyes
telegramUrlstring or nullyes
webUrlstringyes
expiresAtISO-8601 timeyesUTC ISO-8601 timestamp

POST /v3/lead-invites/redeem#

Bind a private session to the redeeming identity, once.

Route idleadInvite.redeem
AuthSession (bearer or cookie)
Who may callexternal lead with a provider-verified identity
StatusIMPLEMENTED

Request body (LeadInviteRedeem)

FieldTypeRequiredNotes
tokenstring (^[A-Za-z0-9_-]{16,64}$)yes

Response (LeadInviteRedeemResult)

FieldTypeRequiredNotes
leadIduuidyes
boundbooleanyes

POST /v3/workspaces/{workspaceId}/offers/{offerId}/versions/{version}/validate#

Run the deterministic commercial policy checks on one offer version.

Route idworkspace.offerValidate
AuthSession + Idempotency-Key (+ same origin for cookies)
Who may callOWNER, ADMIN
StatusIMPLEMENTED

Path parameters: workspaceId, offerId, version (UUIDs unless stated).

Response (OfferValidation)

FieldTypeRequiredNotes
allowedbooleanyes
policyVersionintegeryes
checksobject[]yes
checks[].rulestring (max 60)yes
checks[].passedbooleanyes
checks[].detailstring (max 300)yes

POST /v3/workspaces/{workspaceId}/leads/{leadId}/offers#

Send an offer (or a new version of one) after the policy checks pass.

Route idworkspace.leadOffer
AuthSession + Idempotency-Key (+ same origin for cookies)
Who may callOWNER, ADMIN (only while handling is HUMAN)
StatusIMPLEMENTED

Path parameters: workspaceId, leadId (UUIDs unless stated).

Request body (OfferSendRequest)

FieldTypeRequiredNotes
termsOfferTermsyes
offerIduuidno

Response (OfferSendResult)

FieldTypeRequiredNotes
sentbooleanyes
checksOfferCheck[]yes
needsOwnerbooleanyes
offerOfferVersion or nullyes

Edit this page on GitHub