CDCapraDeskAPI Reference

CapraDesk Integration Guide

CapraDesk provides a REST API for creating and managing support tickets from your own application. All requests require an API key generated from your CapraDesk settings.

Authentication

All API requests must include your API key in the Authorization header. Generate keys at Settings → API Keys in your CapraDesk dashboard.

Authorization: Bearer cd_live_your_api_key_here

Keys are scoped to your organisation, and may optionally be limited to one customer. Keep them secret — they allow ticket creation on your behalf.

Base URL

https://www.capradesk.com/api/v1

Tickets

POST/api/v1/ticketsCreate a ticket

Creates a new support ticket. Triggers AI triage automatically.

If source_ticket_id already exists for your organisation, CapraDesk returns the existing ticket instead of creating a duplicate.

Request body

{
  "title":          "Can't export my CV as PDF",       // required
  "description":    "Name: Jane\nEmail: jane@example.com\n\nI click Export but nothing happens.",
  "customer_email": "jane@example.com",                // used for reply emails
  "source_ticket_id": "your-internal-ticket-id",       // optional — enables reply sync
  "priority":       "medium",                           // critical | high | medium | low
  "triage_state":   "ai_handling"                       // optional — routes to AI lane
}

Response 201

{
  "ok": true,
  "ticket": {
    "id":            "uuid",
    "ticket_number": 42,
    "title":         "Can't export my CV as PDF",
    "status":        "open",
    "priority":      "medium",
    "sla_due_at":    "2026-06-09T10:00:00Z",
    "created_at":    "2026-06-08T10:00:00Z"
  }
}
GET/api/v1/ticketsList tickets

Returns the 100 most recent tickets for your organisation, including source ticket references for external sync.

Response 200

{ "ok": true, "tickets": [ ...ticket objects ] }
GET/api/v1/tickets/:idGet a ticket

Returns a single ticket by its UUID.

PATCH/api/v1/tickets/:idUpdate ticket status
{ "status": "resolved" }  // open | in_progress | pending | resolved | closed

Comments

POST/api/v1/tickets/:id/commentsAdd a customer comment

Adds a customer message to an existing ticket. Re-triggers AI triage if the ticket is still in an AI-handled state.

{ "body": "Actually I figured it out — thank you!" }

JS Widget

Drop a floating support button onto any page with a single script tag. No dependencies.

<script src="https://www.capradesk.com/api/widget?key=cd_live_your_key_here"></script>

Options

ParameterDefaultDescription
keyRequired. Your API key.
labelSupportButton label text.
color#18181bButton and accent colour (hex).

Reply sync (webhook)

When an agent replies in CapraDesk and the ticket has a source_ticket_id, CapraDesk will POST the reply to your server so you can display it in your own UI.

// CapraDesk sends:
POST https://your-app.com/your-webhook-path
x-webhook-secret: your_secret

{
  "ticketId": "your-internal-ticket-id",
  "message":  "Hi Jane, try using Chrome instead of Safari for PDF export.",
  "is_ai":    false
}

Configure the destination URL, secret, and events per customer in Settings → Webhooks. Webhooks fire for tickets that originate from your system (they carry a source_ticket_id) and require a Team or Pro plan.

Testing with a sandbox key

Create a Test (sandbox) key in Settings → API Keys. Sandbox keys start with cd_test_ and exercise your real config (AI triage, portal, webhooks) but only ever touch sandbox tickets — no plan quota, no emails to real customers.

curl -X POST https://www.capradesk.com/api/v1/tickets \
  -H "Authorization: Bearer cd_test_..." \
  -H "Content-Type: application/json" \
  -d '{"title":"Sandbox test","description":"Hello","customer_email":"you@example.com"}'

Customer portal

Reply emails can include a signed portal URL that lets your customer view the thread and reply without logging in:

https://www.capradesk.com/portal/{ticket_uuid}?token={signed_token}

CapraDesk includes this link in reply emails automatically. Portal links expire after 90 days; each new reply email carries a fresh one.