# Switch on a declared action

Source: https://docs.vlayers.ai/reference/agent-actions/activate-action

`PUT /v1/agents/{id}/action-activations` · scope `agent_actions:write`

Switches on one declaration of the agent's published version, by `actionId` and `fingerprint`. It needs a workspace admin's session: a key that asks gets 403 `forbidden`. A fingerprint the published version does not declare is 409 `declaration_not_found`. Activating again after a revoke adds a new record; the earlier one stays.

Requires an API key with the `agent_actions:write` scope.

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | The agent id. Example: `"0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78"` |
| `actionId` | body | string | yes | The declared action. |
| `fingerprint` | body | string | yes | The fingerprint from the list. |

## Request

cURL:

```bash
curl -X PUT "https://api.vlayers.ai/v1/agents/$AGENT_ID/action-activations" \
  -H "Authorization: Bearer $VOICELAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actionId": "vl.send_text",
    "fingerprint": "f3a9c1d2e4b5a6978877665544332211"
  }'
```

TypeScript:

```ts
import { VoiceLayer } from '@voicelayer/api';

const voicelayer = new VoiceLayer();

const { activated } = await voicelayer.agentActions.activateAction('<agent-id>', {
  actionId: 'vl.send_text',
  fingerprint: 'f3a9c1d2e4b5a6978877665544332211'
});
console.log(activated);
```

Python:

```python
from voicelayer import VoiceLayer

vl = VoiceLayer()

result = vl.agentActions.activate_action(
    "<agent-id>",
    action_id="vl.send_text",
    fingerprint="f3a9c1d2e4b5a6978877665544332211",
)
print(result.activated)
```

## Response `200`

```json
{
  "activated": true
}
```
