JSON API (v1)
A small JSON API for the mobile app and other non-browser clients. It covers what someone needs on the go: sign in, the day's jobs and the time clock, the team's triaged mailbox (approve and send a drafted reply), customers, the document library, and analytics and plan usage. The phone app is built on it.
- Base URL:
http://demo.voyancy.com/api/v1 - Format: JSON request and response bodies (
Content-Type: application/json). Endpoints that take a body also accept form encoding, exceptPOST /jobs/{id}/checklist,POST /devices,DELETE /devicesandPUT /push, which take JSON only. - OpenAPI:
GET /api/v1/openapi.jsondescribes every endpoint (its parameters, request body and answers) for tools like Postman and Insomnia, and for generating a client. It needs no token. - Timestamps: ISO 8601 in UTC with a
Zsuffix, e.g.2026-09-30T14:05:09.512000Z. - Caching: every response is sent with
Cache-Control: no-store.
Authentication
Every endpoint except POST /auth/token and GET /openapi.json needs a Bearer token:
Authorization: Bearer sec_4mZ...
A token acts as its owner and sees exactly what they see in the web app, including the mailbox they share with their team. Tokens start with sec_, so a leaked token is recognizable in logs and to secret scanners. The server keeps only a SHA-256 digest of each token, so a lost token can't be recovered, only revoked and replaced.
There are two ways to get a token:
- Sign in from the app with
POST /auth/token(username or email address, and password). Tokens issued this way expire after 90 days; a deployment can change that withAPI_TOKEN_TTL_DAYS. - Create a personal token in the web app under Settings → API access. You pick the name and expiry (30 days, 90 days, 1 year, or never). Use this for scripts and integrations.
A token stops working when it expires, when it's revoked (from the app, the API, or Settings), or when its owner resets their password. Each account can have at most 20 active tokens. Issuing a 21st revokes the least recently used one, so signing in on device after device never locks an account out.
Demo accounts (the public demo_* logins) can't get tokens, because their passwords are public.
Errors
Errors use the HTTP status code plus a JSON body with a stable, machine-readable error code and a human-readable message:
{"error": "invalid_token", "message": "This token is invalid, expired, or revoked."}
| Status | error |
Meaning |
|---|---|---|
| 400 | invalid_request |
A missing or malformed parameter. message says which one. |
| 400 | bad_request |
The request body couldn't be parsed. |
| 401 | missing_token |
No Authorization: Bearer header, or a malformed one. |
| 401 | invalid_token |
The token is unknown, expired, or revoked. Sign in again. |
| 401 | invalid_credentials |
Wrong username or password on POST /auth/token. |
| 401 | two_step_required, invalid_code |
On POST /auth/token: the account has two-step sign-in on, and code is missing or wrong. |
| 403 | demo_account |
Demo accounts can't use the API. |
| 403 | account_suspended |
The account is suspended. |
| 404 | not_found |
No such resource, or it belongs to another account. |
| 405 | method_not_allowed |
Wrong HTTP method for this path. |
| 409 | already_sent |
That reply was already sent. |
| 409 | not_confirmed, cancelled, invalid_transition |
A job can't move to that step (see POST /jobs/{id}/status). |
| 409 | already_clocked_in, not_clocked_in |
Nothing to do on the clock. |
| 409 | sending |
That text is going out right now, so it can't be cancelled. |
| 422 | no_recipient |
The message has no usable sender address to reply to. |
| 422 | empty_reply |
There's no reply text: no draft, and no reply_body was sent. |
| 422 | empty_note |
A note with no words. |
| 422 | invalid_phone |
That isn't a phone number, or it's the business's own. |
| 422 | not_sent |
The text didn't go, or wasn't kept to go later. message says why, as the web page would. |
| 422 | not_placed |
The call wasn't placed. message says why, as the web page would. |
| 413 | payload_too_large |
The request body is over the deployment's limit (25 MB by default). |
| 413 | too_large |
A recorded call too long to play (over about two hours). |
| 429 | rate_limited |
Too many requests. Back off and retry. |
| 429 | sign_in_paused |
On POST /auth/token: 10 sign-ins to this account failed in a row (wrong passwords or codes, from anywhere), so signing in to it is paused for 15 minutes, whatever the password. A password reset ends it. |
| 500 | server_error |
Unexpected server error. |
| 502 | send_failed |
The account's email provider rejected or failed the send. Nothing was marked as sent, so it's safe to retry. |
| 502 | storage_error |
The document storage failed. |
| 502 | recording_unavailable |
Twilio couldn't give the voicemail or call recording just now. Try again. |
| 503 | api_disabled |
The API is turned off on this deployment. |
401 responses include a WWW-Authenticate: Bearer realm="api" header (with error="invalid_token" when a token was sent but rejected), as RFC 6750 describes. Clients should treat any other 401 as "signed out" and send the user back to the sign-in screen; the three POST /auth/token answers above are the user's sign-in being turned down.
Rate limits
POST /auth/token: 10 per minute and 50 per hour per IP address. And per account: after 10 failed sign-ins in a row, on the web or here, signing in to it pauses for 15 minutes (sign_in_paused).- Everything else: 120 per minute per token, so many phones behind one carrier or office network don't share a limit. Requests without a valid token are counted per IP address.
Responses carry X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset (a Unix timestamp). A 429 also carries Retry-After, in seconds: wait at least that long before retrying.
Endpoints
POST /auth/token: sign in
Exchanges a username (or the account's email address) and password for a token. Either matches in any capitals.
curl -X POST http://demo.voyancy.com/api/v1/auth/token \
-H 'Content-Type: application/json' \
-d '{"username": "jamie", "password": "...", "device_name": "Jamie'\''s iPhone"}'
| Field | Required | |
|---|---|---|
username |
yes | The username, or the account's email address. |
password |
yes | |
device_name |
no | Shown in Settings → API access and in GET /tokens, so the user can tell their devices apart. Defaults to Mobile app. |
code |
when asked | The 6-digit code from the user's authenticator app, or one of their recovery codes, for an account with two-step sign-in on. |
201 Created
{
"access_token": "sec_4mZ...",
"token_type": "Bearer",
"expires_at": "2026-12-29T14:05:09.512000Z",
"token": {"id": 7, "name": "Jamie's iPhone", "prefix": "sec_4mZq1b7X", "created_at": "...", "last_used_at": null, "expires_at": "...", "revoked": false, "current": true},
"user": { "...": "same shape as GET /me" }
}
Store access_token in the platform's secure storage (iOS Keychain, Android Keystore). It is never shown again.
An account with two-step sign-in on answers a right password without code with 401 two_step_required. Ask for the code and send the same request again with code added. A wrong or reused code gets 401 invalid_code. Neither means the user is signed out, so stay on the sign-in screen.
DELETE /auth/token: sign out
Revokes the token used to make this request. Returns 204 No Content.
GET /me
The signed-in user, their business profile, and their team.
{
"id": 12,
"username": "jamie",
"name": "Jamie Reyes",
"email": "jamie@acmehvac.com",
"company_name": "Acme HVAC",
"business_type": {
"key": "hvac",
"label": "HVAC",
"categories": [{"key": "emergency_service", "label": "Emergency Service"}, "..."]
},
"team": {"is_owner": false, "owner_username": "pat", "owner_name": "Pat Lin"},
"subscription": {"tier": "professional", "status": "active"},
"push": {"available": true, "enabled": true, "devices": 1},
"texting": {"on": true, "has_number": true, "number": "(512) 555-0100", "recording": false}
}
texting is about the business's own phone number: on is whether this deployment has texting and calls, has_number whether the business has its number (with number as people read it), and recording whether calls on it are recorded (see GET /calls/recordings). A phone app shows its text boxes and "call from the business's number" buttons when on and has_number are both true.
push is about push notifications: available is whether this deployment sends them (Firebase is set up), enabled is this person's own switch, and devices counts their signed-in phones (see POST /devices).
company_name, business_type, and subscription come from the team owner's account, because that's the account the whole team works under. business_type.key is null until the account finishes onboarding; until then, label and categories are the general-business defaults. categories lists every category the triage can assign for this business type, which is useful for building a filter menu.
GET /mailbox
The team's triaged mail, newest first.
| Query parameter | Default | |
|---|---|---|
limit |
50 | 1–100 items per page. |
before_id |
For the next page, pass the previous response's next_before_id. |
|
status |
all |
all, pending (reply not yet sent), or sent. |
category |
A category key from GET /me. |
|
urgency |
low, normal, high, or emergency. |
curl -H "Authorization: Bearer $TOKEN" \
'http://demo.voyancy.com/api/v1/mailbox?status=pending&limit=20'
200 OK
{
"items": [
{
"id": 481,
"sender": "Alice Smith <alice@customer.example>",
"sender_name": "Alice Smith",
"sender_email": "alice@customer.example",
"subject": "No heat since last night",
"category": "emergency_service",
"category_label": "Emergency Service",
"urgency": "high",
"drafted_reply": "Hi Alice, ...",
"channel": "email",
"channel_label": "Email",
"preview": "Our furnace stopped working last night and the house is down to 58...",
"customer_id": 77,
"tags": ["VIP"],
"media_count": 0,
"has_voicemail": false,
"call_state": null,
"status": "pending",
"created_at": "2026-09-30T07:12:44.100000Z",
"sent_at": null
}
],
"next_before_id": 452
}
channel is email, sms (a customer's text to the business's number; sender is their phone number, and sending the reply texts it back) or call (a missed call; its drafted_reply is the text the caller was sent, already sent). channel_label says what it is as the web mailbox's badge does: Email, Text, Voicemail, Call (one the AI receptionist took) or Missed call. preview is the start of what the message says (null when nothing was kept), tags the customer's tags, media_count how many photos or files came with a text, has_voicemail whether there's a voicemail to play, and call_state is talking while the AI receptionist is still on the call.
status=pending leaves out the texts and calls of numbers the team blocked, as the web mailbox's "To answer" does.
next_before_id is null on the last page. Pages are keyed by id rather than by offset, so mail that arrives while the user scrolls never shifts or duplicates items.
GET /mailbox/{id}
One item, in the same shape as the list items, plus what the web mailbox shows on its card. 404 if it isn't in the caller's team mailbox.
{
"id": 482,
"channel": "sms",
"channel_label": "Text",
"body": "The water heater is leaking from the bottom. Photo attached.",
"photos": [{"id": 3101, "name": "text-photo-1.jpg", "content_type": "image/jpeg", "url": "/api/v1/documents/3101/download"}],
"files": [],
"files_not_kept": 0,
"voicemail": null,
"notes": [{"id": 9, "body": "@sam can you take this one?", "author": "Pat Lin", "created_at": "2026-09-30T07:20:01Z"}],
"saved_replies": [{"title": "On our way", "text": "Hi Dana, we're on our way."}],
"phone": "+15125550199",
"can_block": true,
"blocked": false,
"customer": {"id": 77, "name": "Dana Ortiz"},
"...": "and the list item's fields"
}
bodyis what the message says (for a voicemail, the written-out copy; for a call the receptionist took, the conversation).photosare the photos the customer texted, kept in the document library; load eachurlwith the token.filesare other files that came with it.files_not_keptcounts photos and files that came with a text but weren't kept (no document storage).voicemail, for a voicemail:{"seconds": 31, "url": "/api/v1/mailbox/482/voicemail", "written_out": true}.notesare the team's notes on it, oldest first (POST /mailbox/{id}/notesadds one). They're never sent to the customer.saved_repliesare the team's saved replies, with the customer's first name filled in, to put into the reply before sending.phoneis the number a text or call came from (nullfor an email or a withheld number);can_blockandblockedare forPOST /numbers/block.
GET /mailbox/{id}/voicemail
A voicemail's audio, as audio/mpeg, fetched from Twilio each time and never cached. A Range request gets just that part (some players ask for one first). 404 if the message has no voicemail; 502 recording_unavailable if Twilio can't give it just now.
POST /mailbox/{id}/notes
A note for the team on a message, never sent to the customer: {"note": "Called her back, waiting on the part."}. Writing "@sam" (the first word of a teammate's name, or their username) pushes that teammate (see POST /devices). 201 with {"message": "Added your note, and pushed it to Sam Ruiz.", "notes": [...]}, all the message's notes. 422 empty_note for one with no words.
POST /numbers/block
Blocks a number for the whole team: its calls are turned away and its texts ignored. {"phone": "(512) 555-0199"}; returns {"phone": "+15125550199", "blocked": true, "message": "..."}. 422 invalid_phone for something that isn't a phone number, or for the business's own. 404 with texting off.
POST /numbers/unblock
{"phone": "+15125550199"}; returns {"phone": ..., "blocked": false, "message": ...}.
POST /mailbox/{id}/send: approve and send
Sends the drafted reply to the original sender, threaded into their conversation, from the team's configured email provider. To send an edited reply, pass reply_body. Leave it out to send the AI draft as-is.
curl -X POST -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
http://demo.voyancy.com/api/v1/mailbox/481/send \
-d '{"reply_body": "Hi Alice, a technician is on the way and will arrive by 10am."}'
200 OK
{"recipient": "alice@customer.example", "item": { "...": "the updated item, now with status \"sent\"" }}
A reply can only be sent once: after that the endpoint returns 409 already_sent. Other failures return no_recipient, empty_reply, or send_failed. This is the same action as Approve & Send on the web mailbox, and it's recorded in the account's audit log the same way.
GET /analytics
The same numbers as the web analytics page, for the whole team.
{
"total": 1284,
"pending": 17,
"by_category": {"emergency_service": 212, "quote_request": 390, "...": 0},
"by_urgency": {"high": 240, "normal": 1044},
"daily": [{"date": "2026-09-01", "count": 41}, "... 30 days, oldest first ..."]
}
GET /usage
This month's usage against the plan's limits. Both limits are shared across the team.
{
"period_start": "2026-09-01T00:00:00Z",
"emails": {"used": 312, "quota": 1000},
"advanced_analysis": {"used": 4, "quota": 25}
}
GET /tokens
The caller's active tokens, for a "signed-in devices" screen. The token making the request has "current": true.
{"items": [{"id": 7, "name": "Jamie's iPhone", "prefix": "sec_4mZq1b7X", "created_at": "...", "last_used_at": "...", "expires_at": "...", "revoked": false, "current": true}]}
last_used_at is updated at most once a minute.
DELETE /tokens/{id}
Revokes one of the caller's own tokens, e.g. "sign out my old phone". Returns 204 No Content. 404 if the id isn't one of the caller's tokens.
GET /customers
The team's customer records, newest first. A record is created for each person who writes to the mailbox; people can also be added by hand, or imported from a spreadsheet, in the web app. unsubscribed_at is when they unsubscribed from the business's marketing email: anything that emails them for the business should leave them out. 404 when the deployment has customer records turned off.
| Query parameter | Default | |
|---|---|---|
limit |
50 | 1–100 items per page. |
before_id |
For the next page, pass the previous response's next_before_id. |
|
q |
Search names, emails, phones, companies and addresses. |
200 OK
{
"items": [
{
"id": 57,
"name": "Alice Smith",
"email": "alice@customer.example",
"phone": "(555) 010-2030",
"company": null,
"service_address": "12 Oak St, Springfield",
"notes": "Gate code 4411",
"source": "email",
"created_at": "2026-09-30T07:12:44.100000Z",
"last_contact_at": "2026-09-30T07:12:44.100000Z",
"review_requested_at": null,
"unsubscribed_at": null
}
],
"next_before_id": null
}
source is email (built from the mailbox) or manual (added by hand).
GET /customers/{id}
One customer in the same shape, plus emails: their most recent 50 messages as {id, subject, category, urgency, channel, created_at, sent_at}, newest first. Each id works with GET /mailbox/{id}. 404 if the customer isn't in the caller's team.
It also has texts, their conversation with the business's number, as the customer's web page shows it:
{
"on": true,
"has_number": true,
"can_text": true,
"can_call": true,
"call_me_at": "(512) 555-0177",
"text_max": 600,
"thread": [
{"direction": "in", "at": "2026-11-30T14:02:11Z", "when": "Nov 30, 9:02 AM", "text": "Is anyone free today?", "by": null, "recording_id": null},
{"direction": "out", "at": "2026-11-30T14:05:40Z", "when": "Nov 30, 9:05 AM", "text": "We can be there by 11.", "by": "Pat Lin", "recording_id": null}
],
"scheduled": [{"id": 5, "body": "Reminder: we're coming tomorrow 8-10.", "send_at": "2026-12-01T13:00:00Z", "when": "Dec 1, 8:00 AM", "status": "waiting", "problem": null}],
"saved_replies": [{"title": "On our way", "text": "Hi Dana, we're on our way."}],
"phone": "+15125550199",
"blocked": false
}
texts is {"on": false} when texting is off on the deployment. thread is the newest 30 lines, oldest first: their texts and calls in, every text sent them, and calls placed to them (recording_id is the call's recording, for GET /calls/recordings/{id}). scheduled is what's set to go later, and any that couldn't go, with problem saying why. call_me_at is the caller's own number as last used, for POST /customers/{id}/call. Times are UTC, and when is in the business's own time zone.
POST /customers/{id}/text
Texts the customer from the business's number: {"message": "We can be there by 11."}. To text a photo, send a multipart/form-data form with message and a photo file. To send it later, add send_at, a date and time in the business's own time zone ("2026-12-01T08:00"): texts go between 8 AM and 9 PM there, up to 60 days ahead, and a photo only goes right away. 200 with {"message": "Texted Dana Ortiz.", "texts": {...}}, the conversation now. 422 not_sent when it didn't go, with why in message (no texting number, they replied STOP, no mobile number, too long...). The text goes out as sent_by the caller, as on the web.
POST /customers/{id}/call
Calls the customer from the business's number: {"my_phone": "(512) 555-0177"}, the caller's own phone. Twilio rings it first; answering and pressing 1 puts them through, and the customer sees the business's number. my_phone is kept for next time (call_me_at). 200 with the message to show; 422 not_placed with why (a number outside the US and Canada, the Texting add-on off...). 30 calls an hour per token.
DELETE /texts/scheduled/{id}
Cancels a text set to go later, or clears away one that couldn't go. 200 with the message to show; 409 sending while it's going out; 404 for another team's.
GET /calls/recordings
The team's recorded calls, newest first, written out and summed up by the account's AI (calls are recorded once the owner turns it on, in Settings, Texting). Paginate like GET /mailbox; customer_id lists one customer's.
{
"items": [{
"id": 31, "at": "2026-11-30T15:10:00Z", "when": "Nov 30, 10:10 AM", "who": "Dana Ortiz", "customer_id": 77,
"direction": "Call in", "length": "3 minutes",
"summary": "Water heater leaking; wants someone today.", "preview": "Water heater leaking; wants someone today.",
"next_step": "Book a visit this afternoon.", "tags": ["Emergency", "New job"],
"written": true, "note": null, "has_audio": true, "audio_url": "/api/v1/calls/recordings/31/audio"
}],
"recording_on": true,
"next_before_id": null
}
written is false until the AI has written the call out, and note says why it couldn't. has_audio turns false once the audio is deleted from Twilio (after the deployment's keep period); what was written stays.
GET /calls/recordings/{id}
One recorded call, as in the list, plus turns (the call written out, a turn each: {"who": "Team" | "Customer", "text": ...}) and taken_by (who was on the team's side, when known).
GET /calls/recordings/{id}/audio
The call's audio, as audio/mpeg, fetched from Twilio each time. A Range request gets just that part. 404 once the audio is deleted; 413 too_large for a call too long to play; 502 recording_unavailable.
GET /documents
The team's document library, newest first: uploads, mail attachments it keeps, and job photos. 404 when the deployment has documents turned off.
| Query parameter | Default | |
|---|---|---|
limit |
50 | 1–100 items per page. |
before_id |
For the next page, pass the previous response's next_before_id. |
|
q |
Search file names, folders, and the senders and subjects of the emails they came with. | |
folder |
Only this folder. | |
source |
upload, email_attachment or job_photo. |
200 OK
{
"items": [
{
"id": 88,
"filename": "2026-10-05_Dana_Ortiz_IMG_0001.jpg",
"folder": "Job photos",
"source": "job_photo",
"content_type": "image/jpeg",
"size_bytes": 284113,
"email_sender": null,
"email_subject": null,
"triaged_email_id": null,
"appointment_id": 41,
"created_at": "2026-10-05T14:02:11Z"
}
],
"next_before_id": null
}
triaged_email_id is the message an attachment came with (see GET /mailbox/{id}); appointment_id is the job a photo was taken on.
GET /documents/{id}/download
The file, as a download in its own type. 404 if it isn't in the caller's team library; 502 storage_error if the document storage failed.
GET /my-day
The caller's jobs for one day, in time order, then that day's unassigned jobs (anyone can take one by heading out to it), and the time clock. The same as the web app's My day. 404 not_found when the deployment has jobs turned off.
| Query parameter | Default | |
|---|---|---|
day |
today | YYYY-MM-DD, in the team's time zone. |
200 OK
{
"day": "2026-10-05",
"today": "2026-10-05",
"time_zone": "America/New_York",
"clock": {"clocked_in": true, "since": "8:00 AM", "records_location": false},
"mine": [
{
"id": 41,
"starts_at": "2026-10-05T13:00:00Z",
"ends_at": "2026-10-05T14:00:00Z",
"time_label": "9:00 AM",
"status": "confirmed",
"work_status": null,
"work_label": "Scheduled",
"next_action": {"action": "on_the_way", "label": "On my way"},
"service": "Furnace won't start",
"notes": "Side door",
"contact": {"name": "Dana Ortiz", "email": "dana@example.com", "phone": "555-0100"},
"address": "12 Oak St, Springfield",
"map_url": "https://www.google.com/maps/search/?api=1&query=12+Oak+St%2C+Springfield",
"customer_id": 3,
"assigned_to": {"id": 7, "username": "jamie", "name": "Jamie Reyes"},
"work_notes": null,
"checklist": [{"text": "Check filter", "done": false}],
"on_the_way_at": null,
"started_at": null,
"completed_at": null,
"signed": false,
"signed_by": null,
"signed_at": null,
"photo_storage": true,
"photos": [
{"id": 88, "name": "2026-10-05_Dana_Ortiz_IMG_0001.jpg", "created_at": "2026-10-05T14:02:11Z",
"url": "/api/v1/jobs/41/photos/88", "can_delete": true}
]
}
],
"unassigned": []
}
time_labelis the start in the team's time zone, ready to show.statusis the booking's:requested,confirmedorcancelled. Cancelled visits aren't listed.work_statusonly moves forward:null(scheduled), thenon_the_way,in_progress,done. A step may be skipped.next_actionis the button that moves the job on, ornullwhen there isn't one: the job is done, or the visit isn't confirmed yet.photosisnullwhen the deployment has documents turned off. Each photo'surlis an API path: fetch it with the token.can_deleteis true for the account owner and whoever added the photo.photo_storagesays whether photos can be added: they're kept in the document library, which needs the storage add-on.clockisnullwhen the deployment has time tracking turned off.sincereads like"8:00 AM", or with a date when the shift started on another day.records_locationistruewhen the team records where people clock in and out: send the phone's position withPOST /clock.
GET /jobs/{id}
One job in the same shape, plus texts: whether its customer can be texted and called from the business's number, in the shape of a customer's texts (see GET /customers/{id}), with scheduled the texts set to go about this job, and thread empty and phone null (the conversation is on the customer's). Every endpoint that changes a job answers with it too. 404 if it isn't one of the team's jobs.
POST /jobs/{id}/status: on my way, start, done
{"action": "on_the_way", "eta": 20}
action is on_the_way, start or done. eta is optional, in minutes: "On my way" emails the customer, saying they'll arrive in about that long, and texts them from the business's number when it has one. An unassigned job is assigned to whoever moves it on.
200 OK
{"job": { "...": "the updated job" }, "message": "On the way. We've let the customer know."}
Show message to the user. It says whether the customer was emailed, and, on done, how many checklist items weren't ticked.
| Status | error |
|
|---|---|---|
| 400 | invalid_request |
Unknown action, or eta isn't a whole number. |
| 409 | not_confirmed |
The visit was requested but not confirmed yet. |
| 409 | cancelled |
The visit was cancelled. |
| 409 | invalid_transition |
The job is already at or past that step. |
POST /jobs/{id}/notes
{"work_notes": "Replaced the igniter"} replaces the team's own notes on the job. Customers never see them. Returns the updated job.
POST /jobs/{id}/checklist
{"done": [0, 2]} ticks the checklist items at those indexes and unticks the rest. Indexes past the end are ignored. Returns the updated job. The checklist comes from the account owner's template (set on the web app) until someone ticks it.
POST /jobs/{id}/photos
Adds photos to the job: a multipart/form-data upload with up to 10 files in the photos field. Each one is shrunk to 1,600 pixels on its long side, turned upright, saved as a JPEG with its metadata (including where it was taken) removed, and kept in the team's document library under Job photos. 60 uploads an hour per token.
curl -X POST -H "Authorization: Bearer $TOKEN" -F photos=@IMG_0001.jpg -F photos=@IMG_0002.jpg \
http://demo.voyancy.com/api/v1/jobs/41/photos
201 Created: {"job": { "...": "the updated job" }, "message": "Added 2 photos."}. When some files weren't photos, the others are still added and message names the ones that weren't.
| Status | error |
|
|---|---|---|
| 400 | invalid_request |
No files, or more than 10. |
| 403 | storage_addon_required |
The account needs the Document storage add-on. |
| 422 | not_a_photo |
None of the files was a JPEG, PNG, WebP or GIF picture. |
| 502 | storage_error |
The document storage failed; nothing was added. |
GET /jobs/{id}/photos/{photo}
The photo itself (image/jpeg). Use the url from the job.
DELETE /jobs/{id}/photos/{photo}
Deletes the photo from the job and the document library. 204 No Content. 403 forbidden unless the caller is the account owner or added the photo.
POST /jobs/{id}/signature
The customer's signature, once the job has started:
{"signed_by": "Dana Ortiz", "signature": "iVBORw0KGgo..."}
signature is a PNG, base64-encoded (a data:image/png;base64, URL works too), of at most 200 KB. Returns {"job": ..., "message": "Signed by Dana Ortiz."}. 409 not_started before the job has started; 400 invalid_request without a name or a PNG. Signing again replaces the signature.
POST /jobs/{id}/text
Texts the job's customer from the business's number, as POST /customers/{id}/text does: the job's own contact phone, else its customer's. 200 with {"message", "texts"}; 422 not_sent.
POST /jobs/{id}/call
Calls the job's customer from the business's number, as POST /customers/{id}/call does. 200, or 422 not_placed.
POST /clock
{"action": "in"} or {"action": "out"} clocks the caller in or out. When clock.records_location is true, add the phone's position: "lat" and "lng" in degrees, and "accuracy" in metres (optional). It's kept only when the team records where people clock; a missing or impossible position is ignored and the punch still counts.
200 OK
{"clock": {"clocked_in": false, "since": null, "records_location": false}, "message": "Clocked out after 8h 30m."}
409 already_clocked_in / 409 not_clocked_in when there's nothing to do. 404 when time tracking is turned off. The account owner fixes forgotten clock-outs on the web app's Timesheets page.
POST /devices: register for push notifications
{"token": "<Firebase Cloud Messaging token>", "platform": "android", "name": "Jamie's Pixel"} registers this phone, for the person signed in with this token. platform is android or ios; name is optional (shown in the web app's Settings). Registering the same FCM token again, after signing in again or as someone else on the same phone, moves it rather than adding a second.
201 Created
{"device": {"platform": "android", "name": "Jamie's Pixel"}, "push": {"available": true, "enabled": true, "devices": 1}}
A phone gets pushes only while the sign-in that registered it is active: signing out (DELETE /auth/token), revoking the token or letting it expire stops them. Each push has a title and body, and data with kind (urgent_mail, job_assigned, quote_decided or invoice_paid), path (the web page it's about, like /jobs/42) and the record's id (triaged_email_id, job_id, quote_id or invoice_id). 400 invalid_request for a missing or malformed token or platform.
DELETE /devices
{"token": "<FCM token>"} forgets this phone; send it on sign-out. Only the caller's own phones are touched. 204 No Content.
PUT /push
{"enabled": false} turns the caller's push notifications off (true turns them on); answers with the push object above. The web app's Settings has the same switch.
AI assistants (MCP)
An AI assistant that speaks the Model Context Protocol can read the business at http://demo.voyancy.com/mcp: its customers, the messages waiting for an answer, the schedule and the calls. It signs in with a token from Settings → API access, the same as the API, and sees what that person sees in the web app.
Connect it as a remote MCP server (Streamable HTTP) with the header Authorization: Bearer <token>. In Claude Code:
claude mcp add --transport http secretary http://demo.voyancy.com/mcp --header "Authorization: Bearer sec_4mZ..."
Assistants that connect only by signing in (OAuth), without a header to set, can't use it yet.
- Read-only. Nothing is sent, booked or changed through it: replying, booking and editing stay in the app, where a person approves them. Revoking the token in Settings cuts the assistant off.
- The tools:
secretary_search_customers: by name, email, phone, company or address, or by tag, most recently in touch first, with their tags and custom fields. Pages of up to 50 (limit,offset).secretary_get_customer: one customer's details, latest messages and visits: the next ones first, then the latest before now, up to 20.secretary_list_waiting_messages: the mailbox's "To answer" (emails, texts, voicemails and missed calls), newest first, with category, urgency, an excerpt and whether a reply is drafted. Blocked numbers are left out.secretary_get_schedule: the visits from a day (start_date,YYYY-MM-DD, the business's own date, from 1900 to 2999; today if left out) for up to 31days.secretary_get_call_summary: the last 7, 30 or 90daysof calls: answered and not, the answer rate, how fast the team got back to people, and who's still waiting.- Answers come as JSON, both in the result's text and as
structuredContent, with times in UTC and in the business's own time zone, and links into the web app. - The transport: each JSON-RPC request is a
POSTanswered with one JSON object (no event stream;GETanswers 405), protocol versions 2025-06-18 and 2025-03-26. A request from a web page on another site is refused, and there are at most 120 requests a minute.
Notes for client developers
- No CORS. The API is built for native apps and server-side scripts, not for JavaScript running on other websites.
- No cookies. The API ignores the web app's session cookie, and CSRF tokens aren't needed.
- Idempotency. Sending a reply is the only action with an external side effect, and it's protected server-side: a retried send after a network drop returns 409 instead of emailing the customer twice.