# Response Actions

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

> List all response actions

```json
{"openapi":"3.0.3","info":{"title":"Dropzone AI","version":"0.1.0"},"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"Authorization","type":"apiKey"}},"schemas":{"ResponseScriptSerializerForUI":{"properties":{"created_at":{"format":"date-time","readOnly":true,"type":"string"},"display_name":{"type":"string"},"id":{"readOnly":true,"type":"integer"},"is_archived":{"type":"boolean"},"is_enabled":{"type":"boolean"},"trigger_def":{"$ref":"#/components/schemas/ResponseTriggerDef"},"updated_at":{"format":"date-time","readOnly":true,"type":"string"}},"required":["created_at","display_name","id","trigger_def","updated_at"],"type":"object"},"ResponseTriggerDef":{"properties":{"created_at":{"format":"date-time","readOnly":true,"type":"string"},"display_index":{"maximum":2147483647,"minimum":-2147483648,"type":"integer"},"is_archived":{"type":"boolean"},"is_runnable":{"type":"boolean"},"is_scriptable":{"type":"boolean"},"parent":{"format":"uuid","nullable":true,"type":"string"},"script_var_names":{"items":{"type":"string"},"type":"array"},"trigger_arg_names":{"items":{"type":"string"},"type":"array"},"trigger_display_name":{"type":"string"},"trigger_fn_name":{"type":"string"},"trigger_tree_labels":{"items":{"type":"string"},"type":"array"},"updated_at":{"format":"date-time","readOnly":true,"type":"string"},"uuid":{"format":"uuid","readOnly":true,"type":"string"}},"required":["created_at","trigger_display_name","trigger_fn_name","updated_at","uuid"],"type":"object"}}},"paths":{"/app/api/v1/response-actions":{"get":{"description":"List all response actions","operationId":"response_actions_retrieve","parameters":[{"description":"Filter by archived status (default: false)","in":"query","name":"is_archived","schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ResponseScriptSerializerForUI"},"type":"array"}}},"description":"List of response actions"},"401":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"}},"type":"object"}}},"description":"Access denied"},"500":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System error"},"503":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System not ready for requests"}},"tags":["response-actions"]}}}}
```

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

> Create a new response action

```json
{"openapi":"3.0.3","info":{"title":"Dropzone AI","version":"0.1.0"},"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"Authorization","type":"apiKey"}},"schemas":{"ResponseScriptSerializerForUI":{"properties":{"created_at":{"format":"date-time","readOnly":true,"type":"string"},"display_name":{"type":"string"},"id":{"readOnly":true,"type":"integer"},"is_archived":{"type":"boolean"},"is_enabled":{"type":"boolean"},"trigger_def":{"$ref":"#/components/schemas/ResponseTriggerDef"},"updated_at":{"format":"date-time","readOnly":true,"type":"string"}},"required":["created_at","display_name","id","trigger_def","updated_at"],"type":"object"},"ResponseTriggerDef":{"properties":{"created_at":{"format":"date-time","readOnly":true,"type":"string"},"display_index":{"maximum":2147483647,"minimum":-2147483648,"type":"integer"},"is_archived":{"type":"boolean"},"is_runnable":{"type":"boolean"},"is_scriptable":{"type":"boolean"},"parent":{"format":"uuid","nullable":true,"type":"string"},"script_var_names":{"items":{"type":"string"},"type":"array"},"trigger_arg_names":{"items":{"type":"string"},"type":"array"},"trigger_display_name":{"type":"string"},"trigger_fn_name":{"type":"string"},"trigger_tree_labels":{"items":{"type":"string"},"type":"array"},"updated_at":{"format":"date-time","readOnly":true,"type":"string"},"uuid":{"format":"uuid","readOnly":true,"type":"string"}},"required":["created_at","trigger_display_name","trigger_fn_name","updated_at","uuid"],"type":"object"}}},"paths":{"/app/api/v1/response-actions":{"post":{"description":"Create a new response action","operationId":"response_actions_create","requestBody":{"content":{"application/json":{"schema":{"properties":{"code":{"type":"string"},"display_name":{"type":"string"},"trigger_def_uuid":{"format":"uuid","type":"string"}},"required":["display_name","trigger_def_uuid"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseScriptSerializerForUI"}}},"description":"Response action created successfully"},"400":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Bad request - invalid input"},"401":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"}},"type":"object"}}},"description":"Access denied"},"500":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System error"},"503":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System not ready for requests"}},"tags":["response-actions"]}}}}
```

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

> Execute a test run of a response action script without saving to database. Useful for testing and debugging scripts before deployment.

```json
{"openapi":"3.0.3","info":{"title":"Dropzone AI","version":"0.1.0"},"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"Authorization","type":"apiKey"}}},"paths":{"/app/api/v1/response-actions/test":{"post":{"description":"Execute a test run of a response action script without saving to database. Useful for testing and debugging scripts before deployment.","operationId":"response_actions_test_create","requestBody":{"content":{"application/json":{"schema":{"properties":{"script_code":{"description":"The Python code to execute","type":"string"},"trigger_args":{"description":"Arguments to pass to the script (depends on trigger type)","type":"object"}},"required":["script_code","trigger_args"],"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"status":{"description":"Execution status","type":"string"},"stderr":{"description":"Standard error from script execution","type":"string"},"stdout":{"description":"Standard output from script execution","type":"string"}},"type":"object"}}},"description":"Test run completed successfully"},"400":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Bad request - invalid input"},"401":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"}},"type":"object"}}},"description":"Access denied"},"422":{"content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"stderr":{"type":"string"},"stdout":{"type":"string"}},"type":"object"}}},"description":"Script execution failed"},"500":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System error"},"503":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System not ready for requests"}},"tags":["response-actions"]}}}}
```

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

> List available response triggers for action creation

```json
{"openapi":"3.0.3","info":{"title":"Dropzone AI","version":"0.1.0"},"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"Authorization","type":"apiKey"}},"schemas":{"ResponseTriggerDef":{"properties":{"created_at":{"format":"date-time","readOnly":true,"type":"string"},"display_index":{"maximum":2147483647,"minimum":-2147483648,"type":"integer"},"is_archived":{"type":"boolean"},"is_runnable":{"type":"boolean"},"is_scriptable":{"type":"boolean"},"parent":{"format":"uuid","nullable":true,"type":"string"},"script_var_names":{"items":{"type":"string"},"type":"array"},"trigger_arg_names":{"items":{"type":"string"},"type":"array"},"trigger_display_name":{"type":"string"},"trigger_fn_name":{"type":"string"},"trigger_tree_labels":{"items":{"type":"string"},"type":"array"},"updated_at":{"format":"date-time","readOnly":true,"type":"string"},"uuid":{"format":"uuid","readOnly":true,"type":"string"}},"required":["created_at","trigger_display_name","trigger_fn_name","updated_at","uuid"],"type":"object"}}},"paths":{"/app/api/v1/response-actions/triggers":{"get":{"description":"List available response triggers for action creation","operationId":"response_actions_triggers_retrieve","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ResponseTriggerDef"},"type":"array"}}},"description":"List of available triggers"},"401":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"}},"type":"object"}}},"description":"Access denied"},"500":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System error"},"503":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System not ready for requests"}},"tags":["response-actions"]}}}}
```

## GET /app/api/v1/response-actions/{script\_id}

> Get response action details with version and run counts

```json
{"openapi":"3.0.3","info":{"title":"Dropzone AI","version":"0.1.0"},"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"Authorization","type":"apiKey"}}},"paths":{"/app/api/v1/response-actions/{script_id}":{"get":{"description":"Get response action details with version and run counts","operationId":"response_actions_retrieve_2","parameters":[{"in":"path","name":"script_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"counts":{"properties":{"run":{"type":"integer"},"version":{"type":"integer"}},"type":"object"},"latest":{"properties":{"run":{"type":"object"},"version":{"type":"object"}},"type":"object"}},"type":"object"}}},"description":"Response action details with counts and latest version/run"},"401":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"}},"type":"object"}}},"description":"Access denied"},"404":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System error"},"503":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System not ready for requests"}},"tags":["response-actions"]}}}}
```

## DELETE /app/api/v1/response-actions/{script\_id}

> Archive (soft delete) a response action. Deletes unreferenced versions.

```json
{"openapi":"3.0.3","info":{"title":"Dropzone AI","version":"0.1.0"},"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"Authorization","type":"apiKey"}}},"paths":{"/app/api/v1/response-actions/{script_id}":{"delete":{"description":"Archive (soft delete) a response action. Deletes unreferenced versions.","operationId":"response_actions_destroy","parameters":[{"in":"path","name":"script_id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Response action archived successfully"},"401":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"}},"type":"object"}}},"description":"Access denied"},"404":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System error"},"503":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System not ready for requests"}},"tags":["response-actions"]}}}}
```

## PATCH /app/api/v1/response-actions/{script\_id}

> Update response action properties

```json
{"openapi":"3.0.3","info":{"title":"Dropzone AI","version":"0.1.0"},"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"Authorization","type":"apiKey"}}},"paths":{"/app/api/v1/response-actions/{script_id}":{"patch":{"description":"Update response action properties","operationId":"response_actions_partial_update","parameters":[{"in":"path","name":"script_id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"display_name":{"type":"string"},"is_enabled":{"type":"boolean"},"trigger_def_uuid":{"format":"uuid","type":"string"}},"type":"object"}}}},"responses":{"200":{"description":"Response action updated successfully"},"400":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Bad request or cannot update archived action"},"401":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"}},"type":"object"}}},"description":"Access denied"},"404":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System error"},"503":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System not ready for requests"}},"tags":["response-actions"]}}}}
```

## GET /app/api/v1/response-actions/{script\_id}/runs

> List all runs for a response action

```json
{"openapi":"3.0.3","info":{"title":"Dropzone AI","version":"0.1.0"},"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"Authorization","type":"apiKey"}},"schemas":{"ResponseScriptRunSerializerForUI":{"properties":{"created_at":{"format":"date-time","readOnly":true,"type":"string"},"id":{"readOnly":true,"type":"integer"},"script":{"$ref":"#/components/schemas/ResponseScript"},"script_version":{"$ref":"#/components/schemas/ResponseScriptVersionSerializerForUI"},"status":{"$ref":"#/components/schemas/ResponseScriptRunSerializerForUIStatusEnum"},"stderr":{"nullable":true,"type":"string"},"stdout":{"nullable":true,"type":"string"},"syserr":{"nullable":true,"type":"string"},"trigger_run":{"$ref":"#/components/schemas/ResponseTriggerRunSerializerForUI"},"updated_at":{"format":"date-time","readOnly":true,"type":"string"}},"required":["created_at","id","script","script_version","status","trigger_run","updated_at"],"type":"object"},"ResponseScript":{"properties":{"created_at":{"format":"date-time","readOnly":true,"type":"string"},"display_name":{"type":"string"},"id":{"readOnly":true,"type":"integer"},"is_archived":{"type":"boolean"},"is_enabled":{"type":"boolean"},"trigger_def":{"format":"uuid","type":"string"},"updated_at":{"format":"date-time","readOnly":true,"type":"string"}},"required":["created_at","display_name","id","trigger_def","updated_at"],"type":"object"},"ResponseScriptVersionSerializerForUI":{"properties":{"author":{"$ref":"#/components/schemas/CustomUser"},"code":{"type":"string"},"created_at":{"format":"date-time","readOnly":true,"type":"string"},"id":{"readOnly":true,"type":"integer"},"script":{"type":"integer"},"updated_at":{"format":"date-time","readOnly":true,"type":"string"},"v_num":{"maximum":2147483647,"minimum":-2147483648,"type":"integer"}},"required":["author","created_at","id","script","updated_at","v_num"],"type":"object"},"CustomUser":{"description":"Basic serializer to pass CustomUser details to the front end.\nExtend with any fields your app needs.","properties":{"email":{"format":"email","maxLength":254,"title":"Email address","type":"string"},"first_name":{"maxLength":150,"type":"string"},"id":{"readOnly":true,"type":"integer"},"last_name":{"maxLength":150,"type":"string"},"oidc_user_id":{"nullable":true,"type":"string"},"role":{"$ref":"#/components/schemas/RoleEnum"}},"required":["id"],"type":"object"},"RoleEnum":{"description":"* `admin` - Admin\n* `member` - Member\n* `restricted-read-only` - RRO","enum":["admin","member","restricted-read-only"],"type":"string"},"ResponseScriptRunSerializerForUIStatusEnum":{"description":"* `running` - running\n* `success` - success\n* `failed` - failed\n* `timed_out` - timed_out\n* `error` - error","enum":["running","success","failed","timed_out","error"],"type":"string"},"ResponseTriggerRunSerializerForUI":{"properties":{"batch":{"nullable":true,"type":"integer"},"created_at":{"format":"date-time","readOnly":true,"type":"string"},"id":{"readOnly":true,"type":"integer"},"trigger_args":{"additionalProperties":{},"type":"object"},"trigger_def":{"$ref":"#/components/schemas/ResponseTriggerDef"},"updated_at":{"format":"date-time","readOnly":true,"type":"string"}},"required":["created_at","id","trigger_def","updated_at"],"type":"object"},"ResponseTriggerDef":{"properties":{"created_at":{"format":"date-time","readOnly":true,"type":"string"},"display_index":{"maximum":2147483647,"minimum":-2147483648,"type":"integer"},"is_archived":{"type":"boolean"},"is_runnable":{"type":"boolean"},"is_scriptable":{"type":"boolean"},"parent":{"format":"uuid","nullable":true,"type":"string"},"script_var_names":{"items":{"type":"string"},"type":"array"},"trigger_arg_names":{"items":{"type":"string"},"type":"array"},"trigger_display_name":{"type":"string"},"trigger_fn_name":{"type":"string"},"trigger_tree_labels":{"items":{"type":"string"},"type":"array"},"updated_at":{"format":"date-time","readOnly":true,"type":"string"},"uuid":{"format":"uuid","readOnly":true,"type":"string"}},"required":["created_at","trigger_display_name","trigger_fn_name","updated_at","uuid"],"type":"object"}}},"paths":{"/app/api/v1/response-actions/{script_id}/runs":{"get":{"description":"List all runs for a response action","operationId":"response_actions_runs_retrieve","parameters":[{"in":"path","name":"script_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ResponseScriptRunSerializerForUI"},"type":"array"}}},"description":"List of response action runs"},"401":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string"}},"type":"object"}}},"description":"Access denied"},"404":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System error"},"503":{"content":{"application/json":{"schema":{"properties":{"error_msg":{"type":"string"}},"type":"object"}}},"description":"System not ready for requests"}},"tags":["response-actions"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dropzone.ai/api/response-actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
