---
docId: doc_a91277db7ef84523bb42d70704c37ed2
title: Activate a function
description: "Activate a paused function so agents can use its published version."
api:
  group: herramientas/funciones-personalizadas
  auth: bearer
  operations:
    - operationId: enableFunction
      method: POST
      path: '/v1/tools/functions/{functionId}/enable'
      postmanName: Activate a function
---

<script>
  import { Ways } from '$lib/components';
</script>

# Activate a function

Set a paused function to `enabled`. It returns to the catalog, and connected agents can use its published version. A published version is required.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X POST "https://api.platic.ai/v1/tools/functions/$FUNCTION_ID/enable" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.tools.functions.enable("fn_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `functionId` | string | Function ID | ✓ |

## Request body

It has no body.

## Response

`data` has the complete function, with the fields of [Get a function](/api-reference/custom-functions/get#response-fields).

```json
{
  "status": "success",
  "message": "Function enabled: agents connected to it can call it",
  "data": {
    "id": "Hk2s9QmXc1",
    "name": "tax_id_lookup",
    "status": "enabled",
    "liveVersion": 2,
    "toolName": "fn_tax_id_lookup",
    "toolId": "Hk2s9QmXc1",
    "nextStep": "Live (version 2). Connect it to an agent with PUT /v1/agents/{agentId}/tools/Hk2s9QmXc1."
  }
}
```

Some fields are left out of the example.

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `403` | `FORBIDDEN` or `INSUFFICIENT_SCOPE` | The credential does not have write access to Integrations |
| `404` | `NOT_FOUND` | The function does not exist in this workspace |
| `409` | `NOT_PUBLISHED` | The function has never been published. [Publish it](/api-reference/custom-functions/publish) |

## Notes

- Activating a function that is already on changes nothing.
- Activating does not publish the draft. For agents to use your changes, [publish](/api-reference/custom-functions/publish).
