> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowyte.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Mint an API key and build a working agent in about five minutes.

This walks you from zero to a published agent you can talk to. Every step is a single API
call against the base URL `https://builder.flowyte.com/api/v1`.

<Note>
  All requests authenticate with a secret API key: `Authorization: Bearer flowyte_sk_…`.
  See [Authentication](/get-started/authentication) for how to mint one.
</Note>

## 1. Create an agent

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://builder.flowyte.com/api/v1/agents \
    -H "Authorization: Bearer $FLOWYTE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "name": "Acme Support" }'
  ```

  ```ts Node theme={null}
  const res = await fetch("https://builder.flowyte.com/api/v1/agents", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.FLOWYTE_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ name: "Acme Support" }),
  });
  const { data: agent } = await res.json();
  ```

  ```python Python theme={null}
  import os, requests
  r = requests.post(
      "https://builder.flowyte.com/api/v1/agents",
      headers={"Authorization": f"Bearer {os.environ['FLOWYTE_API_KEY']}"},
      json={"name": "Acme Support"},
  )
  agent = r.json()["data"]
  ```
</CodeGroup>

The response is the `ApiResponse<Agent>` envelope. Capture `data.id` — that's your `agentId`.

## 2. Give it knowledge

Add a source the agent can answer from. Knowledge ingestion is **asynchronous** — poll the
source until its `status` is `indexed`.

```bash theme={null}
curl -X POST https://builder.flowyte.com/api/v1/agents/$AGENT_ID/knowledge/sources \
  -H "Authorization: Bearer $FLOWYTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "kind": "url", "label": "Help center", "url": "https://acme.com/help" }'

# poll until indexed
curl https://builder.flowyte.com/api/v1/agents/$AGENT_ID/knowledge/sources/$SOURCE_ID \
  -H "Authorization: Bearer $FLOWYTE_API_KEY"
```

## 3. Publish

The tester runs your **draft**; phone and chat run the last **published** version. Publish to
freeze a version your channels can serve.

```bash theme={null}
curl -X POST https://builder.flowyte.com/api/v1/agents/$AGENT_ID/publish \
  -H "Authorization: Bearer $FLOWYTE_API_KEY"
```

<Warning>
  If you connect a channel before publishing, you'll get `409 no_published_version`. Publish first.
</Warning>

## 4. Test it

Simulate a conversation. This streams over Server-Sent Events — read it with `fetch()`
streaming and stop on the `event: done` frame.

```bash theme={null}
curl -N -X POST https://builder.flowyte.com/api/v1/agents/$AGENT_ID/simulate \
  -H "Authorization: Bearer $FLOWYTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "message": "Do you offer same-day appointments?", "draftMode": false }'
```

## 5. Go live

Put the agent on an embeddable chat widget by minting a publishable key (browser-safe,
origin-allowlisted), or assign it a phone number from the Numbers API.

```bash theme={null}
curl -X POST https://builder.flowyte.com/api/v1/agents/$AGENT_ID/publishable-keys \
  -H "Authorization: Bearer $FLOWYTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Website", "allowedOrigins": ["https://acme.com"] }'
```

Drop the returned loader snippet on your site and the agent is live.

<Card title="Next: explore the concepts" icon="book-open" href="/concepts/agents">
  Learn how agents, skills, knowledge, guardrails, and playbooks fit together.
</Card>
