# Get invitation

> GET /v1/invitations/{invitationId}

`GET https://api.zavu.dev/v1/invitations/{invitationId}`

## Parameters

- `invitationId` (path, string, required)

## Responses

### 200

Invitation details.

- `invitation` (object, required)
  - `id` (string, required)
  - `url` (string, required): Full URL to share with the client.
  - `token` (string, required): Unique invitation token.
  - `clientName` (string, nullable)
  - `clientEmail` (string, nullable)
  - `clientPhone` (string, nullable)
  - `phoneNumberId` (string, nullable): ID of a pre-assigned Zavu phone number for WhatsApp registration. Always null for `messenger` invitations.
  - `connectionType` (string): Which Meta channel the client connects: `whatsapp_waba` (official WhatsApp Cloud API via embedded signup) or `messenger` (a Facebook Page's Messenger inbox, including Marketplace chats). One of: `whatsapp_waba`, `messenger`.
  - `status` (string, required): Current status of the partner invitation. `failed` means the client started the connection and it did not finish (they cancelled Meta's dialog, denied a permission, or abandoned the tab). A failed invitation is still usable: the same link can be retried, and it moves back to `in_progress` when the client tries again. One of: `pending`, `in_progress`, `completed`, `expired`, `cancelled`, `failed`.
  - `senderId` (string, nullable): ID of the sender created when invitation is completed.
  - `connectedAccount` (object, nullable): The account the client linked, populated once the invitation is `completed`. Null before that. Use it to show the partner what was connected without fetching the sender.
    - `channel` (string, required) One of: `whatsapp`, `messenger`.
    - `id` (string, required): Provider-side identifier: the WhatsApp phone number ID, or the Facebook Page ID.
    - `name` (string, nullable): Display name of the connected account: the WhatsApp verified name, or the Facebook Page name.
  - `failureReason` (string, nullable): Stable code for why the last attempt failed, present when `status` is `failed`. Values include `fb_cancelled` (client closed Meta's dialog), `fb_not_authorized` (permission denied), `signup_abandoned` (started but never finished), `meta_no_pages` (the client administers no Facebook Page), and `internal_error`. Treat unknown codes as a generic failure.
  - `failedAt` (string<date-time>, nullable)
  - `expiresAt` (string<date-time>, required)
  - `viewedAt` (string<date-time>, nullable)
  - `startedAt` (string<date-time>, nullable)
  - `completedAt` (string<date-time>, nullable)
  - `createdAt` (string<date-time>, required)
  - `updatedAt` (string<date-time>, required)

### 401

Unauthorized.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 404

Invitation not found.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

## Example

```bash
curl -X GET "https://api.zavu.dev/v1/invitations/invitation_abc123" \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY"
```

```typescript
import Zavudev from "@zavudev/sdk";

const zavu = new Zavudev({ apiKey: process.env.ZAVUDEV_API_KEY });

const result = await zavu.invitations.retrieve("invitation_abc123");

console.log(result);
```
