# Support SLA & Cancellation Signal Queue (`afkdigital/support-sla-cancellation-signal-queue`) Actor

Prioritize customer support tickets by your supplied SLA rules and explicit cancellation/nonrenewal wording. CSV/JSON exports, privacy-first human review.

- **URL**: https://apify.com/afkdigital/support-sla-cancellation-signal-queue.md
- **Developed by:** [AFK Digital](https://apify.com/afkdigital) (community)
- **Stats:** 2 total users, 1 monthly users, 69.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 human review queue items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Support SLA & Cancellation Signal Queue

Privacy-first read-only human review queue for SaaS support teams. Bring authorized pre-anonymized Zendesk or equivalent support ticket exports in CSV/JSON. This Actor flags response deadlines approaching or overdue under **customer-supplied** SLA rules and explicit cancellation or non-renewal expressions from permitted customer text. It never predicts churn, sends replies, updates tickets, or accesses Zendesk live.

### First-run demo and automated health check

The Apify Store input form prefills **demoMode=true** (no real file or credentials). If and only if no CSV/JSON source is supplied, this setting generates a single completely fictitious `DEMO-TICKET-001` record with a clearly fictional 120-minute SLA and explicit canned cancellation text. Demo timestamps are calculated relative to run time so that Store QA can obtain a non-empty Dataset in under five minutes on any day. The returned RUN-SUMMARY explicitly marks `inputMode: SYNTHETIC_DEMO` and `isSyntheticDemo: true`. No fabricated demonstration record is ever mixed with a real CSV/JSON source; uploaded exports always take precedence even if the checkbox remains checked. The standard paid queue-item event also applies to the demo result. Turn off demoMode in production if desired.

Ordinary API/CLI calls without a ticket source and without explicitly setting demoMode to true still return the actionable EXACTLY_ONE_TICKET_SOURCE_REQUIRED error. This prevents silently substituting demo data for forgotten customer exports.

### Inputs

Choose exactly one: ticketsFile (Apify upload of CSV/JSON, max 4 MiB), tickets (JSON array), ticketsCsv, or ticketsJson. Max 5,000 input rows and max 1,000 queue results. File URLs must be HTTPS api.apify.com key-value-store record uploads; no arbitrary remote requests, redirects or credentials.

Ticket column aliases: ticket_id / id / ticketId; required created_at and status; optional updated_at, tags, last_agent_reply_at, last_customer_message_at, reopened_at; optional last_reply_at **paired with** last_reply_actor of agent/customer. For tickets with no reply history, supply awaiting_agent_response:true explicitly. Optional customer_text, customer_message, or latest_customer_message may contain customer-only content you have authority to process. Do not supply full threads, names, emails or agent-authored messages.

If reply history or an explicit pending-reply indicator is absent, no SLA violation is inferred. If last_reply_at exists without an actor role, the SLA is ambiguous. A later reopened_at restarts a reply clock after an earlier agent answer. Closed/solved tickets are excluded.

### SLA rules

Each slaRules object has id, targetMinutes, optional warningMinutes, priority (lower wins), tagsAny, tagsAll and activeStatuses (default new/open/reopened; pending and hold excluded). Without a matching user-provided rule, **no SLA breach** is claimed.

Optionally supply timezone (IANA, default UTC) and businessHours with days (0=Sunday...6=Saturday), start and end (HH:MM) and holidays (YYYY-MM-DD). Without businessHours, 24x7 calendar time applies. This models time-to-next-agent-response only, NOT full provider SLA semantics. Multiple shifts, overnight schedules, complex pause/resume policies, and >2-year spans are not supported.

Every timestamp including optional asOf requires ISO 8601 with a Z or numeric UTC offset. Naive local timestamps are not accepted. Business-hour computation accounts for IANA DST transitions and specified holidays.

### Output

Default Dataset includes ONLY: ticketId, reviewRank, reviewPriority, slaStatus, responseWaitState, deadline, remainingMinutes (negative=overdue), overdueMinutes, matchedRuleId, matchedTags, cancellationSignal, signalEvidence, evidenceSource, evaluationTime and reviewAction (always HUMAN_REVIEW_ONLY). RUN-SUMMARY contains only aggregate counters.

Ordering: overdue with a cancellation signal first; other overdue second; explicit signal third; nearing an SLA deadline fourth. A tag alone does not prove cancellation intent. Cancellation evidence is a **fixed dictionary phrase**, not raw text or a private message. Selected English and Turkish explicit phrases supported; false positives and negatives remain possible. A cancellation signal does not mean confirmed churn or a completed cancellation.

Dataset is restricted to non-identifying ticket IDs, allowed tag names, rule IDs, timestamps and canned evidence, with no customer names, emails or ticket bodies. Other input columns are ignored. **The original upload and run INPUT remain in Apify storage** according to the user's own retention settings; redact the source file and use short retention before uploading. Keep ticket IDs and tags non-identifying.

### Examples and testing

Use examples/input.json (synthetic records), examples/csv-input.json or examples/tickets.csv. For local development: npm ci; npm test; copy a sample input to storage/key_value_stores/default/INPUT.json; npm start. Inspect Dataset and RUN-SUMMARY for privacy.

### Pricing

Verified published pricing as of 2026-10-12 is $0.005 per delivered review queue item; no separate start event is configured. **The Store pricing page is authoritative.** Unflagged input rows carry no result event charge. No LLM, proxy, Zendesk API, automatic replies or background ticket updates. User-set spending limits and cloud compute charges are governed by Apify.

### Zendesk API policy (not integrated in v1)

A future read-only integration would require tenant authorization and validation of OAuth tickets:read scope, pagination/cursor handling, incremental export limits and Retry-After/429. The v1 Actor never requests Zendesk keys.

- OAuth scopes: https://developer.zendesk.com/api-reference/ticketing/oauth/grant_type_tokens/
- Incremental exports: https://developer.zendesk.com/api-reference/ticketing/ticket-management/incremental_exports/
- Rate limits: https://developer.zendesk.com/api-reference/introduction/rate-limits/
- Apify monetization: https://docs.apify.com/actors/publishing/monetize/pay-per-event

Version 1.0.0, October 12 2026.

# Actor input Schema

## `demoMode` (type: `boolean`):

Prefilled only for first-run Store demonstrations and automatic QA. When enabled WITHOUT a CSV/JSON source, generate one clearly labeled, completely fictional support ticket and one fictional SLA. Real exports always take precedence; disable for production workflows. This is not a substitute for customer data. One demo queue item may incur the normal per-item charge.

## `ticketsFile` (type: `string`):

Optional Apify key-value-store CSV or JSON upload (up to 4 MB). Provide exactly one of file, tickets array, CSV text, JSON text. Do not upload names/emails/private conversations.

## `tickets` (type: `array`):

Authorized, pre-redacted ticket records (ticket_id, created_at, status, optional last_agent_reply_at, last_customer_message_at, last_reply_at + last_reply_actor, reopened_at, tags, customer_text). Blank when uploading file.

## `ticketsCsv` (type: `string`):

Alternative to file/array. Header columns: ticket_id,created_at,status,updated_at,last_agent_reply_at,last_customer_message_at,reopened_at,tags,customer_text. Restricted to 4 MB.

## `ticketsJson` (type: `string`):

Alternative to other sources. JSON array or object containing tickets array or data array. Restricted to 4 MB.

## `slaRules` (type: `array`):

Ordered rules with id, targetMinutes, warningMinutes, optional priority, activeStatuses, tagsAny, tagsAll, timezone, businessHours {days:\[1,2,3,4,5],start:'09:00',end:'17:00',holidays:\['2026-12-25']}. No inferred SLA if omitted.

## `asOf` (type: `string`):

Optional ISO date/time with Z or explicit numeric UTC offset. Defaults to actual run time; e.g. 2026-10-12T13:00:00Z.

## `maxResults` (type: `integer`):

Maximum results retained, prioritizing overdue SLA and explicit cancellation; input limited to 5,000 tickets.

## Actor input object example

```json
{
  "demoMode": true,
  "maxResults": 250
}
```

# Actor output Schema

## `queue` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "demoMode": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("afkdigital/support-sla-cancellation-signal-queue").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "demoMode": True }

# Run the Actor and wait for it to finish
run = client.actor("afkdigital/support-sla-cancellation-signal-queue").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "demoMode": true
}' |
apify call afkdigital/support-sla-cancellation-signal-queue --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,afkdigital/support-sla-cancellation-signal-queue"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/8hNOGsEP7frO2lpx7/builds/dCZmEUgK3tVbHnWOf/openapi.json
