---
docId: doc_77456a9965d446129b4b82f16064c507
title: Delete a function
description: "Delete a function, its code, versions, and agent connections."
api:
  group: herramientas/funciones-personalizadas
  auth: bearer
  operations:
    - operationId: deleteFunction
      method: DELETE
      path: '/v1/tools/functions/{functionId}'
      postmanName: Delete a function
---

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

# Delete a function

Deletes the function for good: its code, its versions, its catalog tool and its connections to agents.

## Example

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

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

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

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

</Ways.Way>
</Ways>

<Note type="important">

It cannot be undone. To stop using it without losing it, [pause the function](/api-reference/custom-functions/pause).

</Note>

## Path parameters

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

## Response

```json
{
  "status": "success",
  "message": "Function deleted, with its catalog tool and its agent connections",
  "data": {
    "id": "Hk2s9QmXc1",
    "deleted": true
  }
}
```

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `403` | `FORBIDDEN` or `INSUFFICIENT_SCOPE` | The credential does not have delete access to Integrations (an OAuth token also needs `platica:write`) |
| `404` | `NOT_FOUND` | The function does not exist in this workspace |

## Notes

- Agents that had it connected stop seeing it immediately.
- Bound secrets are not deleted: they stay in [Secrets](/api-reference/secrets).
- Its [executions](/api-reference/custom-functions/executions) are kept for 30 days.
