Skip to main content

Find your targets

Most endpoints are scoped to a target and take its id in the path: /api/v1/targets/{id}/....

You get this id back when you create a target. To look it up later, list your targets with GET /api/v1/targets:

Request
curl https://spectral.principled.app/api/v1/targets \
-H "Authorization: Bearer ak_****"

Each entry in data is a target. Read the id from the one you want:

Response
{
"data": [
{
"id": "9f8c2...",
"name": "Support Assistant",
"description": "Customer support assistant for AcmeShip, a parcel delivery service...",
"type": "api",
"created_at": "2026-06-18T12:00:00Z",
"updated_at": "2026-06-18T12:00:00Z"
}
],
"has_more": false,
"next_cursor": null
}

This response is paginated: data holds the current page, while has_more and next_cursor point to the rest. Nearly every list endpoint works this way, and we will discuss it more thoroughly in a dedicated page.