# Draft an agent from a plain-language description

> POST /agents/generate. HeyRik API parameters and documented request and response examples.

Source: https://www.heyrik.com/docs/api-reference/agents/post-agents-generate-draft-an-agent-from-a-plain-language-description

POST https://server.heyrik.com/api/v1/agents/generate

## Headers

Authorization: Bearer $HEYRIK_API_KEY (required). Keep your key on your server.

## Parameters

- description (string, required): "A clinic receptionist that books appointments and answers timings".
- category (string): Optional hint: healthcare, sales, support…

## Notes

Returns a complete DRAFT config — nothing is saved — in the SAME shape POST /agents accepts: ordered prompt_sections (persona → language restrictions → phased conversation flow → guardrails → FAQ → closing), languages, a greeting, config.input_variables declared for every {{placeholder}} it wrote (each with a sensible default so nothing leaks), and config.extracted_variables to capture after the call. Review it, then POST /agents to create.

## Request example

```sh
curl -X POST https://server.heyrik.com/api/v1/agents/generate \
  -H "Authorization: Bearer $HEYRIK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "description": "A clinic receptionist that books appointments and answers timings" }'
```
