# V2 Projects

## List Projects

`client.v2Projects.list(V2ProjectListParamsquery?, RequestOptionsoptions?): PaginatedCursor<V2ProjectListResponse>`

**get** `/api/v2/projects`

List projects in an organization. Requires `organization_id` or a project-scoped API key.

### Parameters

- `query: V2ProjectListParams`

  - `name?: string | null`

  - `organization_id?: string | null`

  - `page_size?: number | null`

  - `page_token?: string | null`

### Returns

- `V2ProjectListResponse`

  API response schema for a project.

  - `id: string`

    The project's unique identifier.

  - `name: string`

    The project's display name.

  - `organization_id: string`

    The organization the project belongs to.

  - `created_at?: string | null`

    Creation datetime

  - `is_default?: boolean`

    Whether this project is the default project for its organization.

  - `updated_at?: string | null`

    Update datetime

### Example

```typescript
import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const v2ProjectListResponse of client.v2Projects.list()) {
  console.log(v2ProjectListResponse.id);
}
```

#### Response

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

## Get Project

`client.v2Projects.get(stringprojectID, V2ProjectGetParamsquery?, RequestOptionsoptions?): V2ProjectGetResponse`

**get** `/api/v2/projects/{project_id}`

Get a project by ID.

### Parameters

- `projectID: string`

- `query: V2ProjectGetParams`

  - `organization_id?: string | null`

### Returns

- `V2ProjectGetResponse`

  API response schema for a project.

  - `id: string`

    The project's unique identifier.

  - `name: string`

    The project's display name.

  - `organization_id: string`

    The organization the project belongs to.

  - `created_at?: string | null`

    Creation datetime

  - `is_default?: boolean`

    Whether this project is the default project for its organization.

  - `updated_at?: string | null`

    Update datetime

### Example

```typescript
import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

const v2Project = await client.v2Projects.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

console.log(v2Project.id);
```

#### Response

```json
{
  "id": "id",
  "name": "name",
  "organization_id": "organization_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "is_default": true,
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

## Domain Types

### V2 Project List Response

- `V2ProjectListResponse`

  API response schema for a project.

  - `id: string`

    The project's unique identifier.

  - `name: string`

    The project's display name.

  - `organization_id: string`

    The organization the project belongs to.

  - `created_at?: string | null`

    Creation datetime

  - `is_default?: boolean`

    Whether this project is the default project for its organization.

  - `updated_at?: string | null`

    Update datetime

### V2 Project Get Response

- `V2ProjectGetResponse`

  API response schema for a project.

  - `id: string`

    The project's unique identifier.

  - `name: string`

    The project's display name.

  - `organization_id: string`

    The organization the project belongs to.

  - `created_at?: string | null`

    Creation datetime

  - `is_default?: boolean`

    Whether this project is the default project for its organization.

  - `updated_at?: string | null`

    Update datetime
