GoliathDevelopersGet an API key
Reference/Partnershipsgenerated from the gateway manifest

createPartnershipInvite

Send a partnership invitation to another organization.

POST/api/v1/callADMINidempotent · 24 hruns as the key's owner
View as Markdown

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.

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"
    }
  }'
import { GoliathClient } from '@goliath-data/sdk'

const goliath = new GoliathClient({
  apiKey: process.env.GOLIATH_API_KEY!,
  baseUrl: 'https://server.goliathdata.com',
})

// Enum values as strings: the SDK's enum types aren't exported yet, so assert to the method's variables type.
const variables = {
  partnerOrgId: '<partnerOrgId>',
  direction: 'SEND_ONLY'
} as Parameters<typeof goliath.partnerships.createPartnershipInvite>[0]

const result = await goliath.partnerships.createPartnershipInvite(variables, { idempotencyKey: crypto.randomUUID() })
const res = await fetch('https://server.goliathdata.com/api/v1/call', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    operationId: 'createPartnershipInvite',
    variables: {
      partnerOrgId: '<partnerOrgId>',
      direction: 'SEND_ONLY'
    }
  }),
})
const { data, errors } = await res.json()

Variables

The example sends only what the schema requires. Some operations also need one of several optional variables (one filter or another, say); the description above says which.

partnerOrgIdID!required
directionPartnershipDirection!required

SEND_ONLY: Current org sends leads to partner org only. RECEIVE_ONLY: Partner org sends leads to current org only. BIDIRECTIONAL: Both directions active.

SEND_ONLYRECEIVE_ONLYBIDIRECTIONAL
permittedUserIds[ID!]
recipientUserIds[ID!]

Response

What comes back under data: a list shows as one entry, and a value as its type.

response shape
{
  "data": {
    "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"
      }
    }
  }
}

Errors

Idempotency

Send an Idempotency-Key of 1 to 255 characters. A finished request retried with the same key replays its stored response, marked Idempotency-Replayed: true; one still in flight returns 409 idempotency_conflict. Keys expire after 24 hours. Write without fear →