Quick start
Five minutes from nothing to a working call. You need an API key from the account's owner and a terminal. If you want an AI app such as Claude or ChatGPT instead of your own code, go to Connect an app; it needs no key.
1. Get a key
The account owner makes it in NexaTrack: Settings, then AI apps and integrations, then API keys, Create a key. They choose:
- Name, so everyone can tell what uses it.
- It may: Read only, or Read and make changes.
- Businesses (when the account has more than one): all of them or some.
- Expires: never, in 90 days, or in a year.
The key starts with nt_live_ and is shown once. Keep it where you keep passwords. A key acts as the owner who
made it, inside the Businesses it was given. If the panel says AI apps are not available on this account yet, the
account has not had them switched on.
export NEXATRACK_KEY="nt_live_..." # the key the owner gave you
2. Read something
Every operation is a POST with a JSON body. This lists the open Jobs:
curl https://nexatrack.cc/api/v1/list_jobs \
-H "Authorization: Bearer $NEXATRACK_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "open", "limit": 10}'
A success is always {"data": ...}:
{
"data": [
{
"id": "be2db646-db24-409e-a17c-e829af77d865",
"name": "Maple Street Kitchen",
"address": "412 Maple St",
"status": "open",
"entity_id": "c53f7b58-b210-42f1-a2a4-d6a4b6a49da9",
"job_type": null,
"groups": [],
"projected_start": null,
"projected_completion": null,
"actual_start": null,
"actual_completion": null
}
]
}
entity_id is the Business the Job belongs to. Keep the Job's id: most operations take a
job_id.
3. Make a change, safely
A write needs a key that may make changes. Send your own Idempotency-Key with it: if the network drops and
you send the same call again with the same key, NexaTrack returns the first answer and makes nothing twice.
curl https://nexatrack.cc/api/v1/create_task \
-H "Authorization: Bearer $NEXATRACK_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: countertop-task-2030-02-08" \
-d '{"job_id": "'"$JOB_ID"'", "title": "Confirm countertop template date", "due_date": "2030-02-08"}'
{
"data": {
"task": {
"id": "1f76f594-d77a-4a82-80cd-703dbd7477bd",
"job_id": "be2db646-db24-409e-a17c-e829af77d865",
"title": "Confirm countertop template date",
"description": null,
"assignee_user_id": null,
"assignee_sub_id": null,
"due_date": "2030-02-08",
"status": "open",
"tags": []
}
}
}
The Task appears in NexaTrack at once, marked as made by your key, and the owner sees the call under AI activity.
4. Something that tells a sub or a homeowner
Some operations reach people outside the company: publishing a schedule tells the subs on it, replying to a Customer Request emails the homeowner. Those never happen straight from the API. You get a preview, and a person approves the real thing in NexaTrack.
Ask first with commit: false, which changes nothing and shows who would be told:
curl https://nexatrack.cc/api/v1/publish_schedule \
-H "Authorization: Bearer $NEXATRACK_KEY" \
-H "Content-Type: application/json" \
-d '{"job_id": "'"$JOB_ID"'", "commit": false}'
Then commit: true. The answer is still a 200, but nothing has been done yet:
{
"data": {
"status": "waiting_for_approval",
"pending_action_id": "be3a6b41-992c-4e61-b57e-d8896cf87ca0",
"preview": {
"summary": "Put the schedule for Maple Street Kitchen online, and tell its assignees and subs.",
"operation": "publish_schedule",
"recipients": [{ "name": "North Framing", "email": "framer@example.com" }]
},
"note": "Nothing has been done or sent yet. The person this app acts for, or an owner, approves it in NexaTrack under Waiting for your approval. Tell them so. Read its state later with get_pending_action."
}
}
Shortened: the full answer also repeats the preview's effect. See publish_schedule.
The owner (or the person the key acts for) gets a notice, and approves or declines it in NexaTrack under Waiting for your approval. Check the outcome:
curl https://nexatrack.cc/api/v1/get_pending_action \
-H "Authorization: Bearer $NEXATRACK_KEY" \
-H "Content-Type: application/json" \
-d '{"pending_action_id": "'"$PENDING_ID"'"}'
Its status is waiting until someone decides. Approved, it is approved while it
runs and then done (with the result), or failed with a status_reason
when the action itself was refused, for example a status change the Job no longer allows. Otherwise it ends
declined, or expired 24 hours after it was asked. Calling the operation again does not approve it.
The same in code
Any language that can send HTTPS works. Python, with nothing to install:
import json, os, urllib.request
API = "https://nexatrack.cc/api/v1"
KEY = os.environ["NEXATRACK_KEY"]
def call(operation, body=None, idempotency_key=None):
headers = {"Authorization": f"Bearer {KEY}", "Content-Type": "application/json",
"User-Agent": "my-company-sync/1.0"} # name your app (optional, helps support)
if idempotency_key:
headers["Idempotency-Key"] = idempotency_key
req = urllib.request.Request(f"{API}/{operation}", data=json.dumps(body or {}).encode(), headers=headers, method="POST")
try:
with urllib.request.urlopen(req) as r:
return json.load(r)["data"]
except urllib.error.HTTPError as e:
err = json.load(e)["error"]
raise RuntimeError(f"{e.code} {err['code']}: {err['message']}") from None
jobs = call("list_jobs", {"status": "open"})
for job in jobs:
print(job["name"], job["id"])
Send a User-Agent that names your app. It is not required, but it lets us find your
requests quickly if you ask us for help.
JavaScript (Node 18 or later, or a browser's fetch on your own server; never put a key in a web page):
const API = 'https://nexatrack.cc/api/v1';
async function call(operation, body = {}, idempotencyKey) {
const res = await fetch(`${API}/${operation}`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.NEXATRACK_KEY}`,
'Content-Type': 'application/json',
...(idempotencyKey ? { 'Idempotency-Key': idempotencyKey } : {}),
},
body: JSON.stringify(body),
});
const json = await res.json();
if (!res.ok) throw new Error(`${res.status} ${json.error.code}: ${json.error.message}`);
return json.data;
}
const jobs = await call('list_jobs', { status: 'open' });
for (const job of jobs) console.log(job.name, job.id);
Next
- Concepts: Businesses, who a key acts for, dates and time zones, and approval.
- Reference: every operation with a real request and response.
- Webhooks: have NexaTrack tell you when something happens, instead of asking.
- Errors and limits: what each refusal means and how fast you may call.