# POST /v1/sandbox/triggers Make a change happen in the sandbox now: a match, a favorite that changes, a removal. | Access | | | --- | --- | | Keys | secret only | | Plan | every plan | | Environment | sandbox only | | Acts for | one consumer | | While the account is suspended | refused | | During a data stop | works | ## Headers | Name | Description | | --- | --- | | `X-Client-Token` | With a publishable key: **required.** A token your server minted for the consumer with [`POST /v1/client-tokens`](create-client-token.md). | | `X-Client-Id` | With a secret key: **required.** Your own opaque ID for the consumer. | ## Body | Field | Type | Description | | --- | --- | --- | | `event` | `saved_search.matches`, `favorite.listing_updated`, `listing.removed` | | | `savedSearchId` | string | (optional) With saved_search.matches: one of this consumer's saved searches. | | `listingKey` | string | (optional) With favorite.listing_updated: one of this consumer's favorites. With listing.removed: a listing a trigger of your account made. | | `kind` | `price`, `status`, `photos`, `open_house` | (optional) With favorite.listing_updated: which change to make. | ```json { "event": "saved_search.matches", "savedSearchId": "ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R" } ``` ## Answers ### 202: Accepted: the change is made within seconds The answer is `{ data, meta }`; `meta` holds `requestId` and `environment`. `data` is a [SandboxTriggerAccepted](../objects.md#sandboxtriggeraccepted). ## Errors | Status | Codes | | --- | --- | | 400 | [`client_id_must_be_opaque`](../../errors/client_id_must_be_opaque.md), [`validation_failed`](../../errors/validation_failed.md) | | 401 | [`invalid_api_key`](../../errors/invalid_api_key.md), [`key_revoked`](../../errors/key_revoked.md), [`missing_api_key`](../../errors/missing_api_key.md) | | 403 | [`account_pending`](../../errors/account_pending.md), [`account_suspended`](../../errors/account_suspended.md), [`origin_not_allowed`](../../errors/origin_not_allowed.md), [`secret_key_in_browser`](../../errors/secret_key_in_browser.md), [`secret_key_required`](../../errors/secret_key_required.md) | | 404 | [`listing_not_found`](../../errors/listing_not_found.md), [`not_found`](../../errors/not_found.md) | | 409 | [`sandbox_listing_protected`](../../errors/sandbox_listing_protected.md), [`sandbox_trigger_not_possible`](../../errors/sandbox_trigger_not_possible.md), [`saved_search_not_active`](../../errors/saved_search_not_active.md) | | 429 | [`rate_limited`](../../errors/rate_limited.md) | | 500 | [`internal_error`](../../errors/internal_error.md), [`temporarily_unavailable`](../../errors/temporarily_unavailable.md) | Every error has the same body, and says how to fix it ([responses and errors](../../concepts/responses-and-errors.md)). ## More Send your `sk_test_` key and `X-Client-Id`, with one of three bodies: | `event` | Also send | What happens | | -------------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | | `saved_search.matches` | `savedSearchId`: one of this consumer's saved searches | A new made-up listing appears that matches the search. | | `favorite.listing_updated` | `listingKey`: one of this consumer's favorites; `kind`: `price`, `status`, `photos` or `open_house` | That change is made to that listing. | | `listing.removed` | `listingKey`: a listing that a trigger of your account made | The listing is removed, as a listing that leaves the market on live is. | The answer is `202`: ```json { "data": { "id": "trg_…", "event": "saved_search.matches", "listingKey": "SBXT…", "change": { "kind": "new_listing", "status": "active" }, "notice": "instant", "status": "pending" } } ``` - `listingKey` is the listing that is made or changed. Listings made by a trigger have keys that start `SBXT`. - `notice` is `instant` when the notice follows within about 10 seconds, or `next_digest` when the saved search's `alertFrequency` is `daily` or `weekly`: then the listing is made now and the notice comes with the search's next digest. - A `status` change follows a fixed order: Active, Active Under Contract, Pending, Closed. Coming Soon goes to Active. _This page is made from the route's own declaration by `npm run openapi`. To change it, change the declaration or its explanation, never this file._