# createPartnershipInvite

Send a partnership invitation to another organization (partnerOrgId from lookupPartnerOrg). direction is SEND_ONLY, RECEIVE_ONLY, or BIDIRECTIONAL (whose leads flow to whom). permittedUserIds optionally limits which of your users are visible to the partner (empty = all); recipientUserIds optionally targets which partner admins are notified: omit it (the default) to notify all of them; no operation lists partner admins, so choosing them is done in the app. Confirm the partner, direction and permittedUserIds with the user first. The partnership is PENDING until the partner org accepts: track it in listPartnerships.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "createPartnershipInvite", "variables": {...} }`
- Scope: `ADMIN`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `partnerOrgId`: `ID!` (required)
- `direction`: `PartnershipDirection!` (required, one of `SEND_ONLY`, `RECEIVE_ONLY`, `BIDIRECTIONAL`). SEND_ONLY: Current org sends leads to partner org only. RECEIVE_ONLY: Partner org sends leads to current org only. BIDIRECTIONAL: Both directions active.
- `permittedUserIds`: `[ID!]`
- `recipientUserIds`: `[ID!]`

## Response (data, an example)

```json
{
  "orgPartnershipMutation": {
    "createInvitation": {
      "id": "<ID>",
      "status": "PENDING",
      "direction": "SEND_ONLY",
      "partnerOrg": {
        "id": "<ID>",
        "name": "…"
      },
      "permittedUserIds": [
        "<ID>"
      ],
      "createdAt": "2026-01-01T00:00:00.000Z",
      "updatedAt": "2026-01-01T00:00:00.000Z"
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "createPartnershipInvite",
    "variables": {
      "partnerOrgId": "<partnerOrgId>",
      "direction": "SEND_ONLY"
    }
  }'
```
