API Reference
Log In
API Reference

Trigger an insights run

Start an insights analysis run for the authenticated team over a period of up to 90 days. The request returns 202 Accepted right away with the runId and its status. Poll GET /api/v2/insights/runs/{runId} until status is completed, partial or failed. The Location response header holds the polling URL.

Only one run can be in progress for the team at a time. Narrow the analysis with the filter* fields, and skip checks with excludeInvestigatorIds (see GET /api/v2/insights/investigators).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
string

Hashed id of the team to answer for. Optional. With a user token it may be any team the user belongs to; without it the user's default team answers. An API key always answers for its own team, and naming any other team is refused with 403.

Body Params
string | null
required

Start of the period to analyze, ISO 8601 in UTC. The period can be at most 90 days long.

string | null
required

End of the period to analyze, ISO 8601 in UTC. Must be after periodStart.

filterAgent
array of strings
Defaults to []

Analyze only these agents. Defaults to all agents.

filterAgent
filterProductId
array of strings
Defaults to []

Analyze only these product IDs. Defaults to all products.

filterProductId
filterTraceType
array of strings
Defaults to []

Analyze only these trace types. Defaults to all trace types.

filterTraceType
filterConsumingOrgId
array of strings
Defaults to []

Analyze only usage from these customer organization IDs. Defaults to all customers.

filterConsumingOrgId
string

Analyze only this environment. Defaults to an empty string, which means all environments.

boolean
Defaults to true

Whether to include coding-assistant usage in the analysis. Defaults to true.

boolean
Defaults to false

Accepted for compatibility and ignored. Which coding-assistant spend the cost checks include follows the team's coding-assistant pricing policy.

string

Analyze only this department. Omit it to analyze all departments.

boolean
Defaults to true

When filterDepartmentId is set, whether to include its sub-departments. Defaults to true.

excludeInvestigatorIds
array of strings

IDs of investigators to skip. Get valid IDs from GET /api/v2/insights/investigators. Omit it to run them all.

excludeInvestigatorIds
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Bearer
API Key
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
application/problem+json