Skip to main content

Upload WFM Schedule Files with an Integration Token: API Reference for Developers

Upload WFM Schedule Files with an Integration Token: API Reference for Developers

This is for the engineer who builds the export. Your Qvasa admin has set up a schedule feed and given you an integration token. With it, your system sends agent schedules to Qvasa as CSV files over HTTPS, and Qvasa imports each one into its workforce management: the schedule timeline, adherence and staffing reports.

In short: build a CSV in the format below, POST it with the token, then read the file back until its import is done. Everything else here is detail you'll want when something goes wrong.

Admins: setting up the feed and making the token is in Send Agent Schedules to Qvasa with the Schedule File Upload API.


What you need

  • An integration token's secret, from your Qvasa admin. It starts with qva_int_. Keep it in a secrets store: it can't be shown again, only replaced.

  • The channel's name (its slug), usually wfm-schedules. Your admin sees it on the setup page and on Settings > File Channels.

  • The base URL: https://www.qvasa.com/api/integrations/v1. Every call is HTTPS.

Every request carries the secret as a Bearer token:

Authorization: Bearer qva_int_...

What the token can and can't do

  • It acts for the Qvasa account, not for a person, and keeps working when people leave.

  • It can do only what its admin granted. For schedule files that's Send files to named channels, limited to the channels the admin ticked. It can send files to those channels, read back the files on them, and read its own details. It can't read your Qvasa data, download a file, or call any other Qvasa API.

  • It may have an expiry date and a list of IP addresses it works from. Requests from anywhere else are refused.

  • It has request limits, 600 a minute and 20,000 a day by default. Every call counts, status reads and parts included.

  • An admin can roll its secret (the old and new secrets both work for an overlap the admin chooses, so you can switch without an outage) or revoke it at once.

Check the token

Every live token can read its own details. It's a good first call: it proves the secret, the network rules and the grants before you build on them.

curl https://www.qvasa.com/api/integrations/v1/token \
  -H "Authorization: Bearer $QVASA_INTEGRATION_TOKEN"

{
  "token": {
    "id": 42,
    "name": "Manila BPO planner",
    "account_id": 1290,
    "secret": "qva_int_KkLr...zI8R",
    "secret_expires_at": null,
    "expires_at": "2027-02-28T22:43:00Z",
    "allowed_ip_ranges": [],
    "grants": [
      { "key": "file_channels.upload", "name": "Send files to named channels",
        "requests_per_minute": 600, "requests_per_day": 20000,
        "lifetime_request_cap": null, "lifetime_requests_counted": null }
    ]
  }
}

secret is a shortened form, never the whole secret. secret_expires_at is set when an admin has rolled the secret you're using: it stops working then, so switch to the new one first. A null expires_at means the token never expires.

The file format

A file is a CSV in Qvasa's schedule import template, UTF-8, with a header row. Your admin can download the template from the setup page's Download the template. The columns, in this order:

Column

Format

Meaning

agent_email

email

The agent, by their email in Qvasa (their Zendesk email). A new address creates the agent.

activity_code

text

What the agent is scheduled to do. Your own codes are fine: an admin maps them to Qvasa's schedule codes, and a code with no mapping becomes a new code.

date

YYYY-MM-DD, UTC

The day the segment starts.

start_time

HH:MM, 24-hour, UTC

When the segment starts.

end_time

HH:MM, 24-hour, UTC

When it ends. An end earlier than the start ends the next day (22:00 to 02:00).

agent_name (optional, last)

text

The name a new agent is created with.

agent_email,activity_code,date,start_time,end_time,agent_name
[email protected],CHAT,2026-12-01,14:00,18:00,Maya Chen
[email protected],LUNCH,2026-12-01,18:00,18:30,Maya Chen
[email protected],CHAT,2026-12-01,18:30,22:00,Maya Chen
[email protected],PHONE,2026-12-01,22:00,02:00,Sam Okafor
[email protected],,,,,Jonas Berg

  • One row per segment. A shift with a lunch is three rows.

  • All dates and times are UTC. Convert from local time in your export, daylight saving included.

  • What a file replaces: for each agent in the file, their schedule from the start of their first segment in the file to the end of their last. Agents not in the file, past shifts, and an agent's shifts outside that span are left as they are, as are shifts from other sources. So a file can cover one day or several weeks, and several systems can send their own agents to one channel.

  • A clear row (an email with every other cell blank, like Jonas above) removes every future shift this channel gave that agent.

  • To send a change, send the agent's whole span again. There are no per-row updates or deletes: the file is the schedule for each agent it names.

  • Limits: up to 100 MB and 500,000 rows. No shift may end more than 366 days from now.

Send a file in one request (up to 25 MB)

POST /file_channels/{channel}/files with the file's bytes as the body.

FILE=schedule_2026-12-01.csv
SHA=$(shasum -a 256 "$FILE" | cut -d' ' -f1)
curl -X POST https://www.qvasa.com/api/integrations/v1/file_channels/wfm-schedules/files \
  -H "Authorization: Bearer $QVASA_INTEGRATION_TOKEN" \
  -H "Content-Type: text/csv" \
  -H "X-Qvasa-Filename: $FILE" \
  -H "X-Qvasa-Content-Sha256: $SHA" \
  -H "Idempotency-Key: $SHA" \
  --data-binary @"$FILE"

Header

What it does

Authorization

required

Bearer and the token's secret.

Content-Type

required

text/csv. Qvasa also checks the bytes: a file that isn't CSV is refused.

X-Qvasa-Content-Sha256

required

The body's SHA-256, as 64 hex characters or base64. A body that doesn't match is refused and nothing is stored.

X-Qvasa-Filename

recommended

The file's name, shown to admins. Percent-encode anything outside plain ASCII.

Idempotency-Key

recommended

Makes a retry safe (below). Unique to each file: the file's SHA-256 is a good key.

201 Created means Qvasa has stored the file and queued its import:

{
  "file": {
    "id": 1234,
    "channel": "wfm-schedules",
    "filename": "schedule_2026-12-01.csv",
    "content_type": "text/csv",
    "size_bytes": 7421,
    "sha256": "cc5cb430...",
    "status": "received",
    "failure_reason": null,
    "processing_summary": null,
    "received_at": "2026-11-30T21:44:22.239Z",
    "processed_at": null,
    "expires_at": "2026-12-30T21:44:22Z",
    "created_at": "2026-11-30T21:44:22.414Z"
  }
}

Keep file.id: it's how you read what the import did.

Read what the import did

GET /file_channels/{channel}/files/{id} answers the same file object, now further along. Read it every few seconds until status is processed or failed; a file usually settles within seconds of arriving.

curl https://www.qvasa.com/api/integrations/v1/file_channels/wfm-schedules/files/1234 \
  -H "Authorization: Bearer $QVASA_INTEGRATION_TOKEN"

status

Meaning

receiving

An upload in parts that isn't complete yet.

received

Stored and waiting its turn.

processing

Being imported.

processed

Imported. processing_summary says what changed.

failed

Not imported, and nothing changed. failure_reason says why. Fix the file and send it again.

expired

An upload that was abandoned or aborted before it completed.

A processed file's summary:

"processing_summary": {
  "window_start": "2026-11-30T21:44:23Z",
  "window_end": "2026-12-04T00:00:00Z",
  "csv_rows_parsed": 108,
  "csv_clear_rows": 0,
  "csv_row_error_count": 0,
  "csv_row_errors": [],
  "activities": { "created": 2, "updated": 0, "total": 2, "mapped": 4 },
  "people": { "matched_by_wfm_id": 0, "matched_by_email": 0, "created": 8,
              "conflicts": 0, "skipped_wrong_email_domain": 0 },
  "schedule_records": { "created": 108, "updated": 0, "deleted": 0, "agents_cleared": 0,
                        "skipped_unknown_agent": 0, "skipped_unknown_activity_type": 0,
                        "sync_source_claimed": 8, "sync_source_conflict_count": 0 },
  "online_durations": { "examined": 0, "updated": 0 }
}

  • Rows that can't be read are skipped and listed in csv_row_errors (line number and reason, never the row's contents), as long as fewer rows fail than succeed. If more fail, or the header row is wrong, the whole file fails.

  • activities.mapped counts codes that landed on the admin's mappings; activities.created counts new codes, which wait for an admin to review.

  • people.skipped_wrong_email_domain counts agents outside the email domain the admin set on the feed. Their rows were skipped.

  • schedule_records.sync_source_conflict_count counts agents whose schedule another source owns. Their rows weren't written; an admin decides which source owns them.

Some failure_reason examples: "the feed's header row is missing [\"end_time\"]", "the feed is not UTF-8 text", "12 of the feed's 20 rows could not be parsed (first failing line 3)", "the feed runs to 2028-01-04, more than 366 days ahead". Each ends with "so nothing was reconciled": no schedule changed.

How files are processed

  • One at a time, oldest first, on each channel. A file never runs before one received ahead of it, and none is skipped, so a newer schedule is never overwritten by an older one that arrived first.

  • Usually within seconds. If Qvasa is busy it retries every 30 seconds; a file still waiting after an hour fails, and Qvasa is alerted.

  • The bytes are deleted once the import ends, processed or failed. The file's record and summary stay readable by its id. Nobody can download a file, not even an admin.

  • Sending the same schedule twice is harmless: the second import finds every shift already there.

Larger files: upload in parts

A file over 25 MB goes through an upload session: open it, send the parts, complete it. The same session lets you resume a broken upload.

1. Open: POST /file_channels/{channel}/uploads with a JSON body.

curl -X POST https://www.qvasa.com/api/integrations/v1/file_channels/wfm-schedules/uploads \
  -H "Authorization: Bearer $QVASA_INTEGRATION_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $SHA" \
  -d '{"filename":"big.csv","size_bytes":62914560,"content_type":"text/csv","sha256":"'$SHA'"}'

filename, size_bytes (exact) and content_type are required; sha256 of the whole file is optional, and when given, Qvasa checks the assembled file against it. 201 answers the session:

{
  "upload": {
    "id": 77,
    "state": "open",
    "part_size_bytes": 8388608,
    "declared_size_bytes": 62914560,
    "expected_parts": 8,
    "parts_received": [],
    "parts_missing": [1, 2, 3, 4, 5, 6, 7, 8],
    "expires_at": "2026-12-01T21:44:22Z",
    "file": { "id": 1235, "status": "receiving", ... }
  }
}

2. Send each part: PUT /file_channels/{channel}/uploads/{id}/parts/{n}, numbered from 1, with the part's bytes as the body and its own SHA-256 in X-Qvasa-Content-Sha256.

split -b 8388608 big.csv part.
curl -X PUT https://www.qvasa.com/api/integrations/v1/file_channels/wfm-schedules/uploads/77/parts/1 \
  -H "Authorization: Bearer $QVASA_INTEGRATION_TOKEN" \
  -H "Content-Type: application/octet-stream" \
  -H "X-Qvasa-Content-Sha256: $(shasum -a 256 part.aa | cut -d' ' -f1)" \
  --data-binary @part.aa

  • Every part except the last is exactly part_size_bytes (8 MiB); the last is the remainder.

  • Parts can go in any order, and in parallel.

  • Sending a part number again replaces it, so retrying a failed part is safe.

  • Each answer is the session again, with parts_received and parts_missing. To resume after a crash, GET /file_channels/{channel}/uploads/{id} and send what's missing.

3. Complete: POST /file_channels/{channel}/uploads/{id}/complete. 202 Accepted: Qvasa assembles and checks the file, then imports it like a one-request file. Read upload.file.id as in "Read what the import did". A session with parts missing is refused (422) and stays open.

To give up: DELETE /file_channels/{channel}/uploads/{id} (204). A session left open expires 24 hours after it opened. A token can have 10 sessions open at once.

Retries and the Idempotency-Key

  • Send an Idempotency-Key (1 to 255 printable ASCII characters) on POST …/files and POST …/uploads. If the first request succeeded and you send it again with the same key within 24 hours, Qvasa answers the first response again, with the header Idempotent-Replayed: true, and stores no second file.

  • A key used again with a different file is refused (422 idempotency_key_reused). Never reuse a key for a new file: a key made from the date, for example, breaks the second file sent that day. Use the file's SHA-256.

  • A failed request (4xx or 5xx) isn't remembered, so a retry with the same key runs again.

  • Parts, complete and status reads are already safe to repeat and take no key.

  • Retry a 429 after the Retry-After seconds, and a 500 or a network error with backoff. Don't retry other 4xx answers unchanged: fix what the message says.

Limits

Limit

Value

One request

25 MB; larger files go in parts

A schedule file

100 MB, 500,000 rows, no shift ending more than 366 days from now

Part size

8 MiB (8,388,608 bytes), the last part smaller

Open uploads

10 per token; each expires after 24 hours

Requests

600 a minute and 20,000 a day per token by default (an admin can change them); every call counts

Bytes received

20 GB per account per day (UTC)

Idempotency-Key

Remembered for 24 hours

Errors

Every error answers JSON with a sentence and a stable code:

{ "error": "This file is application/zip; the channel accepts text/csv.", "error_code": "content_type_not_accepted" }

Act on error_code; show error to a person.

Status

error_code

What to do

400

checksum_required, checksum_mismatch, checksum_malformed

Send the SHA-256 of exactly the bytes in the body.

400

empty_body, size_required, part_number_out_of_range, part_size_mismatch, idempotency_key_malformed, bad_request

Fix the request as the message says.

401

integration_token_missing, integration_token_unrecognized

No token, or one that's mistyped, revoked or expired. Ask your admin for a working secret.

403

channel_not_granted, grant_required

The token isn't allowed this channel. Your admin ticks it on the token.

403

ip_address_not_allowed

You're calling from an address outside the token's IP ranges. Your admin adds yours.

403

integration_tokens_not_enabled, lifetime_request_cap_reached

Ask your admin.

404

file_channel_not_found, file_not_found, upload_not_found

Check the channel name and the id. An upload is visible only to the token that opened it.

409

file_channel_feature_off, file_channel_has_no_workflow

The channel can't import files right now, so nothing was stored. Ask your admin.

409

idempotency_in_progress

The first request with this key is still running. Retry in a few seconds.

410

file_channel_archived

The channel takes no files. Ask your admin.

410

upload_expired, upload_aborted, upload_completed

That upload has ended. Open a new one.

413

content_too_large

Over 25 MB in one request: upload in parts. Over 100 MB: split the schedule into several files (by agent, so each file holds each agent's whole span).

415

content_type_not_accepted

Send text/csv, and CSV bytes.

422

idempotency_key_reused

Use a new key for a new file.

422

upload_incomplete

Send the parts in parts_missing, then complete again.

429

rate_limited, daily_byte_cap_reached, too_many_open_uploads

Wait for Retry-After seconds (when sent), or complete or abort an open upload.

500

internal_error

Our side; we're alerted. Retry with backoff, with the same Idempotency-Key.

A complete example

Send a file and wait for its import, in bash (needs curl and jq):

#!/usr/bin/env bash
set -euo pipefail
BASE=https://www.qvasa.com/api/integrations/v1/file_channels/wfm-schedules
FILE="$1"
SHA=$(shasum -a 256 "$FILE" | cut -d' ' -f1)RESPONSE=$(curl -sS -X POST "$BASE/files" \
  -H "Authorization: Bearer $QVASA_INTEGRATION_TOKEN" \
  -H "Content-Type: text/csv" \
  -H "X-Qvasa-Filename: $(basename "$FILE")" \
  -H "X-Qvasa-Content-Sha256: $SHA" \
  -H "Idempotency-Key: $SHA" \
  --data-binary @"$FILE")
ID=$(echo "$RESPONSE" | jq -er '.file.id') || { echo "$RESPONSE"; exit 1; }for _ in $(seq 1 60); do
  FILE_JSON=$(curl -sS "$BASE/files/$ID" -H "Authorization: Bearer $QVASA_INTEGRATION_TOKEN")
  STATUS=$(echo "$FILE_JSON" | jq -r '.file.status')
  case "$STATUS" in
    processed) echo "$FILE_JSON" | jq '.file.processing_summary'; exit 0 ;;
    failed)    echo "$FILE_JSON" | jq -r '.file.failure_reason'; exit 1 ;;
  esac
  sleep 5
done
echo "still $STATUS after 5 minutes"; exit 1

Did this answer your question?