Using the API

Everything the dashboard does goes through the REST API, so you can call it directly too.

Authentication

Create a token from your profile menu → API tokens. It looks like pmk_<id>_<secret> and is shown only once.

  • It acts as you: your organization's visibility and your repository roles apply.
  • It expires after 90 days by default, 1 year at most. You can revoke it any time.
curl -H "Authorization: Bearer pmk_..." \
  https://your-instance/api/workloads

Only reading? Choose a read-only token for integrations that just observe, like dashboards and reporting. A read-only token is rejected on any call that changes something.

Reference

The interactive reference is at /api/docs, and the OpenAPI spec at /api/openapi. Highlights:

  • GET /api/workloads: the catalog, filterable with ?prefix=
  • GET /api/workloads/{idOrAlias}/view: the live pipeline view
  • POST /api/workloads/{id}/runs: trigger a run (needs a read + write token)
  • GET /api/repos?prefix=: discovered repositories and whether each is enabled
  • GET /api/activity: recent executions across the pipelines you can see