# Invites

## List Invites

`InviteListMinePage invites().listMine(InviteListMineParamsparams = InviteListMineParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

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

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

### Parameters

- `InviteListMineParams params`

  - `Optional<Long> pageSize`

  - `Optional<String> pageToken`

### Returns

- `class Invite:`

  A pending invitation visible to the invitee.

  - `String id`

    The invite's unique identifier.

  - `String organizationId`

    The organization the user is invited to.

  - `String organizationName`

    The organization's display name.

  - `String role`

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

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

### Example

```java
package ai.llamaindex.llamacloudadmin.example;

import ai.llamaindex.llamacloudadmin.client.LlamaCloudAdminClient;
import ai.llamaindex.llamacloudadmin.client.okhttp.LlamaCloudAdminOkHttpClient;
import ai.llamaindex.llamacloudadmin.models.invites.InviteListMinePage;
import ai.llamaindex.llamacloudadmin.models.invites.InviteListMineParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudAdminClient client = LlamaCloudAdminOkHttpClient.fromEnv();

        InviteListMinePage page = client.invites().listMine();
    }
}
```

#### 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(InviteDeclineParamsparams = InviteDeclineParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

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

Decline a pending invitation.

### Parameters

- `InviteDeclineParams params`

  - `Optional<String> inviteId`

### Example

```java
package ai.llamaindex.llamacloudadmin.example;

import ai.llamaindex.llamacloudadmin.client.LlamaCloudAdminClient;
import ai.llamaindex.llamacloudadmin.client.okhttp.LlamaCloudAdminOkHttpClient;
import ai.llamaindex.llamacloudadmin.models.invites.InviteDeclineParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudAdminClient client = LlamaCloudAdminOkHttpClient.fromEnv();

        client.invites().decline("invite_id");
    }
}
```

## Accept Invite

`InviteAcceptResponse invites().accept(InviteAcceptParamsparams = InviteAcceptParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

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

Accept a pending invitation. Returns the joined organization id.

### Parameters

- `InviteAcceptParams params`

  - `Optional<String> inviteId`

### Returns

- `class InviteAcceptResponse:`

  Response for accepting an invitation.

  - `String organizationId`

    The organization the user just joined.

### Example

```java
package ai.llamaindex.llamacloudadmin.example;

import ai.llamaindex.llamacloudadmin.client.LlamaCloudAdminClient;
import ai.llamaindex.llamacloudadmin.client.okhttp.LlamaCloudAdminOkHttpClient;
import ai.llamaindex.llamacloudadmin.models.invites.InviteAcceptParams;
import ai.llamaindex.llamacloudadmin.models.invites.InviteAcceptResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudAdminClient client = LlamaCloudAdminOkHttpClient.fromEnv();

        InviteAcceptResponse response = client.invites().accept("invite_id");
    }
}
```

#### Response

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

## Domain Types

### Invite

- `class Invite:`

  A pending invitation visible to the invitee.

  - `String id`

    The invite's unique identifier.

  - `String organizationId`

    The organization the user is invited to.

  - `String organizationName`

    The organization's display name.

  - `String role`

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

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<LocalDateTime> updatedAt`

    Update datetime
