Skip to content

Connect API guide

The Connect API lets the users of your app file requests to the team that supports it, and follow the conversation — all inside your app. Your supplier sets it up in TaskTraQ; you write the client once.

Concepts

TermMeaning
AppYour product as the supplier sees it. It decides which request types are offered (bug, change, feature, question) and which areas a request can be about.
ConnectionOne key for one running copy of your app. It carries a site name and is pinned to one customer organization — or, for a single backend serving every customer, marked as multi-organization.
ContactOne of your users, described by you: a stable externalId, a name, optionally an e-mail and a language. Not an account; contacts never count against a plan.
RequestA ticket created through a connection. It goes through the supplier's normal service desk: SLA, routing, notifications.

Two shapes of app

Installed at each customer (on-premises software, a desktop app with a server part). The supplier creates one connection per installed site, pinned to that customer. A customer with three plants is one organization with three connections. If a key leaks, it exposes one customer's requests and nothing else, and it can be revoked alone.

One backend for everyone (a SaaS product). The supplier creates one multi-organization connection; you keep its key on your own server and name the customer on each call with organizationRef, your own reference for that customer. The supplier maps references to organizations, or allows unknown ones to be created automatically.

Quick start

1. Ask the supplier for a connection key. 2. Read what the connection offers:

curl -s https://my.tasktraq.app/api/v1/connect/meta \
  -H "Authorization: Bearer $TTQC_KEY"

3. File a request. The type must be one that meta.requestTypes lists; area one of meta.areas.

curl -s -X POST https://my.tasktraq.app/api/v1/connect/requests \
  -H "Authorization: Bearer $TTQC_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: req-8f14e45f" \
  -d '{
    "type": "bug",
    "title": "Shift report shows wrong totals",
    "description": "Open **Reports > Shift**, pick yesterday.",
    "priority": "HIGH",
    "area": "reports",
    "contact": { "externalId": "u-17", "name": "Ayşe Yılmaz", "email": "[email protected]", "language": "tr" },
    "context": { "appVersion": "4.18.2", "surface": "web", "page": "/reports/shift", "locale": "tr-TR" },
    "externalRef": "SR-1042"
  }'

The answer is the request as staff filed it: keep its key (KORTEX-412) next to your own record.

HTTP/1.1 201 Created
{
  "success": true,
  "data": {
    "key": "KORTEX-412",
    "number": 412,
    "type": "bug",
    "typeName": "Bug",
    "title": "Shift report shows wrong totals",
    "priority": "HIGH",
    "area": "reports",
    "status": { "name": "Open", "category": "OPEN" },
    "contact": { "externalId": "u-17", "name": "Ayşe Yılmaz", "email": "[email protected]", "language": "tr" },
    "site": { "name": "Istanbul plant", "externalRef": "ist-1" },
    "organization": { "name": "Rosti" },
    "externalRef": "SR-1042",
    "customFields": {},
    "releasedIn": null,
    "rating": null,
    "createdAt": "2026-11-30T09:12:44.120Z",
    "updatedAt": "2026-11-30T09:12:44.120Z",
    "resolvedAt": null,
    "closedAt": null,
    "description": "Open **Reports > Shift**, pick yesterday.",
    "comments": [],
    "attachments": []
  }
}

A small Node client

Node 18 or newer, no dependencies. It retries after a 429, reuses the idempotency key, and reads the feed from a stored cursor.

// client.mjs — Node 18+ (built-in fetch). Keep the key on your server.
import crypto from 'node:crypto';

const BASE = 'https://my.tasktraq.app/api/v1/connect';
const KEY = process.env.TTQC_KEY;

async function call(method, path, body, idempotencyKey) {
  const headers = { Authorization: `Bearer ${KEY}` };
  if (body) headers['Content-Type'] = 'application/json';
  if (idempotencyKey) headers['Idempotency-Key'] = idempotencyKey;
  for (;;) {
    const res = await fetch(BASE + path, { method, headers, body: body && JSON.stringify(body) });
    if (res.status === 429) {
      await new Promise((r) => setTimeout(r, Number(res.headers.get('retry-after') || 1) * 1000));
      continue;
    }
    const json = await res.json();
    if (!json.success) throw Object.assign(new Error(json.error), { status: res.status, details: json.details });
    return json.data;
  }
}

// 1. File a request. Store the Idempotency-Key with your outbox row and
//    reuse it on every retry: a repeat never creates a second request.
const request = await call('POST', '/requests', {
  type: 'bug',
  title: 'Shift report shows wrong totals',
  contact: { externalId: 'u-17', name: 'Ayşe Yılmaz' },
  context: { appVersion: '4.18.2', page: '/reports/shift' }
}, crypto.randomUUID());
console.log(request.key, request.status.category);

// 2. Read the feed from where you stopped; persist `next` after processing.
let cursor = 0;
const page = await call('GET', `/events?after=${cursor}`);
for (const event of page.events) {
  if (event.type === 'request.commented' && event.data.comment.author.type === 'staff') {
    // notify event.request.contact.externalId in your app
  }
}
cursor = page.next;

Following a request

  • GET /connect/requests?contact=u-17 lists one person's requests, newest activity first. status and updatedAfter narrow it.
  • GET /connect/requests/{key} returns the request with its public conversation and files. Internal notes of the supplier's staff never appear.
  • status.category is one of OPEN, IN_PROGRESS, WAITING_CUSTOMER, RESOLVED, CLOSED; status.name is the supplier's own label, in their language.
  • When a release ships the request, releasedIn carries the release name.

Reply as the user, attach a file, and rate the result once it is resolved:

curl -s -X POST https://my.tasktraq.app/api/v1/connect/requests/KORTEX-412/comments \
  -H "Authorization: Bearer $TTQC_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reply-2c7a" \
  -d '{ "body": "Screenshot attached.", "contact": { "externalId": "u-17", "name": "Ayşe Yılmaz" } }'
curl -s -X POST https://my.tasktraq.app/api/v1/connect/requests/KORTEX-412/attachments \
  -H "Authorization: Bearer $TTQC_KEY" \
  -F "[email protected]" \
  -F 'contact={"externalId":"u-17","name":"Ayşe Yılmaz"}'

Who sees what

  • A key only ever sees requests of its own app. A pinned key only sees its own organization; asking for anything else answers 404 REQUEST_NOT_FOUND.
  • With visibility Each person's own (OWN), listing needs contact: your app shows each user their own requests.
  • With visibility Whole organization (ORGANIZATION), you may also list every request of the organization, e.g. for your app's administrators. Each item names its site.
  • context is for the supplier's staff only. It is never returned to your app.
  • If a contact's e-mail matches a customer member of the same organization in TaskTraQ, the request also appears in that member's customer portal. A contact can never act as the supplier's staff.

Events: the feed or webhooks

Five events tell you what happened to a request: request.created, request.status_changed, request.commented (public comments only, your user's own replies included — check author.type), request.resolved and request.released.

An app installed behind a customer's firewall cannot receive webhooks. It polls the feed instead: every few minutes, and when a user opens the requests screen. Store next after you have processed a page and pass it as after next time. Events are kept 90 days.

Each page answers {events, next, hasMore}: while hasMore is true, call again at once with next. An event is written just after the change that caused it, so right after your own call it may take a second or two to appear; the cursor picks it up on the next poll. Identify requests by number or by the key as returned — do not parse the key, its prefix may contain hyphens.

curl -s "https://my.tasktraq.app/api/v1/connect/events?after=0&limit=100" \
  -H "Authorization: Bearer $TTQC_KEY"
{
  "seq": 2,
  "id": "evt_5f0c2d9a1b7e4c3a8d6f0e12",
  "type": "request.commented",
  "occurredAt": "2026-11-30T10:03:05.411Z",
  "request": {
    "key": "KORTEX-412", "number": 412, "type": "bug",
    "title": "Shift report shows wrong totals", "externalRef": "SR-1042",
    "status": { "name": "In Progress", "category": "IN_PROGRESS" },
    "contact": { "externalId": "u-17", "name": "Ayşe Yılmaz", "email": "[email protected]", "language": "tr" },
    "site": { "name": "Istanbul plant", "externalRef": "ist-1" }
  },
  "data": {
    "comment": {
      "id": "cmx3…", "body": "Can you send a screenshot?",
      "author": { "type": "staff", "name": "Mert Kaya" },
      "createdAt": "2026-11-30T10:03:05.402Z"
    }
  }
}

A backend that can be reached from the internet can ask the supplier for a webhook instead; the payload is the same object. See Webhooks.

Retries and idempotency

Networks fail. Give every write an Idempotency-Key (any unique string) and store it with your pending row. If you send the same call again with the same key, you get the first answer back with the header Idempotent-Replayed: true, and nothing is created twice. The same key with a different body is 409 IDEMPOTENCY_CONFLICT. Keys are remembered for 48 hours.

externalRef goes further: it is unique per connection and never expires. A create with an externalRef this connection already used answers 200 with that request instead of creating another. Send your own record id there and a create can be retried at any time.

  • Retry on network errors, 429 (after Retry-After) and 5xx.
  • Do not retry other 4xx answers unchanged: fix the request, or show the error to the user.

Errors

A refused call names the problem in error, and often the field in details:

HTTP/1.1 400 Bad Request
{ "success": false, "error": "FIELD_REQUIRED", "details": { "field": "contact.name" } }

The full list is in the error catalogue. Codes are stable within v1; new ones may be added.