# API

Drive GoRunner from your own code.

## Start here

[Get started](https://docs.gorunner.io/api/get-started): An API token, then create, publish and run a workflow

## Common tasks

- [Make an API token](https://docs.gorunner.io/build/api-tokens): Settings › Workspace › API tokens · 3 min
- [Run a workflow](https://docs.gorunner.io/api/runs/run-workflow): Start a run and get its result
- [Get a run](https://docs.gorunner.io/api/runs/get-run): Its status and each step’s output
- [Create a workflow](https://docs.gorunner.io/api/workflows/create-workflow): From a definition, or blank
- [Publish a workflow](https://docs.gorunner.io/api/publish/publish-workflow): Required before a production run
- [Create a connection from code](https://docs.gorunner.io/api/create-a-connection): Fields, or an OAuth sign-in · 6 min
- [Call a workflow’s webhook](https://docs.gorunner.io/api/webhooks): No token, and a reply in the same call · 5 min

Look something up: [Authentication](https://docs.gorunner.io/api/authentication) · [Errors](https://docs.gorunner.io/api/errors) · [Idempotency](https://docs.gorunner.io/api/idempotency) · [Pagination](https://docs.gorunner.io/api/pagination) · [OpenAPI, llms.txt and Markdown](https://docs.gorunner.io/api/machine-readable).

## Every endpoint 88

One API that updates in place, with no version in the address. Every endpoint below takes an API token (`Authorization: Bearer grt_…`), except two that need a person in a browser, [Start a sign-in for a connection](https://docs.gorunner.io/api/connections/start-connection-oauth2) and [Open a sign-in in this tab](https://docs.gorunner.io/api/connections/launch-connection-oauth2-here), and [Deliver to a webhook](https://docs.gorunner.io/api/runs/deliver-webhook), whose address is its key.

### Workflows

- [List workflows](https://docs.gorunner.io/api/workflows/list-workflows): `GET /api/workflows`
- [List tags](https://docs.gorunner.io/api/workflows/list-workflow-tags): `GET /api/workflows/tags`
- [Create a workflow](https://docs.gorunner.io/api/workflows/create-workflow): `POST /api/workflows`
- [Check a definition](https://docs.gorunner.io/api/workflows/validate-workflow-definition): `POST /api/workflows/validate`
- [Import a workflow](https://docs.gorunner.io/api/workflows/import-workflow): `POST /api/workflows/import`
- [Preview an import](https://docs.gorunner.io/api/workflows/preview-workflow-import): `POST /api/workflows/import/preview`
- [Change many workflows at once](https://docs.gorunner.io/api/workflows/bulk-update-workflows): `POST /api/workflows/bulk`
- [Get a workflow](https://docs.gorunner.io/api/workflows/get-workflow): `GET /api/workflows/{id}`
- [Update a workflow’s draft](https://docs.gorunner.io/api/workflows/update-workflow): `PUT /api/workflows/{id}`
- [Delete a workflow](https://docs.gorunner.io/api/workflows/delete-workflow): `DELETE /api/workflows/{id}`
- [Export a workflow](https://docs.gorunner.io/api/workflows/export-workflow): `GET /api/workflows/{id}/export`
- [Set a workflow’s tags](https://docs.gorunner.io/api/workflows/replace-workflow-tags): `PUT /api/workflows/{id}/tags`
- [Move a workflow to a folder](https://docs.gorunner.io/api/workflows/move-workflow-to-folder): `PUT /api/workflows/{id}/folder`
- [Duplicate a workflow](https://docs.gorunner.io/api/workflows/duplicate-workflow): `POST /api/workflows/{id}/duplicate`
- [Convert a Code step to 2.0.0](https://docs.gorunner.io/api/workflows/upgrade-code-step): `POST /api/code-steps/upgrade`

### Publish and versions

- [List versions](https://docs.gorunner.io/api/publish/list-workflow-versions): `GET /api/workflows/{id}/versions`
- [Publish a workflow](https://docs.gorunner.io/api/publish/publish-workflow): `POST /api/workflows/{id}/publish`
- [Review what publishing changes](https://docs.gorunner.io/api/publish/get-publish-review): `GET /api/workflows/{id}/publish-review`
- [Unpublish a workflow](https://docs.gorunner.io/api/publish/unpublish-workflow): `POST /api/workflows/{id}/unpublish`
- [Get a new webhook address](https://docs.gorunner.io/api/publish/rotate-workflow-webhook-token): `POST /api/workflows/{id}/webhook/rotate`
- [List variables](https://docs.gorunner.io/api/publish/get-workflow-variables): `GET /api/workflows/{id}/variables`
- [Replace variables](https://docs.gorunner.io/api/publish/replace-workflow-variables): `PUT /api/workflows/{id}/variables`
- [Get a version](https://docs.gorunner.io/api/publish/get-workflow-version): `GET /api/workflows/{id}/versions/{versionId}`
- [Go back to a version](https://docs.gorunner.io/api/publish/restore-workflow-version): `POST /api/workflows/{id}/versions/{versionId}/restore`

### Runs

- [List runs](https://docs.gorunner.io/api/runs/list-runs): `GET /api/runs`
- [List waiting runs](https://docs.gorunner.io/api/runs/list-waiting-runs): `GET /api/runs/waiting`
- [List a workflow’s runs](https://docs.gorunner.io/api/runs/list-workflow-runs): `GET /api/workflows/{id}/runs`
- [Get a run](https://docs.gorunner.io/api/runs/get-run): `GET /api/runs/{id}`
- [Delete a run](https://docs.gorunner.io/api/runs/delete-run): `DELETE /api/runs/{id}`
- [Stream a run](https://docs.gorunner.io/api/runs/stream-run): `GET /api/runs/{id}/stream`
- [Cancel a run](https://docs.gorunner.io/api/runs/cancel-run): `POST /api/runs/{id}/cancel`
- [Approve or reject a held run](https://docs.gorunner.io/api/runs/decide-run): `POST /api/runs/{id}/decision`
- [Delete many runs](https://docs.gorunner.io/api/runs/delete-runs-bulk): `POST /api/runs/delete`
- [Run a workflow](https://docs.gorunner.io/api/runs/run-workflow): `POST /api/workflows/{id}/run`
- [Count a workflow’s waiting runs](https://docs.gorunner.io/api/runs/count-waiting-runs): `GET /api/workflows/{id}/runs/waiting`
- [Cancel waiting runs](https://docs.gorunner.io/api/runs/cancel-waiting-runs): `POST /api/workflows/{id}/runs/cancel-waiting`
- [Run a run again](https://docs.gorunner.io/api/runs/rerun-run): `POST /api/runs/{id}/rerun`
- [Run many runs again](https://docs.gorunner.io/api/runs/rerun-runs-bulk): `POST /api/runs/rerun`
- [Cancel many runs](https://docs.gorunner.io/api/runs/cancel-runs-bulk): `POST /api/runs/cancel`
- [Deliver to a webhook](https://docs.gorunner.io/api/runs/deliver-webhook): `POST /api/webhooks/{token}`

### Run stats

- [Group failed runs](https://docs.gorunner.io/api/stats/list-run-failure-groups): `GET /api/runs/failures`
- [Runs in flight](https://docs.gorunner.io/api/stats/get-stats): `GET /api/stats`
- [Run summary with trend](https://docs.gorunner.io/api/stats/get-stats-summary): `GET /api/stats/summary`
- [The last 7 days](https://docs.gorunner.io/api/stats/get-stats-week): `GET /api/stats/week`
- [Overview figures](https://docs.gorunner.io/api/stats/get-stats-overview): `GET /api/stats/overview`
- [Runs over time](https://docs.gorunner.io/api/stats/get-stats-timeseries): `GET /api/stats/timeseries`
- [Count runs by state](https://docs.gorunner.io/api/stats/count-runs): `GET /api/runs/counts`
- [Summarize a range of runs](https://docs.gorunner.io/api/stats/summarize-run-range): `GET /api/runs/range`
- [Usual run times](https://docs.gorunner.io/api/stats/get-usual-run-times): `GET /api/runs/usual`

### Apps

- [List apps](https://docs.gorunner.io/api/apps/list-apps): `GET /api/pieces`
- [Catalog status](https://docs.gorunner.io/api/apps/get-catalog-status): `GET /api/pieces/catalog-status`
- [Get an app](https://docs.gorunner.io/api/apps/get-app): `GET /api/pieces/{id}`
- [Get an action’s fields](https://docs.gorunner.io/api/apps/get-app-action): `GET /api/pieces/{id}/actions/{actionId}`
- [Get a trigger’s fields](https://docs.gorunner.io/api/apps/get-app-trigger): `GET /api/pieces/{id}/triggers/{triggerId}`
- [Get a field’s sub-fields](https://docs.gorunner.io/api/apps/resolve-dynamic-properties): `POST /api/pieces/{id}/actions/{actionId}/properties/{propertyName}`
- [Get a field’s options](https://docs.gorunner.io/api/apps/resolve-dynamic-options): `POST /api/pieces/{id}/actions/{actionId}/options/{propertyName}`
- [Get a trigger’s sample data](https://docs.gorunner.io/api/apps/get-trigger-sample): `POST /api/pieces/{id}/triggers/{triggerId}/sample`
- [Preview a schedule](https://docs.gorunner.io/api/apps/preview-schedule-next-runs): `POST /api/pieces/schedule/next-runs`

### Connections

- [List connections](https://docs.gorunner.io/api/connections/list-connections): `GET /api/connections`
- [Create a connection](https://docs.gorunner.io/api/connections/create-connection): `POST /api/connections`
- [See which workflows use each connection](https://docs.gorunner.io/api/connections/get-connection-usage): `GET /api/connections/usage`
- [Test sign-in details before saving](https://docs.gorunner.io/api/connections/test-connection-draft): `POST /api/connections/test`
- [Start a sign-in for a new connection](https://docs.gorunner.io/api/connections/start-connection-oauth2-draft): `POST /api/connections/oauth2/start`
- [Check a sign-in](https://docs.gorunner.io/api/connections/get-connection-oauth2-attempt-any): `GET /api/connections/oauth2/attempts/{attemptId}`
- [Stop a sign-in](https://docs.gorunner.io/api/connections/cancel-connection-oauth2-attempt): `POST /api/connections/oauth2/attempts/{attemptId}/cancel`
- [Open a sign-in in this tab](https://docs.gorunner.io/api/connections/launch-connection-oauth2-here): `POST /api/connections/oauth2/attempts/{attemptId}/go`
- [Get a connection](https://docs.gorunner.io/api/connections/get-connection): `GET /api/connections/{id}`
- [Rename or update a connection](https://docs.gorunner.io/api/connections/update-connection): `PUT /api/connections/{id}`
- [Delete a connection](https://docs.gorunner.io/api/connections/delete-connection): `DELETE /api/connections/{id}`
- [Get a connection’s settings](https://docs.gorunner.io/api/connections/get-connection-settings): `GET /api/connections/{id}/settings`
- [Test a connection](https://docs.gorunner.io/api/connections/test-connection): `POST /api/connections/{id}/test`
- [Move workflows to another connection](https://docs.gorunner.io/api/connections/replace-connection-references): `POST /api/connections/{id}/replace`
- [Start a sign-in for a connection](https://docs.gorunner.io/api/connections/start-connection-oauth2): `POST /api/connections/{id}/oauth2/start`
- [Check a connection’s sign-in](https://docs.gorunner.io/api/connections/get-connection-oauth2-attempt): `GET /api/connections/{id}/oauth2/attempts/{attemptId}`

### Folders

- [List folders](https://docs.gorunner.io/api/folders/list-folders): `GET /api/folders`
- [Create a folder](https://docs.gorunner.io/api/folders/create-folder): `POST /api/folders`
- [Rename or move a folder](https://docs.gorunner.io/api/folders/update-folder): `PUT /api/folders/{id}`
- [Delete a folder](https://docs.gorunner.io/api/folders/delete-folder): `DELETE /api/folders/{id}`

### Templates

- [List templates](https://docs.gorunner.io/api/templates/list-templates): `GET /api/templates`
- [Save a workflow as a template](https://docs.gorunner.io/api/templates/create-template): `POST /api/templates`
- [Count templates](https://docs.gorunner.io/api/templates/count-templates): `GET /api/templates/count`
- [Preview saving a template](https://docs.gorunner.io/api/templates/preview-template-save): `POST /api/templates/save-preview`
- [Get a template](https://docs.gorunner.io/api/templates/get-template): `GET /api/templates/{id}`
- [Update a template](https://docs.gorunner.io/api/templates/update-template): `PUT /api/templates/{id}`
- [Delete a template](https://docs.gorunner.io/api/templates/delete-template): `DELETE /api/templates/{id}`
- [Update a template’s steps](https://docs.gorunner.io/api/templates/replace-template-steps): `PUT /api/templates/{id}/definition`
- [Make a workflow from a template](https://docs.gorunner.io/api/templates/use-template): `POST /api/templates/{id}/use`
- [Preview using a template](https://docs.gorunner.io/api/templates/preview-template-use): `POST /api/templates/{id}/use/preview`

Source: https://docs.gorunner.io/api
