Quick start
By the end of this page you’ll have listed your products, added a customer and opened a ticket for them, all from your terminal.
-
Make an API key.
In the Supportaka dashboard, open Developers → API keys → Create API key. Give it a name (for example Quick start) and the scopes
products:read,customers:writeandtickets:write.Copy the key when it’s shown: it starts with
spk_and is shown only once. If you lose it, rotate the key to get a new one. -
Find your organization ID.
It’s on the same Developers page, under Your IDs. Save both values:
Terminal window export SUPPORTAKA_KEY="spk_…"export SUPPORTAKA_ORG="your-organization-id" -
List your products.
Customers and tickets belong to a product, so first get its
id:Terminal window curl https://api.supportaka.com/api/v1/organizations/$SUPPORTAKA_ORG/products \-H "Authorization: Bearer $SUPPORTAKA_KEY"const api = 'https://api.supportaka.com/api/v1';const headers = { Authorization: `Bearer ${process.env.SUPPORTAKA_KEY}` };const res = await fetch(`${api}/organizations/${process.env.SUPPORTAKA_ORG}/products`, { headers });const { products } = await res.json();console.log(products.map((p) => `${p.id} ${p.name}`).join('\n'));import os, requestsapi = "https://api.supportaka.com/api/v1"headers = {"Authorization": f"Bearer {os.environ['SUPPORTAKA_KEY']}"}res = requests.get(f"{api}/organizations/{os.environ['SUPPORTAKA_ORG']}/products", headers=headers)res.raise_for_status()for p in res.json()["products"]:print(p["id"], p["name"]){"products": [{ "id": "01a211b0-054c-7c56-a7ad-0fac8a3d108f", "public_id": "prod_8Jq2…", "name": "Andy Store", "status": "active" }]}Save the product’s
id(the UUID, not theprod_…public ID):Terminal window export SUPPORTAKA_PRODUCT="01a211b0-054c-7c56-a7ad-0fac8a3d108f" -
Add a customer.
Terminal window curl https://api.supportaka.com/api/v1/organizations/$SUPPORTAKA_ORG/products/$SUPPORTAKA_PRODUCT/customers \-H "Authorization: Bearer $SUPPORTAKA_KEY" \-H "Content-Type: application/json" \-d '{ "name": "Ada Obi", "email": "ada@example.com" }'const product = `${api}/organizations/${process.env.SUPPORTAKA_ORG}/products/${process.env.SUPPORTAKA_PRODUCT}`;const customer = await fetch(`${product}/customers`, {method: 'POST',headers: { ...headers, 'Content-Type': 'application/json' },body: JSON.stringify({ name: 'Ada Obi', email: 'ada@example.com' }),}).then((r) => r.json());console.log(customer.id);product = f"{api}/organizations/{os.environ['SUPPORTAKA_ORG']}/products/{os.environ['SUPPORTAKA_PRODUCT']}"customer = requests.post(f"{product}/customers", headers=headers,json={"name": "Ada Obi", "email": "ada@example.com"}).json()print(customer["id"])The answer is the new customer, with its
id. -
Open a ticket for them.
The
Idempotency-Keyheader makes the request safe to retry: send it again with the same key and you get the same ticket back, not a second one.Terminal window curl https://api.supportaka.com/api/v1/organizations/$SUPPORTAKA_ORG/products/$SUPPORTAKA_PRODUCT/tickets \-H "Authorization: Bearer $SUPPORTAKA_KEY" \-H "Content-Type: application/json" \-H "Idempotency-Key: order-1042-refund" \-d '{"customer_id": "CUSTOMER_ID","subject": "Refund for order #1042","description": "The customer asked for a refund in the app.","priority": "high","tags": ["refund"]}'const ticket = await fetch(`${product}/tickets`, {method: 'POST',headers: { ...headers, 'Content-Type': 'application/json', 'Idempotency-Key': 'order-1042-refund' },body: JSON.stringify({customer_id: customer.id,subject: 'Refund for order #1042',description: 'The customer asked for a refund in the app.',priority: 'high',tags: ['refund'],}),}).then((r) => r.json());console.log(`Ticket #${ticket.number} is ${ticket.status}`);ticket = requests.post(f"{product}/tickets", headers={**headers, "Idempotency-Key": "order-1042-refund"}, json={"customer_id": customer["id"],"subject": "Refund for order #1042","description": "The customer asked for a refund in the app.","priority": "high","tags": ["refund"],}).json()print(f"Ticket #{ticket['number']} is {ticket['status']}")The ticket appears in the dashboard straight away, ready for your team.
Next steps
Section titled “Next steps”- Authentication and scopes: what each scope allows, product keys, rotating keys.
- Webhooks: get told when the customer replies, instead of polling.
- API reference: every endpoint, with a Try it button.