---
title: "Test routing rules against a sample"
method: POST
path: "/products/help-desk/routing-rules/test"
tags: ["help-desk"]
---

# Test routing rules against a sample

`POST /products/help-desk/routing-rules/test`

## Request

- Base URL: `https://api.sparkvault.com/v1`
- URL: `https://api.sparkvault.com/v1/products/help-desk/routing-rules/test`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/sparkvault/apis/sparkvault-api/docs/products/help-desk/routing-rules/test/post.ts> (a function with typed inputs; its response is checked against the schema)

Which of the rules sent a sample request would match, saving nothing. Any member, from their own session.

## Request body

- object
  - `rules` HelpDeskRoutingRuleInput[], required
    - `rule_id` string, nullable: The rule this is; absent or null for a new rule.
    - `name` string, required
    - `enabled` boolean
    - `match` 'all' | 'any', required
    - `domains` string[]
    - `include_subdomains` boolean
    - `keywords` string[]
    - `actions` HelpDeskRoutingActions, required: What a matching rule does to a new request; at least one.
      - `team_id` string: The team the request goes to.
      - `add_tags` string[]: Tags the request gets, stored in lowercase.
      - `set_priority` 'urgent' | 'high' | 'normal' | 'low'
  - `sample` object, required
    - `requester_email` string, required
    - `subject` string
    - `body` string

## Response `200`

The match.

- object
  - `data` HelpDeskRoutingTestResult, required
    - `matched_index` integer, nullable, required: The position, in the list sent, of the first enabled rule the sample matches; null when none does.
  - `meta` ResponseMeta: Envelope metadata present on every successful response.
    - `api_version` string
    - `request_id` string
    - `response_ms` integer
    - `timestamp` integer: Unix seconds.
    - `pools` object: Storage and bandwidth capacity snapshot for the account.
    - `billing` object
      - `past_due` boolean
    - `quota` object: This minute of the account request budget. Present on authenticated success responses that passed the throttle; absent otherwise.
      - `limit` integer
      - `used` integer
      - `remaining` integer
      - `resets_at` integer: Unix seconds.

## Other responses

- `400`: VALIDATION_ERROR — a rule is malformed (`details.rule` is its position), or `sample` has no `requester_email`.
- `401`: AUTHENTICATION_ERROR — missing or invalid credentials.
- `403`: FORBIDDEN — the credential is an API key or an impersonated session: the help desk is worked from a member's own session. HELP_DESK_SUBSCRIPTION_REQUIRED — a change that needs the help desk, on an organization that does not hold it.

## Changes

- **2026-10-28** `a9a10e328ba5`: 12 info
  - the response property `error/details` became required for the status `400`
  - the response property `error/details` became required for the status `401`
  - the response property `error/details` became required for the status `403`
  - the response property `meta` became required for the status `400`
  - …8 more
- **2026-10-28** `56d7c265a77a`: 3 breaking
  - the response property `error/details` became nullable for the status `400`
  - the response property `error/details` became nullable for the status `401`
  - the response property `error/details` became nullable for the status `403`
- **2026-10-22** `f5ac9c809ef7`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/sparkvault/apis/sparkvault-api/changes/products/help-desk/routing-rules/test/post.md)

---

[API](https://skmtc.dev/sparkvault/apis/sparkvault-api.md) - [All operations](https://skmtc.dev/sparkvault/apis/sparkvault-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sparkvault/apis/sparkvault-api/revisions/97cfadccd0c0?raw)
