Launch chats

A chat is one conversation with a retailer's support team about one issue. In the API a chat is called a task.

Pick a template

The template decides what kind of chat runs. GET /api/templates lists them.

TemplateUse it forRequired details
bestbuyAn order problem: refund, replacement, store creditorderNumber, customerName, customerEmail, customerPhone, issue, resolution
bestbuypricematchGetting a price matchedThe customer fields above, plus competitorPrice, bestbuyPrice, and usually competitorUrl
bestbuycustomAnything else, described in your own wordsinstructions

Optional details that help the AI: trackingNumber, carrier, orderDate, itemDescription, paymentMethod, and customInstructions for extra guidance on this chat.

Launch one chat

curl https://api.refundhunter.io/api/tasks \
  -H "Authorization: Bearer $CHATTER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 4d7c1c6e-2f0a-4a4e-9a51-0e0c3b6a7d11" \
  -d '{
    "template": "bestbuycustom",
    "details": {
      "instructions": "Ask for a prepaid return label for order BBY01-806912345678. The box arrived crushed.",
      "customerName": "Jordan Lee",
      "customerEmail": "jordan@example.com",
      "customerPhone": "555-010-2030"
    }
  }'

The response gives you a taskId. The chat starts right away if you have a free slot; otherwise it is queued and starts on its own when a slot opens (the response then lists the id under queued).

Always send an Idempotency-Key

Launching spends credits, and networks fail. Send an Idempotency-Key header (any unique string, such as a UUID) with every launch. If the same key arrives again within 24 hours, you get the first response back and no second chat is started. The replayed response carries the header Idempotent-Replayed: true.

Run several attempts at once

agentCount (1 to 10) starts that many chats on the same issue. They share a batchId. When one succeeds, the others are cancelled automatically.

{ "template": "bestbuy", "details": { "...": "..." }, "agentCount": 3 }

Schedule for later

Pass scheduledAt as an ISO time with an offset. It must fall inside the retailer's chat hours.

{ "template": "bestbuy", "details": { "...": "..." }, "scheduledAt": "2026-12-01T09:30:00-06:00" }

Move it with PATCH /api/tasks/{id}/schedule, or cancel it with POST /api/tasks/{id}/cancel.

If you launch while the retailer's chat is closed, you get 423 with code chat_closed and a nextOpenAt time you can use as scheduledAt.

Drive the chat yourself

"mode": "manual" opens the chat without the AI. Nothing is sent unless you send it with POST /api/tasks/{id}/message.

Prepare now, launch later

Drafts are chats that are set up but not started.

  1. POST /api/drafts with up to 100 tasks (each has template and details).
  2. POST /api/drafts/deploy with the draft ids (and optionally scheduledAt).

Deploying more drafts than you have free slots is fine: the extras queue and start as slots free up.

Pass orderId when launching and the chat is recorded as an attempt on that order. Customer details you leave out are filled in from the order. See Orders and CSV upload.

Before the first launch

  • Proxies. Chats run through your proxies. Add them with POST /api/proxies. With no working proxies, launches return 424 (proxy_unhealthy).
  • Credits. Each chat uses credits. Check your balance with GET /api/billing/summary. At zero, launches return 402 (insufficient_credits).
  • Concurrency. Pro runs 25 chats at once, Scale runs 50. Extra launches queue.