## get/app/api/v1/response-actions

### List all response actions

**Authorizations**  
ApiKeyAuth  
*Authorization*: string Required

### Query parameters
- **is_archived** boolean Optional
  - Filter by archived status (default: false)

### Responses

- **200**  
  List of response actions  
  `application/json`

| Property            | Type               | Description                       | Status      |
|---------------------|--------------------|-----------------------------------|-------------|
| created_at          | string · date-time  | Read-only Required                | ---         |
| display_name        | string             | Required                          | ---         |
| id                  | integer            | Read-only Required                | ---         |
| is_archived         | boolean            | Optional                          | ---         |
| is_enabled          | boolean            | Optional                          | ---         |
| trigger_def         | object · ResponseTriggerDef | Required            | ---         |
| updated_at          | string · date-time  | Read-only Required                | ---         |

**Responses (Errors)**
- **401** Unauthorized  
- **403** Access denied  
- **500** System error  
- **503** System not ready for requests

### HTTP Example
```
GET /app/api/v1/response-actions HTTP/1.1
Authorization: YOUR_API_KEY
Accept: */*
```

### Successful Response
```
[
  {
    "created_at": "2026-07-27T03:07:10.743Z",
    "display_name": "text",
    "id": 1,
    "is_archived": true,
    "is_enabled": true,
    "trigger_def": {
      "created_at": "2026-07-27T03:07:10.743Z",
      "display_index": 1,
      "is_archived": true,
      "is_runnable": true,
      "is_scriptable": true,
      "parent": "123e4567-e89b-12d3-a456-426614174000",
      "script_var_names": ["text"],
      "trigger_arg_names": ["text"],
      "trigger_display_name": "text",
      "trigger_fn_name": "text",
      "trigger_tree_labels": ["text"],
      "updated_at": "2026-07-27T03:07:10.743Z",
      "uuid": "123e4567-e89b-12d3-a456-426614174000"
    },
    "updated_at": "2026-07-27T03:07:10.743Z"
  }
]
```

## post/app/api/v1/response-actions

### Create a new response action

**Authorizations**  
ApiKeyAuth  
*Authorization*: string Required

### Body
- `application/json`

| Property             | Type                 | Description                       | Status      |
|----------------------|----------------------|-----------------------------------|-------------|
| code                 | string               | Optional                          | ---         |
| display_name         | string               | Required                          | ---         |
| trigger_def_uuid     | string · uuid        | Required                          | ---         |

### Responses

- **201** Response action created successfully  
  `application/json`

**Responses (Errors)**
- **400** Bad request - invalid input  
- **401** Unauthorized  
- **403** Access denied  
- **500** System error  
- **503** System not ready for requests

### HTTP Example
```
POST /app/api/v1/response-actions HTTP/1.1
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 95

{
  "code": "text",
  "display_name": "text",
  "trigger_def_uuid": "123e4567-e89b-12d3-a456-426614174000"
}
```

### Successful Response
```
{
  "created_at": "2026-07-27T03:07:10.743Z",
  "display_name": "text",
  "id": 1,
  "is_archived": true,
  "is_enabled": true,
  "trigger_def": {
    "created_at": "2026-07-27T03:07:10.743Z",
    "display_index": 1,
    "is_archived": true,
    "is_runnable": true,
    "is_scriptable": true,
    "parent": "123e4567-e89b-12d3-a456-426614174000",
    "script_var_names": ["text"],
    "trigger_arg_names": ["text"],
    "trigger_display_name": "text",
    "trigger_fn_name": "text",
    "trigger_tree_labels": ["text"],
    "updated_at": "2026-07-27T03:07:10.743Z",
    "uuid": "123e4567-e89b-12d3-a456-426614174000"
  },
  "updated_at": "2026-07-27T03:07:10.743Z"
}
```

## post/app/api/v1/response-actions/test

### Execute a test run of a response action script without saving to database

**Authorizations**  
ApiKeyAuth  
*Authorization*: string Required

### Body
- `application/json`

| Property            | Type                 | Description                       | Status      |
|---------------------|----------------------|-----------------------------------|-------------|
| script_code         | string               | Required                          | ---         |
| trigger_args        | object               | Required                          | ---         |

### Responses

- **200** Test run completed successfully  
  `application/json`

| Property            | Type               | Description                       | Status      |
|---------------------|--------------------|-----------------------------------|-------------|
| status              | string Optional     | Execution status                  | ---         |
| stderr              | string Optional     | Standard error from script execution | ---       |
| stdout              | string Optional     | Standard output from script execution | ---       |

**Responses (Errors)**
- **400** Bad request - invalid input  
- **401** Unauthorized  
- **403** Access denied  
- **422** Script execution failed  
- **500** System error  
- **503** System not ready for requests

### HTTP Example
```
POST /app/api/v1/response-actions/test HTTP/1.1
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 40

{
  "script_code": "text",
  "trigger_args": {}
}
```

### Successful Response
```
{
  "status": "text",
  "stderr": "text",
  "stdout": "text"
}
```

## get/app/api/v1/response-actions/triggers

### List available response triggers for action creation

**Authorizations**  
ApiKeyAuth  
*Authorization*: string Required

### Responses

- **200** List of available triggers  
  `application/json`

| Property            | Type               | Description                       | Status      |
|---------------------|--------------------|-----------------------------------|-------------|
| created_at          | string · date-time  | Read-only Required                | ---         |
| display_index       | integer             | Optional
- min: -2147483648 - max: 2147483647 | ---         |
| is_archived         | boolean            | Optional                          | ---         |
| is_runnable         | boolean            | Optional                          | ---         |
| is_scriptable       | boolean            | Optional                          | ---         |
| parent              | string · uuid      | Nullable Optional                  | ---         |
| script_var_names    | string[]           | Optional                          | ---         |
| trigger_arg_names    | string[]           | Optional                          | ---         |
| trigger_display_name | string             | Required                          | ---         |
| trigger_fn_name     | string             | Required                          | ---         |
| trigger_tree_labels  | string[]           | Optional                          | ---         |
| updated_at          | string · date-time  | Read-only Required                | ---         |
| uuid                | string · uuid      | Required                          | ---         |

**Responses (Errors)**
- **401** Unauthorized  
- **403** Access denied  
- **500** System error  
- **503** System not ready for requests

### HTTP Example
```
GET /app/api/v1/response-actions/triggers HTTP/1.1
Authorization: YOUR_API_KEY
Accept: */*
```

### Successful Response
```
[
  {
    "created_at": "2026-07-27T03:07:10.743Z",
    "display_index": 1,
    "is_archived": true,
    "is_runnable": true,
    "is_scriptable": true,
    "parent": "123e4567-e89b-12d3-a456-426614174000",
    "script_var_names": ["text"],
    "trigger_arg_names": ["text"],
    "trigger_display_name": "text",
    "trigger_fn_name": "text",
    "trigger_tree_labels": ["text"],
    "updated_at": "2026-07-27T03:07:10.743Z",
    "uuid": "123e4567-e89b-12d3-a456-426614174000"
  }
]
```

## get/app/api/v1/response-actions/{script_id}

### Get response action details with version and run counts

**Authorizations**  
ApiKeyAuth  
*Authorization*: string Required

### Path parameters
- **script_id** integer Required

### Responses

- **200** Response action details with counts and latest version/run  
  `application/json`

| Property            | Type               | Description                       | Status      |
|---------------------|--------------------|-----------------------------------|-------------|
| counts              | object Optional     | Show properties                   | ---         |
| latest              | object Optional     | Show properties                   | ---         |

**Responses (Errors)**
- **401** Unauthorized  
- **403** Access denied  
- **404** Resource not found  
- **500** System error  
- **503** System not ready for requests

### HTTP Example
```
GET /app/api/v1/response-actions/{script_id} HTTP/1.1
Authorization: YOUR_API_KEY
Accept: */*
```

### Successful Response
```
{
  "counts": {
    "run": 1,
    "version": 1
  },
  "latest": {
    "run": {},
    "version": {}
  }
}
```

## delete/app/api/v1/response-actions/{script_id}

### Archive (soft delete) a response action

**Authorizations**  
ApiKeyAuth  
*Authorization*: string Required

### Path parameters
- **script_id** integer Required

### Responses

- **204** Response action archived successfully  
  
  `No content`

### HTTP Example
```
DELETE /app/api/v1/response-actions/{script_id} HTTP/1.1
Authorization: YOUR_API_KEY
Accept: */*
```

### Successful Response
```
204
No content
```

## patch/app/api/v1/response-actions/{script_id}

### Update response action properties

**Authorizations**  
ApiKeyAuth  
*Authorization*: string Required

### Path parameters
- **script_id** integer Required

### Body
- `application/json`

| Property            | Type                 | Description                       | Status      |
|---------------------|----------------------|-----------------------------------|-------------|
| display_name        | string               | Optional                          | ---         |
| is_enabled          | boolean              | Optional                          | ---         |
| trigger_def_uuid     | string · uuid        | Optional                          | ---         |

### Responses

- **200** Response action updated successfully  
  
  `No content`

**Responses (Errors)**
- **400** Bad request or cannot update archived action  
- **401** Unauthorized  
- **403** Access denied  
- **404** Resource not found  
- **500** System error  
- **503** System not ready for requests

### HTTP Example
```
PATCH /app/api/v1/response-actions/{script_id} HTTP/1.1
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "display_name": "text",
  "is_enabled": true,
  "trigger_def_uuid": "123e4567-e89b-12d3-a456-426614174000"
}
```

### Successful Response
```
200
No content
```

## get/app/api/v1/response-actions/{script_id}/runs

### List all runs for a response action

**Authorizations**  
ApiKeyAuth  
*Authorization*: string Required

### Path parameters
- **script_id** integer Required

### Responses

- **200** List of response action runs  
  `application/json`

| Property            | Type               | Description                       | Status      |
|---------------------|--------------------|-----------------------------------|-------------|
| created_at          | string · date-time  | Read-only Required                | ---         |
| id                  | integer            | Read-only Required                | ---         |
| script              | object · ResponseScript Required  | Show properties                   | ---         |
| script_version      | object · ResponseScriptVersionSerializerForUI Required | Show properties                   | ---         |
| status              | string · enum      | Required                              | ---         |
- Possible values: `running`, `success`, `failed`, `timed_out`, `error`  
| stderr              | string · nullable   | Optional                          | ---         |
| stdout              | string · nullable   | Optional                          | ---         |
| syserr             | string · nullable   | Optional                          | ---         |
| trigger_run         | object · ResponseTriggerRunSerializerForUI Required | Show properties                   | ---         |
| updated_at          | string · date-time  | Read-only Required                | ---         |

### HTTP Example
```
GET /app/api/v1/response-actions/{script_id}/runs HTTP/1.1
Authorization: YOUR_API_KEY
Accept: */*
```

### Successful Response
```
[
  {
    "created_at": "2026-07-27T03:07:10.743Z",
    "id": 1,
    "script": {
      "created_at": "2026-07-27T03:07:10.743Z",
      "display_name": "text",
      "id": 1,
      "is_archived": true,
      "is_enabled": true,
      "trigger_def": "123e4567-e89b-12d3-a456-426614174000",
      "updated_at": "2026-07-27T03:07:10.743Z"
    },
    "script_version": {
      "author": {
        "email": "name@gmail.com",
        "first_name": "text",
        "id": 1,
        "last_name": "text",
        "oidc_user_id": "text",
        "role": "admin"
      },
      "code": "text",
      "created_at": "2026-07-27T03:07:10.743Z",
      "id": 1,
      "script": 1,
      "updated_at": "2026-07-27T03:07:10.743Z",
      "v_num": 1
    },
    "status": "running",
    "stderr": "text",
    "stdout": "text",
    "syserr": "text",
    "trigger_run": {
      "batch": 1,
      "created_at": "2026-07-27T03:07:10.743Z",
      "id": 1,
      "trigger_args": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "trigger_def": {
        "created_at": "2026-07-27T03:07:10.743Z",
        "display_index": 1,
        "is_archived": true,
        "is_runnable": true,
        "is_scriptable": true,
        "parent": "123e4567-e89b-12d3-a456-426614174000",
        "script_var_names": ["text"],
        "trigger_arg_names": ["text"],
        "trigger_display_name": "text",
        "trigger_fn_name": "text",
        "trigger_tree_labels": ["text"],
        "updated_at": "2026-07-27T03:07:10.743Z",
        "uuid": "123e4567-e89b-12d3-a456-426614174000"
      },
      "updated_at": "2026-07-27T03:07:10.743Z"
    },
    "updated_at": "2026-07-27T03:07:10.743Z"
  }
]
```
