> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# Get an Invocation

`GET https://api.pagerduty.com/automation_actions/invocations/{id}`

Get an Automation Action Invocation

## Authorization

- **api_key** (apiKey) — `Authorization` header. The API Key with format `Token token=<API_KEY>`

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | The ID of the resource. |

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Accept` | string | yes | The `Accept` header is used as a versioning header. Default: `application/vnd.pagerduty+json;version=2`. |

## Response 200

Invocation information

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `invocation` | object | yes |  |
| `invocation.id` | string | yes | Read-only. |
| `invocation.summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `invocation.type` | string | yes | A string that determines the schema of the object. This must be the standard name for the entity, suffixed by `_reference` if the object is a reference. Read-only. |
| `invocation.self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `invocation.html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `invocation.action_snapshot` | object | yes |  |
| `invocation.action_snapshot.name` | string | yes |  |
| `invocation.action_snapshot.action_type` | string | yes | One of: `script`, `process_automation`. |
| `invocation.action_snapshot.action_data_reference` | one of: object \| object |  |  |
| `invocation.action_snapshot.action_data_reference.process_automation_job_id` | string | yes | (option 1) Max length: 36. |
| `invocation.action_snapshot.action_data_reference.process_automation_job_arguments` | string |  | (option 1) Arguments to pass to the Process Automation job. The maxLength value is specified in bytes. Max length: 1024. |
| `invocation.action_snapshot.action_data_reference.process_automation_node_filter` | string |  | (option 1) Node filter for the Process Automation job. The maxLength value is specified in bytes. Filter syntax: https://docs.rundeck.com/docs/manual/11-node-filters.html#node-filter-syntax. Max length: 1024. |
| `invocation.action_snapshot.action_data_reference.script` | string | yes | (option 2) Body of the script to be executed on the Runner. To execute it, the Runner will write the content of the property into a temp file, make the file executable and execute it. It is assumed that the Runner has a properly configured environment to run the script as an executable file. This behaviour can be altered by providing the `invocation_command` property. The maxLength value is specified in bytes. Max length: 16777215. |
| `invocation.action_snapshot.action_data_reference.invocation_command` | string |  | (option 2) The command to executed a script with. With the body of the script written into a temp file, the Runner will execute the `<invocation_command> <temp_file>` command. The maxLength value is specified in bytes. Max length: 65535. |
| `invocation.runner_id` | string | yes |  |
| `invocation.timing` | array of object | yes | A list of state transitions with timestamps, sorted in ascending order by timestamp. Only the 'created' transition is guaranteed to exist at any time. |
| `invocation.timing[].timestamp` | string (date-time) | yes | The date/time. |
| `invocation.timing[].state` | string | yes | prepared -- the invocation exists and can be referenced, but is NOT available to a Runner <br> created -- the invocation exists and is waiting for a Runner <br> sent -- invocation sent to a Runner <br> queued -- invocation queued by a Runner <br> running -- invocation is being ran by a Runner <br> aborted -- invocation was aborted on a Runner <br> completed -- invocation completed on a Runner <br> error -- invocation encountered an error on a Runner unknown -- transient error encountered when fetching invocation state. One of: `prepared`, `created`, `sent`, `queued`, `running`, `aborted`, `completed`, `error`, `unknown`. |
| `invocation.duration` | integer |  | The duration of the invocation's execution time. |
| `invocation.state` | string | yes | prepared -- the invocation exists and can be referenced, but is NOT available to a Runner <br> created -- the invocation exists and is waiting for a Runner <br> sent -- invocation sent to a Runner <br> queued -- invocation queued by a Runner <br> running -- invocation is being ran by a Runner <br> aborted -- invocation was aborted on a Runner <br> completed -- invocation completed on a Runner <br> error -- invocation encountered an error on a Runner unknown -- transient error encountered when fetching invocation state. One of: `prepared`, `created`, `sent`, `queued`, `running`, `aborted`, `completed`, `error`, `unknown`. |
| `invocation.action_id` | string | yes |  |
| `invocation.metadata` | object | yes |  |
| `invocation.metadata.agent` | one of: object \| object \| object \| object | yes |  |
| `invocation.metadata.agent.id` | string | yes | (option 1) Read-only. |
| `invocation.metadata.agent.summary` | string \| null |  | (option 1) A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `invocation.metadata.agent.type` | string | yes | (option 1) One of: `user_reference`. |
| `invocation.metadata.agent.self` | string \| null (url) |  | (option 1) the API show URL at which the object is accessible. Read-only. |
| `invocation.metadata.agent.html_url` | string \| null (url) |  | (option 1) a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `invocation.metadata.agent.id` | string | yes | (option 2) |
| `invocation.metadata.agent.type` | string | yes | (option 2) |
| `invocation.metadata.agent.id` | string | yes | (option 3) Read-only. |
| `invocation.metadata.agent.summary` | string \| null |  | (option 3) A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `invocation.metadata.agent.type` | string | yes | (option 3) One of: `account_reference`. |
| `invocation.metadata.agent.self` | string \| null (url) |  | (option 3) the API show URL at which the object is accessible. Read-only. |
| `invocation.metadata.agent.html_url` | string \| null (url) |  | (option 3) a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `invocation.metadata.agent.id` | string | yes | (option 4) |
| `invocation.metadata.agent.type` | string | yes | (option 4) |
| `invocation.metadata.incident` | object |  |  |
| `invocation.metadata.incident.id` | string | yes | Read-only. |
| `invocation.metadata.incident.summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `invocation.metadata.incident.type` | string | yes | One of: `incident_reference`. |
| `invocation.metadata.incident.self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `invocation.metadata.incident.html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |

Example: Response Example

```json
{
  "invocation": {
    "id": "01DBYD4A25RCXAXQDC9ZX0678V",
    "type": "invocation",
    "action_id": "01DAW70HK24JZORNE0P9C2V1L9",
    "action_snapshot": {
      "name": "Restart Apache",
      "action_type": "process_automation",
      "action_data_reference": {
        "process_automation_job_arguments": "prod-datapipe",
        "process_automation_node_filter": "mynode1 !nodename: mynode2",
        "process_automation_job_id": "79c199bba1aff6e519f198457f5ec0fc"
      }
    },
    "duration": 5,
    "metadata": {
      "agent": {
        "id": "PRJ94S1",
        "type": "user_reference"
      },
      "incident": {
        "id": "Q2LAR4ADCXC8IB",
        "type": "incident_reference"
      }
    },
    "runner_id": "01COQFFNVWIONSLY8C66YTU2O5",
    "state": "completed",
    "timing": [
      {
        "creation_timestamp": "2022-11-08T06:30:05.018949Z",
        "state": "created"
      },
      {
        "creation_timestamp": "2022-11-08T06:30:10.069000Z",
        "state": "running"
      },
      {
        "creation_timestamp": "2022-11-08T06:30:10.083000Z",
        "state": "completed"
      },
      {
        "creation_timestamp": "2022-11-08T06:30:10.066000Z",
        "state": "queued"
      }
    ]
  }
}
```

## Response 400

Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 401

Caller did not supply credentials or did not provide the correct credentials.
If you are using an API key, it may be invalid or your Authorization header may be malformed.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 402

Account does not have the abilities to perform the action. Please review the response for the required abilities.
You can also use the [Abilities API](#resource_Abilities) to determine what features are available to your account.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 403

Caller is not authorized to view the requested resource.
While your authentication is valid, the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 404

The requested resource was not found.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 429

Too many requests have been made, the rate limit has been reached.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 500

Internal Server Error the PagerDuty server experienced an error.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
