{"uid":"cap_T-RT3N7s9KCGKaX5vF38A","slug":"agent-drift-api-register-golden-test-case-3e78f484","name":"Agent Drift API - Register Golden Test Case","description":"Register a golden test case that monitors an API endpoint for behavioral drift (compares live responses against expected output). Returns the created test as JSON.","url":"https://agent-drift-api-production.up.railway.app/v1/tests","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","bodyType","body","method"],"properties":{"body":{"type":"object","required":["name","endpoint_url","expected_output"],"properties":{"name":{"type":"string","description":"Human-readable test name"},"schedule":{"type":"string","description":"Cron expression for automated runs"},"match_mode":{"enum":["exact","json_subset","contains","status_code"],"type":"string","description":"Comparison mode (default contains)"},"description":{"type":"string"},"endpoint_url":{"type":"string","description":"URL to monitor"},"endpoint_body":{"type":"string","description":"Request body for POST/PUT"},"endpoint_method":{"enum":["GET","POST","PUT","DELETE"],"type":"string","description":"HTTP method (default GET)"},"expected_output":{"type":"string","description":"Golden output to compare against"},"endpoint_headers":{"type":"object","description":"Custom request headers"}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_NQY-b-bOlIW77JYUnfWB9","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Creates a golden test case that monitors an API endpoint for behavioral drift by comparing live responses against expected output on a schedule.","exampleAgentPrompt":"Set up a golden test case called 'User Profile GET' to monitor https://api.myapp.com/users/123 using a GET request, with the expected output '{\"id\":123,\"name\":\"Alice\"}', use contains match mode, and run it every hour with the cron '0 * * * *'.","exampleUseCases":[{"title":"Monitor production API for regressions","prompt":"Register a drift test called 'Product Listing Check' to monitor https://api.mystore.com/products with a GET request — the expected output should contain '{\"status\":\"ok\"}' and use contains match mode, run it every 30 minutes with '*/30 * * * *'."},{"title":"Detect breaking changes after deployment","prompt":"Create a golden test case called 'Auth Token Response' for https://api.myapp.com/auth using a POST request with body '{\"username\":\"testuser\",\"password\":\"testpass\"}', expecting the response to contain a 'token' field, match mode contains, and check it every day at midnight with '0 0 * * *'."},{"title":"Validate third-party API contract","prompt":"Set up a test called 'Weather API Contract' to watch https://api.weather.example.com/current?city=NYC with GET, compare the live response against the expected output '{\"temp\":72,\"unit\":\"F\"}' using json_subset match mode, and schedule it to run every 6 hours with '0 */6 * * *'."}],"resultDescription":"Returns a JSON object representing the newly created test case, including the assigned test ID, name, endpoint URL, expected output, match mode, schedule, HTTP method, and other configuration fields. This record can be used to reference, retrieve, or manage the test going forward.","failureModes":["Missing required fields (name, endpoint_url, or expected_output) returns a 400 validation error","Invalid cron expression for schedule field causes rejection","Unsupported match_mode value outside the allowed enum returns an error","Invalid endpoint_url format may cause creation failure or runtime monitoring errors","Authentication/payment failure due to x402 micropayment issues returns 402 Payment Required","Internal server error (500) if the Railway-hosted service is unavailable"],"whenToPreferThis":"Choose this endpoint when you need to register a new API endpoint for ongoing behavioral drift monitoring — specifically when you want to define a golden expected output and receive alerts or logs when the live response diverges. It is ideal for regression detection after deployments, third-party API contract validation, and scheduled golden-output comparison. Prefer this over generic uptime monitors when you care about the semantic content of responses, not just availability.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:34:38.611Z","isFirstParty":false}