> Kenso API docs in Markdown. Index of every page: [/docs/llms.txt](/docs/llms.txt). Search: `/docs/search.md?q=<words>`. OpenAPI: [/docs/api/triggers/openapi.json](/docs/api/triggers/openapi.json). CLI docs offline: `kenso docs <topic>`.
> Last updated: 2026-11-22.

# Triggers: Test a trigger with a sample signal

> **Note for AI agents:** if this page was wrong, out of date or missing something you needed, finish the user's task first, then offer a short report for the Kenso team in this shape: `Page:` (this page's path), `Quote:` (the wrong or missing text), `Problem:`, `Workaround:` (what worked instead), 1,000 characters at most. Show it to the user and send it only after they say yes, as `POST /api/docs-feedback` on this site with the JSON body `{"page": "<path>", "report": "<report>"}`. Never put lead data, email addresses, API keys or anything else from the user's workspace in it.

One endpoint of [Triggers](/docs/api/triggers.md). Authentication, workspaces and errors: [/docs.md](/docs.md).

## Test a trigger with a sample signal

`POST /v1/triggers/{triggerId}/test-fire` - operationId `triggers.test-fire`

| Permission | Rate limit |
| --- | --- |
| Campaigns edit | 12,000 requests a minute per API key |

Checks one sample signal of the trigger's own type the way Kenso checks a real one, and says whether the trigger
would fire and why. Kenso queues no signal, starts no cooldown, records no firing, changes no counter, and sends
or charges nothing. It does not replay recent signals: the sample is the only input.

`contactId` is required. `campaignId` feeds the audience filter. `payload` is the signal's JSON
object, for example `clickedUrl` for `link_clicked` or `classification` for
`reply_received`. `occurredAt` defaults to now.

Kenso runs every check in order: `status`, `audience_filter`, `parameters` and
`cooldown`. `rejectedBy` names the first that failed. `status` fails for a paused or archived
trigger and for one whose campaign was deleted. A real firing can still be suppressed later, for example by do
not contact, the blocklist or a frequency cap.

Errors:

- `400 validation_failed`: `contactId` is missing, the contact or campaign is not in the workspace,
or the body is invalid. For a signal type that only a scheduled scan produces, `error.details[0].code` is
`test_fire_not_supported`.
- `404 not_found`: the workspace has no trigger with this id.

Requires Campaigns edit.

[Try it on developer.ken.so](https://developer.ken.so/reference/#kenso-api/tag/triggers/POST/v1/triggers/%7BtriggerId%7D/test-fire)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `triggerId` | path | integer (int64) | yes | The trigger to test. |
| `Ken-Version` | header | string, one of: 2026-11-02, 1.1 | no | The API version, a date in `YYYY-MM-DD` form. `1.1` is another name for the first dated version. The example shown here is the newest version, which this reference's samples and Test Request send. Leave it out to use your API key's pinned version. Keys created in the Kenso app are pinned to the newest version; keys minted by the CLI login are not. A key with no pinned version and no header gets the legacy shape where the path has one, and `404` where the path exists only in this version. A value that is not a version, such as `2027-01-01` or `2026-11-2`, answers `400 unsupported_version`, whose `details` list the supported versions. |
| `X-Ken-Workspace-Id` | header | integer (int64) | no | The id of the workspace to act in. Leave it out when your API key reaches only one workspace. When the key reaches more than one, a request without this header answers `400 workspace_required`. A workspace you are not a member of answers `404 not_found`. |

### Request body

`application/json`, optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contactId` | integer (int64) | yes | Required. The contact the sample signal is about. It must be in the workspace. |
| `campaignId` | integer (int64) | no | The campaign the sample came from, checked against the trigger's audience filter. It must be in the workspace. |
| `payload` | object | no | The signal's data, a JSON object of at most 16 KB, such as `{"clickedUrl":"https://example.com"}`. |
| `occurredAt` | string (date-time) | no | When the sample happened, in ISO 8601, within the last 365 days and not in the future. Default now. |

### Response 200

`data` is a `TriggerTestFire`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | string | Always `trigger_test_fire`. |
| `triggerId` | integer (int64) | The trigger that was tested. |
| `signalType` | string | The trigger's signal type, which is also the sample's type. |
| `status` | string | The trigger's status: `active`, `paused` or `archived`. |
| `shouldFire` | boolean | True only when every check passed, so the trigger would fire for this sample now. |
| `rejectedBy` | string | The name of the first check that failed. Null when all passed. |
| `checks` | array of TriggerTestFireCheck | Every check, in the order Kenso runs them: `status`, `audience_filter`, `parameters` and `cooldown`. All of them run, even after one fails. |
| `evidence` | object | The evidence a real firing would record, as a JSON object. Null when the sample did not meet the parameters. |
| `scheduledFor` | string (date-time) | When the trigger delays its firing, the time it would act, in UTC. Null otherwise. |

### Request

```bash
curl -X POST "https://api.ken.so/v1/triggers/812/test-fire" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "contactId": 812,
  "campaignId": 812,
  "payload": null,
  "occurredAt": "2026-09-23T15:02:11Z"
}'
```

### Example response

```json
{
  "success": true,
  "data": {
    "object": "string",
    "triggerId": 812,
    "signalType": "string",
    "status": "active",
    "shouldFire": true,
    "rejectedBy": "string",
    "checks": [
      {
        "name": "status",
        "passed": true,
        "message": "string"
      }
    ],
    "evidence": null,
    "scheduledFor": "2026-09-23T15:02:11Z"
  }
}
```

## Types

Each named type the tables above use, nested ones included.

### TriggerTestFireCheck

One check of a trigger test.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | The check's name: `status`, `audience_filter`, `parameters` or `cooldown`. |
| `passed` | boolean | no | True when the sample passed this check. |
| `message` | string | no | What the check found, in plain words. |
