{ "opencollection": "1.0.0", "info": { "name": "Port Action Runs API", "version": "1.0" }, "items": [ { "info": { "name": "Action Runs", "type": "folder" }, "items": [ { "info": { "name": "Execute a self-service action", "type": "http" }, "http": { "method": "POST", "url": "{{baseUrl}}/v1/actions/:action_identifier/runs", "params": [ { "name": "run_as", "value": "", "type": "query", "description": "The executing user of the action. If not provided, the action will be run on behalf of the user/machine who initiated the action (identified by the bearer token used to execute this route)." }, { "name": "action_identifier", "value": "", "type": "path", "description": "The identifier of the action/automation you want to operate on." } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "Authorization", "value": "{{Authorization}}", "placement": "header" } }, "docs": "This route allows you to execute a self-service action, thus creating an action run.

To learn more about action runs, check out the [documentation](https://docs.port.io/create-self-service-experiences/reflect-action-progress/)." }, { "info": { "name": "Get an action run's details", "type": "http" }, "http": { "method": "GET", "url": "{{baseUrl}}/v1/actions/runs/:run_id", "params": [ { "name": "version", "value": "", "type": "query", "description": "Specifies the API version to use. Please use `v2` for the latest version of the API." }, { "name": "run_id", "value": "", "type": "path", "description": "The identifier of the action run." } ], "auth": { "type": "apikey", "key": "Authorization", "value": "{{Authorization}}", "placement": "header" } }, "docs": "This route allows you to fetch the details of an action run.

To learn more about action runs, check out the [documentation](https://docs.port.io/create-self-service-experiences/reflect-action-progress/).

:::info Version parameter
Set the `version` parameter to `v2` for the latest version of the API.
:::" }, { "info": { "name": "Update an action run", "type": "http" }, "http": { "method": "PATCH", "url": "{{baseUrl}}/v1/actions/runs/:run_id", "params": [ { "name": "version", "value": "", "type": "query", "description": "Specifies the API version to use. Please use `v2` for the latest version of the API." }, { "name": "run_id", "value": "", "type": "path", "description": "The identifier of the action run." } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "Authorization", "value": "{{Authorization}}", "placement": "header" } }, "docs": "This route allows you to update an action run's details. This can be used to update the run's status & label, and add links to it (e.g. external logs of the job runner).

To learn more about action runs, check out the [documentation](https://docs.port.io/create-self-service-experiences/reflect-action-progress/)." }, { "info": { "name": "Approve an action run", "type": "http" }, "http": { "method": "PATCH", "url": "{{baseUrl}}/v1/actions/runs/:run_id/approval", "params": [ { "name": "version", "value": "", "type": "query", "description": "Specifies the API version to use. Please use `v2` for the latest version of the API." }, { "name": "run_id", "value": "", "type": "path", "description": "The identifier of the action run." } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "Authorization", "value": "{{Authorization}}", "placement": "header" } }, "docs": "This route allows you to approve or decline a request to execute an action that requires approval.

To learn more about manual approval for actions, check out the [documentation](https://docs.port.io/create-self-service-experiences/set-self-service-actions-rbac/#configure-manual-approval-for-actions).

:::info Version parameter value
Set the `version` parameter to `v2` for the latest version of the API.
:::" }, { "info": { "name": "Get all action runs", "type": "http" }, "http": { "method": "GET", "url": "{{baseUrl}}/v1/actions/runs", "params": [ { "name": "entity", "value": "", "type": "query", "description": "The identifier of the entity associated with the action run." }, { "name": "blueprint", "value": "", "type": "query", "description": "The identifier of the blueprint associated with the action run." }, { "name": "active", "value": "", "type": "query", "description": "If `true`, only running action runs will be fetched." }, { "name": "user_email", "value": "", "type": "query", "description": "The email of the user who initiated the action run." }, { "name": "user_id", "value": "", "type": "query", "description": "The id of the user who initiated the action run." }, { "name": "limit", "value": "", "type": "query", "description": "The maximum number of action runs to fetch." }, { "name": "exclude", "value": "", "type": "query", "description": "The fields to exclude from the response" }, { "name": "external_run_id", "value": "", "type": "query", "description": "The run id of your backend, for example the id that GitHub gives the workflow. This can be used to identify the action run instead of the `run_id`." }, { "name": "version", "value": "", "type": "query", "description": "Specifies the API version to use. Please use `v2` for the latest version of the API." }, { "name": "action", "value": "", "type": "query" }, { "name": "source", "value": "", "type": "query" } ], "auth": { "type": "apikey", "key": "Authorization", "value": "{{Authorization}}", "placement": "header" } }, "docs": "This route allows you to fetch all action runs in your Port account. The route will perform a logical `AND` between all query parameters below, and return all action runs that match the criteria.

To learn more about action runs, check out the [documentation](https://docs.port.io/create-self-service-experiences/reflect-action-progress/).

:::info Version parameter
Set the `version` parameter to `v2` for the latest version of the API.
:::" }, { "info": { "name": "Get an action's run logs", "type": "http" }, "http": { "method": "GET", "url": "{{baseUrl}}/v1/actions/runs/:run_id/logs", "params": [ { "name": "limit", "value": "", "type": "query", "description": "The maximum number of logs to fetch." }, { "name": "offset", "value": "", "type": "query", "description": "The number of logs to skip." }, { "name": "run_id", "value": "", "type": "path", "description": "The identifier of the action run." } ], "auth": { "type": "apikey", "key": "Authorization", "value": "{{Authorization}}", "placement": "header" } }, "docs": "This route allows you to fetch the logs from an action run.

To learn more about action runs, check out the [documentation](https://docs.port.io/create-self-service-experiences/reflect-action-progress/)." }, { "info": { "name": "Add a log to an action run", "type": "http" }, "http": { "method": "POST", "url": "{{baseUrl}}/v1/actions/runs/:run_id/logs", "params": [ { "name": "run_id", "value": "", "type": "path", "description": "The identifier of the action run." } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "apikey", "key": "Authorization", "value": "{{Authorization}}", "placement": "header" } }, "docs": "This route allows you to send a log message back to Port, which will be displayed in the action run's page. You can also use this route to update the run's termination status (SUCCESS/FAILURE) and label describing the status.

To learn more about action runs, check out the [documentation](https://docs.port.io/create-self-service-experiences/reflect-action-progress/)." }, { "info": { "name": "Get an action run's approvers", "type": "http" }, "http": { "method": "GET", "url": "{{baseUrl}}/v1/actions/runs/:run_id/approvers", "params": [ { "name": "include_pending_approvers", "value": "", "type": "query", "description": "If `true`, the route will also return the users who have not yet approved the action run." }, { "name": "run_id", "value": "", "type": "path", "description": "The identifier of the action run." } ], "auth": { "type": "apikey", "key": "Authorization", "value": "{{Authorization}}", "placement": "header" } }, "docs": "This route allows you to fetch the approvers of a specific action run.

To learn more about manual approval for actions, check out the [documentation](https://docs.port.io/create-self-service-experiences/set-self-service-actions-rbac/#configure-manual-approval-for-actions)." } ] } ], "bundled": true }