---
docId: doc_37054f7792f7459abbbda4207a543923
title: Get the draft
description: Gets an agent's draft, the version being edited, with its complete configuration.
api:
  group: agentes/borrador
  auth: bearer
  operations:
    - operationId: getDraft
      method: GET
      path: '/v1/agents/{agentId}/draft'
      postmanName: Get the draft
---

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

# Get the draft

Read the draft’s complete [configuration](/api-reference/agents/configuration) before editing it. Use `config` as the starting point if you want to replace the whole draft.

## Example

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

```bash
curl https://api.platic.ai/v1/agents/$AGENT_ID/draft \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

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

```ts
await platic.agents.draft.get("agent_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `agentId` | string | Agent id | ✓ |

## Response

```json
{
  "status": "success",
  "data": {
    "agentId": "Xq8mTe2LwP4kZ1aB9cDf",
    "draft": { "versionId": "v4", "number": 4 },
    "config": {
      "description": "",
      "instructions": "You are the sales assistant for Acme Store.",
      "model": "auto",
      "guardrails": {
        "enabled": true,
        "rules": ["No responder preguntas de trivia, cultura general ni acertijos."],
        "message": "",
        "conversationStrikeThreshold": 3,
        "clientStrikeThreshold": 3
      }
    }
  }
}
```

The response includes all 15 sections in full; the example shows four.

| Field | Description |
|-------|-------------|
| `agentId` | Agent id |
| `draft.versionId` | Version the draft is on, for example `v4` |
| `draft.number` | Number of that version |
| `config` | The complete [configuration](/api-reference/agents/configuration), with its 15 sections. `instructions` is a text |

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `404` | `AGENT_NOT_FOUND` | The agent doesn't exist in the workspace or was deleted |

## Notes

- The draft can be the same version that is published. To know whether it has unpublished changes, check `hasUnpublishedChanges` in [Get an agent](/api-reference/agents/get).
- To change one part, use [Update the draft](/api-reference/agents/drafts/update). This `config` is also the simplest starting point for [replacing the draft](/api-reference/agents/drafts/replace).
- Saving doesn't change the publication. To put a change into production, [publish it](/api-reference/agents/publications/publish).
