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)
- List:
GET /v2/after-call-workanswers the account's rules, newest first, each withid,account_id,direction(inbound,outboundorboth),number(a list of numbers, ornull),queue_id(a list of queue ids, ornull),tags(the minimum number of tags),notes(the minimum number of words in the note) andtimer(seconds). - Save:
PUT /v2/after-call-work/upserttakes a JSON array of rules and inserts or updates each one byid; the portal sends every rule of its page on each save. A rule hasid(0for a new rule),direction, eithernumber(a list) orqueue_id(a list),tags,notesandtimer(at most180seconds). Send every key, withnullor[]for the ones that do not apply.tagsandnotesare required whentimeris0, andtimeris required whentagsornotesis0. A queue rule is stored asinboundwhateverdirectionsays. Anidthat is not0and not one of the account's rules fails the whole save with422and an error on<index>.id. Answers204; connected softphones are told to reload their rules. - Delete:
DELETE /v2/after-call-work/{id}removes one rule and notifies the softphones.204, or404when the id is not one of the account's. - Lookup for one call:
GET /v2/after-call-work/settingswithdirection(inboundoroutbound) and eithernumberorqueue_idanswers the rules that apply to such a call, as[{"id", "tags", "notes", "timer"}]: rules with thatdirectionorbothwhosenumberlist contains the number, or whosequeue_idlist contains the queue id. An empty array means nothing is mandatory. The number you send is normalised to00+ country code + national number before matching (+353 91 234 5678becomes00353912345678), 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), andid: 0always 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. timeris capped at180seconds (422above it);tagsandnoteshave no upper bound.- The softphone notification is best-effort: when it fails, the request still answers
204and the rules are saved; phones apply them once they next reload their rules. GET /v2/after-call-work/settingsneedsdirectionand one ofnumber/queue_id(422otherwise). Sending both narrows the answer to rules that name both, which is rarely what you want.