> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drdroid.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Writing Custom Actions

Create custom actions to extend DrDroid's capabilities with your own scripts and API integrations.

## Supported Custom Actions

* REST API Calls
* Webhooks
* Custom Scripts (Bash, Python, etc.)
* AWS CLI Commands
* Kubernetes Operations

## Action Types

### 1. HTTP Requests

```yaml theme={null}
method: POST
url: https://api.example.com/endpoint
headers:
  Content-Type: application/json
  Authorization: Bearer ${API_KEY}
body: |
  {
    "key": "value",
    "timestamp": "${CURRENT_TIMESTAMP}"
  }
```

### 2. Shell Scripts

```bash theme={null}
#!/bin/bash
# Get current CPU load
LOAD=$(uptime | awk -F'[a-z]:' '{ print $2 }')

# Send to monitoring system
curl -X POST https://monitor.example.com/api/events \
  -H "Authorization: Bearer ${API_KEY}" \
  -d "{\"load\": \"$LOAD\"}"
```

## Examples

### Kubernetes Pod Restart

```yaml theme={null}
action: kubernetes
execute: delete-pod
namespace: ${NAMESPACE}
pod: ${POD_NAME}
```

### AWS S3 File Check

```yaml theme={null}
action: aws
service: s3
command: ls s3://${BUCKET_NAME}/
```

## Best Practices

* Use environment variables for sensitive data
* Implement proper error handling
* Add timeouts for all external calls
* Document your custom actions
* Test thoroughly before production use


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.