Skip to main content

Build Your First Agent: Support Email Classifier

A complete walkthrough, from sign-up to a live HTTPS endpoint you can call from any backend. Plan for 10–15 minutes.

By the end you will have:

  • A PrompTick account, a project, and a saved prompt
  • A small test set that proves the prompt behaves on real inputs
  • A deployed agent pinned to a specific prompt version
  • An API key and working cURL calls that classify incoming support emails

The example we build is a support email classifier that takes the raw body of a customer email and returns one of billing, technical, feedback, or other, plus a one-sentence summary.


1. Create your account​

PrompTick uses email one-time codes — there is no password to manage.

  1. Go to promptick.ai and click Sign up.
  2. Enter your work email. You will receive a 6-digit code.
  3. Paste the code to finish signing in. Your session is created.

Sign-in is email-only; there is no password to recover. If you need to sign in from another device, request a fresh code there.

2. Create a project​

Projects group related prompts and agents together.

  1. From the dashboard, open Projects and click New Project.
  2. Name it Support Triage and click Create.

3. Generate the prompt​

Open Playground (or the Generate Prompt action inside your project).

In the brief field, describe the task in natural language. For this tutorial, paste:

Classify an inbound customer support email into one of four categories — billing, technical, feedback, other — and write a one-sentence summary of what the customer is asking for. Respond with strict JSON: { "category": "...", "summary": "..." }.

Click Generate. PrompTick runs a two-agent workflow (analysis, then generation) and streams the result back. You get:

  • A system prompt that sets the classifier role and output contract
  • A user prompt template with a variable such as {{email_body}}
  • A list of suggested variables with sample values

Review the output. If something is off, click Improve Prompt and describe what to change — this runs a three-agent improvement workflow against the current draft.

When you are happy, click Save to Library, pick the Support Triage project, and give the prompt a name like support-email-classifier. This creates version 1.

4. Test the prompt​

Bulk testing is gated behind the Testing Framework feature, available on Pro and above. If you are on the Free tier you can still run single executions from the Playground — skip to step 5 and come back later.

  1. Open the prompt in your project and switch to the Tests tab.
  2. Create a new Test Set with 3–5 rows. For each row, provide a value for email_body and the category you expect. For example:
    • "My invoice says $99 but my plan is $49. Please check." → billing
    • "The dashboard is stuck on the loading spinner in Safari." → technical
    • "Love the new export feature — can you add CSV too?" → feedback
  3. Click Run Tests. PrompTick queues a bulk evaluation and streams results back as each row completes: pass/fail per row, latency, and token usage.
  4. Iterate on the prompt until the test set passes. Each improvement saves as a new version.

See Features → Testing for grading modes and larger suites.

5. Deploy as an agent​

An agent wraps a specific prompt version behind a stable ID and API surface.

  1. Open the prompt and click Deploy as Agent, or go to Agents → New Agent.
  2. Name it support-email-classifier.
  3. Pin the version you tested. The agent will keep using that version until you deliberately promote a new one — new prompt edits do not auto-deploy.
  4. Enable API access.
  5. Save. You now have an agentId shown on the agent page.

See Agents → Version Management for the pinning model.

6. Create an API key​

API keys are created from the UI, by the agent's creator only. They are hashed at rest — you see the plaintext once.

  1. On the agent page, open API Keys → Create New API Key.
  2. Give it a name (e.g. helpdesk-webhook-prod), optionally set rate limits, and create.
  3. Copy the key — it starts with pk_live_. Store it in your secret manager. If you lose it, revoke and create a new one.

See Agents → API Keys for rotation and scopes.

7. Call the agent​

Agent executions are asynchronous: you submit a request, get an executionId, and poll until it finishes.

Submit an execution​

curl -X POST "https://promptick.ai/api/v1/agents/YOUR_AGENT_ID/execute" \
-H "Authorization: Bearer pk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"variables": {
"email_body": "Hi team, my invoice says $99 but I thought I was on the $49 plan. Can you check?"
}
}'

You get back 202 Accepted:

{
"success": true,
"executionId": "b6f1c0e2-4a11-4f7a-9e0d-...",
"agentId": "YOUR_AGENT_ID",
"agentName": "support-email-classifier",
"status": "processing",
"message": "Agent execution started",
"statusUrl": "/api/v1/agents/YOUR_AGENT_ID/executions/b6f1c0e2-..."
}

Poll for the result​

curl "https://promptick.ai/api/v1/agents/YOUR_AGENT_ID/executions/EXECUTION_ID" \
-H "Authorization: Bearer pk_live_YOUR_KEY"

While running:

{
"executionId": "b6f1c0e2-...",
"agentId": "YOUR_AGENT_ID",
"status": "processing",
"percentage": 60,
"currentStep": "Running model"
}

When complete:

{
"executionId": "b6f1c0e2-...",
"agentId": "YOUR_AGENT_ID",
"status": "completed",
"percentage": 100,
"currentStep": "Done",
"output": "{\"category\":\"billing\",\"summary\":\"Customer was charged $99 but expected $49 and wants the invoice reviewed.\"}",
"tokensUsed": 412,
"costUSD": 0.00021,
"latencyMs": 1840,
"executedAt": "2026-04-16T09:12:04.221Z"
}

A simple poll loop (every 1–2 seconds, with a timeout) is enough for most production integrations. For long-running agentic workflows, widen the interval.

8. What to do next​

  • Wire it into your helpdesk — on every inbound ticket, call /execute, poll until complete, write output.category to the ticket.
  • Promote new versions deliberately — edit the prompt, re-test, then repoint the agent. Old versions keep working for in-flight executions.
  • Monitor usage — see Agents → Execution History for per-agent logs, tokens, and latency.
  • Give your team access — if multiple people will manage agents, create an Organization.