> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Project Insights Status

> Returns whether co-author insights is enabled for a project.

`Unary` · [`Insights`](https://ona.com/docs/api-reference/generated/insights/overview)

Returns whether co-author insights is enabled for a project.

## Endpoint

```text theme={null}
POST /api/gitpod.v1.InsightsService/GetProjectInsightsStatus
```

Send a Bearer token as described in [Authentication](https://ona.com/docs/api-reference.md#authenticate-requests). If your organization uses a custom management-plane domain, replace `https://app.ona.com` with that domain.

## Request example

```bash cURL theme={null}
export ONA_HOST=https://app.ona.com
export ONA_API_KEY=<your-token>

curl --request POST \
  --url "$ONA_HOST/api/gitpod.v1.InsightsService/GetProjectInsightsStatus" \
  --header "Authorization: Bearer $ONA_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "projectId": "<project-id>"
}'
```

```python Python theme={null}
import gitpod.v1.insights_pb2 as insights_pb2
from ona_sdk import create_client_from_env

ona = create_client_from_env()
request = insights_pb2.GetProjectInsightsStatusRequest(
    project_id="<project-id>",
)
response = ona.services.insights.get_project_insights_status(request)
print(response)
```

```typescript TypeScript theme={null}
import { create } from "@bufbuild/protobuf";
import { createClientFromEnv } from "@gitpod/sdk";
import { GetProjectInsightsStatusRequestSchema } from "@gitpod/sdk/gitpod/v1/insights_pb";

async function main() {
  const ona = createClientFromEnv();
  const request = create(GetProjectInsightsStatusRequestSchema, {
    projectId: "<project-id>",
  });
  const response = await ona.services.insights.getProjectInsightsStatus(request);
  console.log(response);
}

main().catch(console.error);
```

```go Go theme={null}
package main

import (
	"context"
	"fmt"
	"log"

	"connectrpc.com/connect"
	"github.com/gitpod-io/gitpod-sdk-go/sdk"
	gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
)

func main() {
	ona, err := sdk.NewFromEnv()
	if err != nil {
		log.Fatal(err)
	}

	request := connect.NewRequest(&gitpodpb.GetProjectInsightsStatusRequest{
		ProjectId: "<project-id>",
	})
	response, err := ona.Services.Insights.GetProjectInsightsStatus(context.Background(), request)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(response.Msg)
}
```

```json Request body theme={null}
{
  "projectId": "<project-id>"
}
```

## Request

`gitpod.v1.GetProjectInsightsStatusRequest`

GetProjectInsightsStatusRequest checks whether insights is enabled for a project.

| Field | Type | Required | Description |
| - | - | - | - |
| `projectId` | string | No | Project to check. Constraints: `string.uuid=true`. |

## Response

`gitpod.v1.GetProjectInsightsStatusResponse`

| Field | Type | Required | Description |
| - | - | - | - |
| `enabled` | boolean | No | Whether co-author insights is enabled for the project. |
| `lastRanAt` | RFC 3339 timestamp | No | When the insights workflow last completed successfully. Nil when enabled is true but no data has been collected yet (pending state). |
| `insightsHealth` | array of [InsightsHealthIssue](#type-gitpod-v1-insights-health-issue) | No | Issues preventing the workflow from running. Empty when enabled is false, or when enabled and prerequisites are met. The frontend should render the first issue prominently. Today only carries CATEGORY\_PREREQUISITE; CATEGORY\_RUNTIME will be added later. |
| `dataCollectedThrough` | RFC 3339 timestamp | No | Upper bound of the most recent batch successfully written for this project. Nil when no data has been collected yet (first-time enable or never run). The CLI reads this to decide where to resume collection. |

## Related types

> [accordion] InsightsHealthIssue
>
> InsightsHealthIssue describes one reason why insights for a project is
> either not runnable (prerequisite) or last failed (runtime). The
> error\_code field comes from the shared errorcodes registry; the frontend
> renders it via the same map used for environment errors.
>
> `gitpod.v1.InsightsHealthIssue`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `category` | [Category](#enum-gitpod-v1-insights-health-issue-category) | No | |
> | `errorCode` | string | No | Stable machine identifier of the issue (e.g. "PROJECT\_NO\_ENVIRONMENT\_CLASS"). The frontend looks this up in the generated error-codes map. |
> | `metadata` | map of string to string | No | Rendering hints (e.g. environment\_class\_id, runner\_id, attempted\_at). Keys are defined by the code that produces the issue. |
> | `detectedAt` | RFC 3339 timestamp | No | When this issue was observed. For prerequisites it's "now"; for runtime errors it's the failed execution's end time. |

> [accordion] Category
>
> Category distinguishes the source of the issue. The frontend may use
> this to choose copy ("Insights can't run yet…" vs "Last insights run
> failed…").
>
> | Value | Number | Description |
> | - | -: | - |
> | `CATEGORY_UNSPECIFIED` | 0 | |
> | `CATEGORY_PREREQUISITE` | 1 | The issue is a prerequisite that has not been met. Prerequisites are deterministic, derived from project/org configuration, and checked synchronously before a workflow execution is attempted. |
> | `CATEGORY_RUNTIME` | 2 | The issue is a runtime failure observed after a workflow execution was attempted. Runtime errors depend on runner-side state. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.