> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zavu.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Invitations

> Partner invitations for client WhatsApp Business onboarding. Not yet generated in the PHP SDK: use the REST API or the CLI.

<Warning>
  **Not generated in the PHP SDK yet.** `zavudev/sdk` does not expose an `invitations`
  resource today, so there is nothing to call. The endpoints exist and are stable:
  use the REST API below, the [CLI](/guides/cli/overview), or the
  [TypeScript SDK](/sdks/typescript/invitations), which does cover it. See the
  [coverage table](/sdks/overview#coverage).
</Warning>

Partner invitations generate a link a client opens to connect their own
WhatsApp Business Account, or a Facebook Page, into your project. One
invitation connects one channel.

## Create an invitation

```bash theme={null}
curl -X POST https://api.zavu.dev/v1/invitations \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "clientName": "Acme Corp",
    "clientEmail": "contact@acme.com",
    "connectionType": "whatsapp_waba",
    "expiresInDays": 14
  }'
```

The response carries `url`, the link you share with the client, and `token`.

```bash CLI theme={null}
npx zavudev invitations create --data '{"clientName":"Acme Corp"}'
```

## Retrieve an invitation

```bash theme={null}
curl https://api.zavu.dev/v1/invitations/inv_abc123 \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY"
```

Poll `status` (`pending`, `in_progress`, `completed`, `expired`, `cancelled`,
`failed`), or subscribe to the `invitation.status_changed` webhook instead of
polling. A `failed` invitation is still usable: the same link can be retried.

## List invitations

```bash theme={null}
curl "https://api.zavu.dev/v1/invitations?status=pending&limit=50" \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY"
```

## Cancel an invitation

```bash theme={null}
curl -X POST https://api.zavu.dev/v1/invitations/inv_abc123/cancel \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY"
```

## After completion

When the client finishes, the invitation moves to `completed` and carries
`senderId` plus `connectedAccount` (the WhatsApp number or Facebook Page that
was linked). That sender is now yours to send from.

<CardGroup cols={2}>
  <Card title="Partner invitations guide" icon="users" href="/guides/partner-invitations/api">
    The full flow, webhooks, and failure codes
  </Card>

  <Card title="API reference" icon="code" href="/api-reference/create-invitation">
    Every field on the endpoint
  </Card>
</CardGroup>
