---
docId: doc_70e866c1e8e643e08e2e73811ee7de8c
title: Create your first agent
description: "Create an agent, adjust its instructions and publish the version that will answer your customers."
---

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

# Create your first agent

<span id="what-youll-build"></span>

Create an agent with instructions for answering your customers. Save changes in a draft and publish them when they are ready.

## Before you start

Use [your assistant connected to Platica](/mcp) or an [API key](/authentication) stored in `PLATIC_API_KEY`.

In the platform: [Create an agent with the creator](/help/agents/creator).

<Steps>
<Steps.Step>

**Create the agent**

Set the agent's name and instructions. [Create an agent](/api-reference/agents/create).

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

```bash
curl https://api.platic.ai/v1/agents \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Sales",
    "instructions": "You are the sales assistant for Acme. Answer kindly and briefly."
  }'
```

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

```ts
import { Platic } from "platic-sdk";

const platic = new Platic({ apiKey: process.env.PLATIC_API_KEY! });

const agent = await platic.agents.create({
  name: "Sales",
  instructions: "You are the sales assistant for Acme. Answer kindly and briefly.",
});
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Create an agent called Sales. It is the sales assistant for Acme: it answers kindly and briefly.

</Ways.Say>

Tool: [`create_agent`](/mcp/tools#create_agent).

</Ways.Way>
</Ways>

Save the agent's `id` for the following calls. In cURL, assign it to `AGENT_ID`.

</Steps.Step>
<Steps.Step>

**Tune its instructions**

Edit the draft. The agent keeps using the published version while you prepare it. [Update the draft](/api-reference/agents/drafts/update).

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

```bash
curl -X PATCH https://api.platic.ai/v1/agents/$AGENT_ID/draft \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instructions": "You are the sales assistant for Acme. Answer in under 80 words. If you do not know a price, say so: never make it up."
  }'
```

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

```ts
await platic.agents.draft.update(agent.id, {
  instructions: "You are the sales assistant for Acme. Answer in under 80 words. If you do not know a price, say so: never make it up.",
});
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Change the Sales instructions: answer in under 80 words and never make up prices.

</Ways.Say>

Tool: [`update_agent_draft`](/mcp/tools#update_agent_draft).

</Ways.Way>
</Ways>

</Steps.Step>
<Steps.Step>

**Publish**

Publish the draft to use the new instructions from the next message. [Publish](/api-reference/agents/publications/publish).

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

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

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

```ts
await platic.agents.publish(agent.id);
```

</Ways.Way>
<Ways.Way name="asistente">
<Ways.Say>

Publish the Sales changes.

</Ways.Say>

Tool: [`publish_agent_version`](/mcp/tools#publish_agent_version).

</Ways.Way>
</Ways>

</Steps.Step>
</Steps>

## Check it worked

Call [Get the agent](/api-reference/agents/get). The publication is ready when `publication.versionId` is set and `hasUnpublishedChanges` is `false`. Channels for receiving customer messages are connected separately.

Each save creates a version. See [Versions and how to go back](/guides/versions) to restore an earlier one.

## Next steps

- [Connect an API](/guides/connect-an-api) so it can look up or act on your systems.
- [Give it files](/guides/add-knowledge) so it knows your business.
- [Test it before you publish](/guides/evals).
- [Talk to your agent](/guides/chat-api) from your application.
- [Put it on a channel](/guides/connect-a-channel) so it starts answering, or [add a chat to your site](/guides/web-chat).
- [Install a template](/api-reference/agent-templates) to start from a configured agent. Complete its pending items before using it.
