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:
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:
{"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 in a dedicated page.
Find the target behind a resource
When all you have is the id of a run, execution, or report (from a saved link or a webhook, say), resolve the target that owns it with GET /api/v1/targets/find-resource/{resourceType}/{resourceId}. resourceType is one of run, execution, or report:
curl https://spectral.principled.app/api/v1/targets/find-resource/execution/a1b2c... \-H "Authorization: Bearer ak_****"
{ "target_id": "9f8c2..." }
Use the returned target_id to build the target-scoped path for any follow-up request.