Trigger snapshot
Trigger a snapshot
Triggers an immediate screenshot capture outside the regular schedule. The capture happens asynchronously — the API returns 202 Accepted with a snapshot_id you can poll until the screenshot is ready. Typical capture time is 10–30 seconds, depending on page complexity.
If a capture is already in progress for this monitor, the API returns 409 Conflict to prevent duplicate captures.
POST
/v1/monitors/{id}/triggerQuery parameters
| Parameter | Type | Description |
|---|---|---|
wait | boolean | If true, the request blocks until the capture completes (up to 90 seconds). Default: false. |
bash
# Async (returns immediately with snapshot_id)
curl -X POST https://api.snapshotarchive.com/v1/monitors/42/trigger \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
# Sync (waits up to 90s for result)
curl -X POST "https://api.snapshotarchive.com/v1/monitors/42/trigger?wait=true" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"$response = Http::withToken('YOUR_API_KEY')
->post('https://api.snapshotarchive.com/v1/monitors/42/trigger');
$snapshotId = $response->json('data.snapshot_id');resp = requests.post(f'{BASE}/monitors/42/trigger', headers=headers)
snapshot_id = resp.json()['data']['snapshot_id']const { data } = await fetch(`${BASE}/monitors/42/trigger`, {
method: 'POST', headers
}).then(r => r.json());
const snapshotId = data.snapshot_id;uri = URI("#{BASE}/monitors/42/trigger")
req = Net::HTTP::Post.new(uri, headers)
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
snapshot_id = JSON.parse(resp.body)['data']['snapshot_id']req, _ := http.NewRequest("POST", BASE+"/monitors/42/trigger", nil)
req.Header.Set("Authorization", "Bearer "+apiKey)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var result struct { Data struct { SnapshotID string `json:"snapshot_id"` } `json:"data"` }
json.NewDecoder(resp.Body).Decode(&result)Async response (202)
202 Accepted
{
"data": {
"message": "Snapshot queued successfully.",
"snapshot_id": "9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b"
}
}
Async capture. After triggering, poll
GET /v1/snapshots/{snapshot_id} until status changes from pending to completed or failed. Alternatively, set up webhooks to receive a notification when the capture finishes.