# Projects


Projects are the folders you file work under. Every audience, audience size
estimate, activation, cohort, and schedule optionally carries a `project_id`,
and these endpoints are how you create a project and resolve a project name to
the id those creates accept. A Lookalike Model is the exception:
[Create Lookalike Audience](/api/v2/audiences#post-apiv2analysesaudiencescreate-lookalike)
takes no `project_id` and ignores one sent in the body, so a Lookalike Model
cannot be filed under a project. Projects are the same ones the console shows
under Organization - Projects.

All project endpoints are authenticated and JSON-only. Send `Authorization:
Bearer <token>` and `Accept: application/json` on every call (plus
`Content-Type: application/json` on the POSTs). Reads use the read rate bucket
(120 requests/min per caller); writes use the write bucket (30 requests/min per
caller).

## Create Project {#post-apiv2analysesprojectscreate}

`POST /api/v2/analyses/projects/create`

Creates a project for your company. The returned `id` is what you pass as
`project_id` when creating an
[audience]({{< relref "/api/v2/audiences" >}}#post-apiv2analysesaudiencescreate),
an [activation]({{< relref "/api/v2/activations" >}}#post-apiv2analysesactivationscreate),
a [cohort]({{< relref "/api/v2/cohorts" >}}#post-apiv2analysescohortscreate),
or a [schedule]({{< relref "/api/v2/schedules" >}}#post-apiv2analysesschedulescreate).

**Auth:** bearer token + `Accept: application/json` + `Content-Type:
application/json`. Rate limit: write bucket (30 requests/min). Optional:
`Idempotency-Key` header (see [Audiences]({{< relref "/api/v2/audiences" >}}#idempotency)).

### Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | **Yes** | Project name (max 255 chars). |

{{< tabs >}}

  {{< tab name="cURL" >}}
  ```bash
  curl -X POST "https://console.intuizi.com/api/v2/analyses/projects/create" \
    -H "Authorization: Bearer <YOUR_TOKEN>" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Idempotency-Key: <UNIQUE_KEY>" \
    -d '{ "name": "Retail 2026" }'
  ```
  {{< /tab >}}

  {{< tab name="Python" >}}
  ```python
  import requests

  res = requests.post(
      "https://console.intuizi.com/api/v2/analyses/projects/create",
      headers={
          "Authorization": "Bearer <YOUR_TOKEN>",
          "Content-Type": "application/json",
          "Accept": "application/json",
          "Idempotency-Key": "<UNIQUE_KEY>",
      },
      json={"name": "Retail 2026"},
  )
  project_id = res.json()["data"][0]["id"]
  ```
  {{< /tab >}}

  {{< tab name="JavaScript" >}}
  ```javascript
  const res = await fetch(
    "https://console.intuizi.com/api/v2/analyses/projects/create",
    {
      method: "POST",
      headers: {
        Authorization: "Bearer <YOUR_TOKEN>",
        "Content-Type": "application/json",
        Accept: "application/json",
        "Idempotency-Key": "<UNIQUE_KEY>",
      },
      body: JSON.stringify({ name: "Retail 2026" }),
    }
  );
  const projectId = (await res.json()).data[0].id;
  ```
  {{< /tab >}}

  {{< tab name="PHP" >}}
  ```php
  $res = Http::withToken('<YOUR_TOKEN>')->acceptJson()
      ->withHeaders(['Idempotency-Key' => '<UNIQUE_KEY>'])
      ->post('https://console.intuizi.com/api/v2/analyses/projects/create', [
          'name' => 'Retail 2026',
      ]);
  $projectId = $res->json('data.0.id');
  ```
  {{< /tab >}}

{{< /tabs >}}

### Response

```json
{
  "status": "success",
  "code": 201,
  "message": "Resource created successfully.",
  "data": [
    {
      "id": 4,
      "name": "Retail 2026"
    }
  ]
}
```

## List Projects {#get-apiv2analysesprojectsindex}

`GET /api/v2/analyses/projects/index`

Lists the projects owned by your company, ordered by name, paginated.

**Auth:** bearer token + `Accept: application/json`. Rate limit: read bucket
(120 requests/min).

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `per_page` | integer | No | Items per page. Defaults to 25, capped at 100. |
| `page` | integer | No | Page number (standard pagination). |
| `search` | string | No | Optional free-text filter on the project name (case-insensitive contains). |

### Response

```json
{
  "status": "success",
  "code": 200,
  "message": "Resources fetched successfully.",
  "data": {
    "items": [
      { "id": 4, "name": "Retail 2026" },
      { "id": 9, "name": "Travel 2026" }
    ],
    "pagination": { "current_page": 1, "per_page": 25, "total": 2, "last_page": 1 }
  }
}
```

## Get Project {#get-apiv2analysesprojectsid}

`GET /api/v2/analyses/projects/{id}`

Fetches one project owned by your company.

**Auth:** bearer token + `Accept: application/json`. Rate limit: read bucket
(120 requests/min).

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | Yes | The project id to fetch. Must be owned by your company. |

### Response

```json
{
  "status": "success",
  "code": 200,
  "message": "Resource fetched successfully.",
  "data": {
    "id": 4,
    "name": "Retail 2026"
  }
}
```

## Delete Project {#post-apiv2analysesprojectsdelete-by-id}

`POST /api/v2/analyses/projects/delete-by-id`

Deletes one project owned by your company. Deleting a project only removes the
folder: every audience, activation, cohort, and schedule filed under it
is **released** (its `project_id` is cleared) and keeps working exactly as
before. Nothing you built is deleted along with the project. An
[audience size estimate](/api/v2/audiences#post-apiv2analysesaudiencesestimate)
filed under it is not released: it keeps the deleted project's id.

**Auth:** bearer token + `Accept: application/json` + `Content-Type:
application/json`. Rate limit: write bucket (30 requests/min).

### Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | Yes | The project id to delete. Must be owned by your company. |

### Response

```json
{
  "status": "success",
  "code": 200,
  "message": "Resource deleted successfully.",
  "data": []
}
```
