NUACOM API

Calls

After Call Work

After Call Work rules make tagging and note-taking mandatory in the NUACOM softphone. A rule matches calls by inbound number or by queue and sets what the agent must enter once the call ends: a minimum number of tags, a minimum number of words in the note, and a countdown timer that bounds how long the softphone waits for them. This group holds the rule list, the save (an upsert of the whole set), the delete, and the lookup phones use to find the rules for one call. The tags come from the Call Tags catalogue, and the entries themselves are written with the Call Notes and Call Tags endpoints.

Workflow (what the portal does)

  1. List: GET /v2/after-call-work answers the account's rules, newest first, each with id, account_id, direction (inbound, outbound or both), number (a list of numbers, or null), queue_id (a list of queue ids, or null), tags (the minimum number of tags), notes (the minimum number of words in the note) and timer (seconds).
  2. Save: PUT /v2/after-call-work/upsert takes a JSON array of rules and inserts or updates each one by id; the portal sends every rule of its page on each save. A rule has id (0 for a new rule), direction, either number (a list) or queue_id (a list), tags, notes and timer (at most 180 seconds). Send every key, with null or [] for the ones that do not apply. tags and notes are required when timer is 0, and timer is required when tags or notes is 0. A queue rule is stored as inbound whatever direction says. An id that is not 0 and not one of the account's rules fails the whole save with 422 and an error on <index>.id. Answers 204; connected softphones are told to reload their rules.
  3. Delete: DELETE /v2/after-call-work/{id} removes one rule and notifies the softphones. 204, or 404 when the id is not one of the account's.
  4. Lookup for one call: GET /v2/after-call-work/settings with direction (inbound or outbound) and either number or queue_id answers the rules that apply to such a call, as [{"id", "tags", "notes", "timer"}]: rules with that direction or both whose number list contains the number, or whose queue_id list contains the queue id. An empty array means nothing is mandatory. The number you send is normalised to 00 + country code + national number before matching (+353 91 234 5678 becomes 00353912345678), so store numbers in that form.
# One new rule for a number (both directions) and one updated queue rule
curl -X PUT https://api.api-nuacom.com/v2/after-call-work/upsert \
  -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' \
  -d '[
    {"id": 0,  "direction": "both",    "number": ["00353912345678"], "queue_id": [],     "tags": 1, "notes": 10, "timer": 60},
    {"id": 17, "direction": "inbound", "number": [],                 "queue_id": ["10"], "tags": 2, "notes": 0,  "timer": 120}
  ]'
# → 204

# What a phone must ask for after an inbound call from queue 10
curl 'https://api.api-nuacom.com/v2/after-call-work/settings?direction=inbound&queue_id=10' \
  -H 'Authorization: Bearer YOUR_API_KEY'
# → [{"id":17,"tags":2,"notes":0,"timer":120}]

When a tag or note is enforced

flowchart TD
    callEnds["Call ends on a matching number/queue and direction"] --> lookup["GET /v2/after-call-work/settings<br/>direction + number or queue_id"]
    lookup --> rules{"Matching rule(s)?"}
    rules -- "none (empty array)" --> nothing["Nothing mandatory"]
    rules -- "yes" --> prompt["Softphone requires at least `tags` tags<br/>and a note of `notes` words"]
    prompt --> timer["Countdown timer (at most 180s) bounds the wait"]
    timer -- "submitted before timer ends" --> submitted["Tag/note written via Call Tags / Call Notes endpoints"]
    timer -- "timer runs out" --> expired["Softphone stops waiting"]

Roles and access

  • Every endpoint in this group is open to any authenticated user of the account; none requires an account admin.

Pitfalls

  • The save is an upsert keyed on id: a rule you leave out of the array is kept, not deleted (use the delete endpoint), and id: 0 always creates. Any other id must be one of the account's existing rules.
  • Send every key of every rule (direction, number, queue_id, tags, notes, timer); a rule with a missing key makes the save fail.
  • Numbers and queue ids are stored as sent and are not checked against the account's numbers and queues. Store numbers as 00 + country code + national number and queue ids as strings (["10"]): the lookup matches them in exactly that form.
  • timer is capped at 180 seconds (422 above it); tags and notes have no upper bound.
  • The softphone notification is best-effort: when it fails, the request still answers 204 and the rules are saved; phones apply them once they next reload their rules.
  • GET /v2/after-call-work/settings needs direction and one of number / queue_id (422 otherwise). Sending both narrows the answer to rules that name both, which is rarely what you want.