# NodeHive Admin API

Provides authenticated admin API endpoints for write and tool execution use cases.

## Endpoints

- `GET /api/nodehive/admin/v1`
- `GET /api/nodehive/admin/v1/tools`
- `POST /api/nodehive/admin/v1/tools/execute`

## Authentication

These routes live under `/api/*`, so they are compatible with the
`nodehive_api_key_management` bearer-key flow:

```bash
Authorization: Bearer nhk_...
```

They can also be used with normal authenticated Drupal sessions.

## Permissions

- `access nodehive admin api`
- `execute nodehive admin tools`

For `POST /tools/execute`, both permissions are required.

## Execute request format

```json
{
  "tool_id": "display_message",
  "arguments": {
    "message": "Hello from API",
    "type": "status"
  }
}
```

## Example

```bash
curl -X POST "https://your-site.tld/api/nodehive/admin/v1/tools/execute" \
  -H "Authorization: Bearer nhk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tool_id":"display_message","arguments":{"message":"Hello","type":"status"}}'
```
