# Invites

## List Invites

`invites.list_mine(InviteListMineParams**kwargs)  -> SyncPaginatedCursor[Invite]`

**get** `/api/v2/invites`

List the current user's pending invitations, cursor-paginated.

### Parameters

- `page_size: Optional[int]`

- `page_token: Optional[str]`

### Returns

- `class Invite: …`

  A pending invitation visible to the invitee.

  - `id: str`

    The invite's unique identifier.

  - `organization_id: str`

    The organization the user is invited to.

  - `organization_name: str`

    The organization's display name.

  - `role: str`

    The role being granted (e.g. admin, viewer).

  - `created_at: Optional[datetime]`

    Creation datetime

  - `updated_at: Optional[datetime]`

    Update datetime

### Example

```python
import os
from llama_cloud_admin import LlamaCloudAdmin

client = LlamaCloudAdmin(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
page = client.invites.list_mine()
page = page.items[0]
print(page.id)
```

#### Response

```json
{
  "items": [
    {
      "id": "id",
      "organization_id": "organization_id",
      "organization_name": "organization_name",
      "role": "role",
      "created_at": "2019-12-27T18:11:19.117Z",
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
```

## Decline Invite

`invites.decline(strinvite_id)`

**delete** `/api/v2/invites/{invite_id}`

Decline a pending invitation.

### Parameters

- `invite_id: str`

### Example

```python
import os
from llama_cloud_admin import LlamaCloudAdmin

client = LlamaCloudAdmin(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
client.invites.decline(
    "invite_id",
)
```

## Accept Invite

`invites.accept(strinvite_id)  -> InviteAcceptResponse`

**post** `/api/v2/invites/{invite_id}/accept`

Accept a pending invitation. Returns the joined organization id.

### Parameters

- `invite_id: str`

### Returns

- `class InviteAcceptResponse: …`

  Response for accepting an invitation.

  - `organization_id: str`

    The organization the user just joined.

### Example

```python
import os
from llama_cloud_admin import LlamaCloudAdmin

client = LlamaCloudAdmin(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
response = client.invites.accept(
    "invite_id",
)
print(response.organization_id)
```

#### Response

```json
{
  "organization_id": "organization_id"
}
```

## Domain Types

### Invite

- `class Invite: …`

  A pending invitation visible to the invitee.

  - `id: str`

    The invite's unique identifier.

  - `organization_id: str`

    The organization the user is invited to.

  - `organization_name: str`

    The organization's display name.

  - `role: str`

    The role being granted (e.g. admin, viewer).

  - `created_at: Optional[datetime]`

    Creation datetime

  - `updated_at: Optional[datetime]`

    Update datetime

### Invite Accept Response

- `class InviteAcceptResponse: …`

  Response for accepting an invitation.

  - `organization_id: str`

    The organization the user just joined.
