# Sync a single co-sell referral with the partner / CRM

`POST https://api.suger.cloud/org/{orgId}/cosell/referral/{referralId}/sync`

Trigger a one-way sync for a specific referral. Controlled by `direction`:
- OUTBOUND: CRM -> Suger -> Partner (push local changes to the cloud partner)
- INBOUND (default): Partner -> Suger -> CRM (pull partner-side updates into Suger and CRM)

This is the primary way to push a Suger-side edit to the partner after calling UpdateCosellReferral, and to refresh Suger with the partner's latest stage/status for an inbound referral.

Side effect: for AWS / Azure / GCP, calls the partner API (AWS ACE / Azure Partner Center / GCP) and writes back to Suger DB + linked CRM record (Salesforce / HubSpot / Dynamics 365).

A SUGER referral has no external partner system, so there is nothing to push to a partner here — the partner's copy is kept in step by Suger itself. On a SUGER referral this synchronizes the linked CRM record and accepts `direction=OUTBOUND` only; `direction=INBOUND` returns an error.

Use this when: user wants to "submit", "push", "refresh", or "sync" one referral.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `orgId` | path | string | yes | Organization ID |
| `referralId` | path | string | yes | Cosell Referral ID |
| `direction` | query | string | no | Sync direction: INBOUND or OUTBOUND (default INBOUND) |

## Responses

### 200 — OK

Content-Type: `application/json` · Schema: `OperationExecutionDetails`

**`OperationExecutionDetails`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `newWorkflowStarted` | boolean | no |  |
| `referralId` | string | no | ReferralID is the created referral's id, set by the SUGER co-sell create so the caller can chain follow-up calls (e.g. InviteCosellPartners) onto the new engagement without re-querying. Empty elsewhere. |
| `runID` | string | no |  |
| `slackMirrorWarning` | string | no | SlackMirrorWarning is a non-blocking advisory set when a SUGER co-sell console message was saved but could not be mirrored to the partner's Slack channel (no workspace connected, no channel mapped, bot not in the channel, or a transient post failure). Empty when the message mirrored or Slack is not involved. The console surfaces it as a warning toast; the message is always persisted regardless (best-effort mirror). |
| `status` | string | no |  |
| `workflowID` | string | no |  |

### 400 — Bad request error

Content-Type: `application/json` · Schema: `ErrorResponse`

**`ErrorResponse`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | ErrorCode | no |  |
| `info` | object | no |  |
| `message` | string | no |  |

### 404 — Referral not found

Content-Type: `application/json` · Schema: `ErrorResponse`

**`ErrorResponse`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | ErrorCode | no |  |
| `info` | object | no |  |
| `message` | string | no |  |

### 500 — Internal server error

Content-Type: `application/json` · Schema: `ErrorResponse`

**`ErrorResponse`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | ErrorCode | no |  |
| `info` | object | no |  |
| `message` | string | no |  |

---

Interactive API reference: https://doc.suger.io/api/
