{"openapi":"3.1.0","info":{"title":"Netsware API","version":"1.2.0","description":"The Netsware public API for business-hours checks, schedule/job automation, and monitoring. Designed to be driven by an AI agent or a monitoring/NOC system: hand a key to an agent and it can set up schedules, group jobs, manage variables, and report what is failing — without ever reading a secret value back. Doctrine: **webhooks push what happened (real-time), the API reads authoritative state (dashboards, history, reconciliation).** A missed webhook is reconciled via `/v1/runs` + `/v1/metrics`.","contact":{"name":"Netsware Support","url":"https://netsware.com/docs"}},"servers":[{"url":"https://app.netsware.com","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"tags":[{"name":"Business Hours","description":"Open/closed checks and holiday lookups."},{"name":"Schedules","description":"Business-hours schedule templates."},{"name":"Jobs","description":"Scheduled HTTP jobs (once / recurring / sequence)."},{"name":"Groups","description":"Folder-style organization for jobs."},{"name":"Variables","description":"Reusable values + secrets (secret values are write-only)."},{"name":"Runs & Metrics","description":"Run history, failure feed, and monitoring rollups."},{"name":"Webhooks","description":"Event subscriptions (the push path)."},{"name":"Usage","description":"Account usage counters."}],"paths":{"/v1/check":{"get":{"tags":["Business Hours"],"summary":"Check open/closed for ad-hoc hours","description":"Evaluate whether a set of business hours is open at a given instant. Read-only.\n\nAd-hoc check without saving anything: give hours, a country and a timezone; get open/closed, the reason and the next opening. For a saved schedule use GET /v1/schedules/{id}/check.\n\nReturns: {open, reason (open|before_hours|after_hours|weekend|public_holiday|closed|disabled), holiday_name (only on a holiday, e.g. \"Republic Day\"), checked_at, local_time, timezone, country, next_open {utc, local, day}}.\n\nExample: `GET /v1/check?timezone=Asia/Tokyo&country=JP&open_time=10:00&close_time=18:30`","responses":{"200":{"description":"Open/closed result."},"400":{"description":"Malformed query — see the `usage` block.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"hoursCheck","parameters":[{"name":"timezone","in":"query","required":true,"schema":{"type":"string"},"description":"IANA timezone, e.g. Asia/Tokyo."},{"name":"country","in":"query","required":true,"schema":{"type":"string"},"description":"ISO alpha-2 country for public holidays, e.g. JP."},{"name":"timestamp","in":"query","required":false,"schema":{"type":"string"},"description":"Instant to check, ISO 8601 with offset, e.g. 2026-11-10T23:00:00+05:30. Default: now."},{"name":"open_time","in":"query","required":false,"schema":{"type":"string"},"description":"Opening time HH:MM. Default: 09:00."},{"name":"close_time","in":"query","required":false,"schema":{"type":"string"},"description":"Closing time HH:MM. Earlier than open_time means overnight (22:00 to 06:00). Cannot equal open_time. Default: 18:00."},{"name":"days","in":"query","required":false,"schema":{"type":"string","enum":["MON","TUE","WED","THU","FRI","SAT","SUN"]},"description":"Comma-separated open days. Default: MON,TUE,WED,THU,FRI."},{"name":"region","in":"query","required":false,"schema":{"type":"string"},"description":"State/region code for regional holidays, e.g. CA. Any plan, for the countries your plan covers: Essentials its 10 countries, paid plans all countries."}]}},"/v1/holidays":{"get":{"tags":["Business Hours"],"summary":"List public holidays for a country/year","responses":{"200":{"description":"Holiday list."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"hoursHolidays","description":"Returns: {country, region, year, count, holidays: [{date, name, name_local, type, region}]}.\n\nExample: `GET /v1/holidays?country=JP&year=2026`","parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string"},"description":"ISO alpha-2 country, e.g. JP."},{"name":"year","in":"query","required":true,"schema":{"type":"string"},"description":"4-digit year, e.g. 2026."},{"name":"region","in":"query","required":false,"schema":{"type":"string"},"description":"State/region code for regional holidays. Any plan, for the countries your plan covers: Essentials its 10 countries, paid plans all countries."},{"name":"type","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by holiday type, e.g. public."}]}},"/v1/schedules":{"get":{"tags":["Schedules"],"summary":"List schedules","description":"Default view excludes deleted. Filter by status/country; paginated.\n\nReturns: {schedules: [...], page, limit, total, has_more, next_page}.\n\nExample: `GET /v1/schedules?status=active&limit=50`","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["active","disabled","deleted"]},"description":"Default: live (active + disabled).","required":false},{"name":"country","in":"query","schema":{"type":"string"},"description":"ISO alpha-2, e.g. IN (optional).","required":false},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1},"description":"Page number (server clamps to ≥1).","required":false},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100,"default":25},"description":"Page size (server clamps to ≤100).","required":false}],"responses":{"200":{"description":"Paged schedules.","content":{"application/json":{"schema":{"type":"object","properties":{"schedules":{"type":"array","items":{"$ref":"#/components/schemas/Schedule"}},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","maximum":100},"total":{"type":"integer"},"has_more":{"type":"boolean"},"next_page":{"type":"integer","nullable":true}}}}}},"400":{"description":"Malformed query — see the `usage` block.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"schedulesList"},"post":{"tags":["Schedules"],"summary":"Create a schedule","responses":{"201":{"description":"Created."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope for this action (a read-only key on a write), or a plan limit was hit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error."},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"schedulesCreate","description":"A schedule is a reusable \"when are we open\" definition: days, one open/close time, timezone and country holidays. Jobs can be tied to it so they only run while it is open.\n\nReturns: {id: \"sch_…\", name, timezone, region, is_active, created_at}. With timezones[]/regions[]: one per entry.\n\nExample: `POST /v1/schedules {\"name\":\"Tokyo office\",\"country_code\":\"JP\",\"timezone\":\"Asia/Tokyo\",\"days\":[\"MON\",\"TUE\",\"WED\",\"THU\",\"FRI\"],\"open_time\":\"10:00\",\"close_time\":\"18:30\",\"respect_holidays\":true}`","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"A name you will recognise, 1 to 100 characters."},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 country, e.g. JP, IN, US. Decides which public holidays apply."},"timezone":{"type":"string","description":"IANA timezone the hours are in, e.g. Asia/Tokyo. Required unless timezones[] or regions[] is given."},"timezones":{"type":"array","description":"Create one schedule per timezone in one call (max 32). Create only.","items":{"type":"string"}},"regions":{"type":"array","description":"State mode: one schedule per state/region with its own holidays and timezone (max 32). Any plan, for the countries your plan covers: Essentials its 10 countries, paid plans all countries. Cannot be combined with timezones[] or region. Create only.","items":{"type":"object","description":"object {code, timezone?}"}},"region":{"type":"string","description":"State/region code for regional holidays, e.g. CA. Any plan, for the countries your plan covers: Essentials its 10 countries, paid plans all countries. List codes with GET /v1/hours/meta/regions."},"days":{"type":"array","description":"Open days, e.g. [\"MON\",\"TUE\",\"WED\",\"THU\",\"FRI\"]. An empty list makes an always-closed schedule.","items":{"type":"string","enum":["MON","TUE","WED","THU","FRI","SAT","SUN"]}},"open_time":{"type":"string","description":"Opening time, 24-hour HH:MM, e.g. 09:00."},"close_time":{"type":"string","description":"Closing time, HH:MM. Earlier than open_time means overnight (22:00 to 06:00). Cannot equal open_time."},"respect_holidays":{"type":"boolean","description":"Treat public holidays of country_code (and region) as closed. Default: true."}},"required":["name","country_code","days","open_time","close_time"]}}}}}},"/v1/schedules/stats":{"get":{"tags":["Schedules"],"summary":"Schedule state counts","description":"Cheap counts: active / disabled / deleted (total excludes deleted).\n\nReturns: {schedules: {total, active, disabled, deleted}}.\n\nExample: `GET /v1/schedules/stats`","responses":{"200":{"description":"Counts."},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"schedulesStats"}},"/v1/schedules/{id}":{"get":{"tags":["Schedules"],"summary":"Get a schedule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Schedule id, e.g. sch_16f3561f-… (the sch_ prefix is optional)."}],"responses":{"200":{"description":"Schedule."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"schedulesGet","description":"Returns: {id, name, timezone, country_code, region, respect_holidays, is_active, days, open_time, close_time, created_at, updated_at, deleted_at}.\n\nExample: `GET /v1/schedules/sch_16f3561f-5788-4478-8ca5-c78ca6066606`"},"put":{"tags":["Schedules"],"summary":"Update a schedule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Schedule id, e.g. sch_16f3561f-… (the sch_ prefix is optional)."}],"responses":{"200":{"description":"Updated."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"schedulesUpdate","description":"Full replace: send the same fields as create with a single timezone (timezones[]/regions[] are create-only).\n\nReturns: The updated schedule.\n\nExample: `PUT /v1/schedules/sch_16f3… {\"name\":\"Tokyo office\",\"country_code\":\"JP\",\"timezone\":\"Asia/Tokyo\",\"days\":[\"MON\",\"TUE\",\"WED\",\"THU\",\"FRI\"],\"open_time\":\"09:00\",\"close_time\":\"18:00\"}`","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"A name you will recognise, 1 to 100 characters."},"country_code":{"type":"string","description":"ISO 3166-1 alpha-2 country, e.g. JP, IN, US. Decides which public holidays apply."},"timezone":{"type":"string","description":"IANA timezone the hours are in, e.g. Asia/Tokyo."},"region":{"type":"string","description":"State/region code for regional holidays, e.g. CA. Any plan, for the countries your plan covers: Essentials its 10 countries, paid plans all countries. List codes with GET /v1/hours/meta/regions."},"days":{"type":"array","description":"Open days, e.g. [\"MON\",\"TUE\",\"WED\",\"THU\",\"FRI\"]. An empty list makes an always-closed schedule.","items":{"type":"string","enum":["MON","TUE","WED","THU","FRI","SAT","SUN"]}},"open_time":{"type":"string","description":"Opening time, 24-hour HH:MM, e.g. 09:00."},"close_time":{"type":"string","description":"Closing time, HH:MM. Earlier than open_time means overnight (22:00 to 06:00). Cannot equal open_time."},"respect_holidays":{"type":"boolean","description":"Treat public holidays of country_code (and region) as closed. Default: true."}},"required":["name","country_code","timezone","days","open_time","close_time"]}}}}},"delete":{"tags":["Schedules"],"summary":"Delete a schedule (soft by default; ?permanent=true to hard-delete)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Schedule id, e.g. sch_16f3561f-… (the sch_ prefix is optional)."},{"name":"permanent","in":"query","required":false,"schema":{"type":"boolean"},"description":"true = delete for good (cannot be undone). Default: false."}],"responses":{"200":{"description":"Deleted."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Still referenced by a live job."},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"schedulesDelete","description":"Returns: {deleted: true, permanent, id}.\n\nExample: `DELETE /v1/schedules/sch_16f3…`"}},"/v1/schedules/{id}/active":{"put":{"tags":["Schedules"],"summary":"Enable/disable a schedule","description":"Fires the `schedule.activated` / `schedule.deactivated` webhook on a real transition.\n\nReturns: The schedule with its new is_active.\n\nExample: `PUT /v1/schedules/sch_16f3…/active {\"is_active\":false}`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Schedule id, e.g. sch_16f3561f-… (the sch_ prefix is optional)."}],"responses":{"200":{"description":"Updated."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope for this action (a read-only key on a write), or a plan limit was hit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"schedulesActive","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"is_active":{"type":"boolean","description":"true = on, false = off."}},"required":["is_active"]}}}}}},"/v1/jobs":{"get":{"tags":["Jobs"],"summary":"List jobs","description":"Default view is live jobs (excludes deleted/cancelled). Friendly `status` maps to real states.\n\nReturns: {jobs: [...], page, limit, total, has_more, next_page}.\n\nExample: `GET /v1/jobs?status=active&limit=50`","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["active","disabled","deleted"]},"description":"active = scheduled+running, disabled = paused, deleted = cancelled.","required":false},{"name":"type","in":"query","schema":{"type":"string","enum":["once","recurring","sequence"]},"required":false,"description":"Filter by job type."},{"name":"group","in":"query","schema":{"type":"string"},"required":false,"description":"Filter by group id (grp_…) or none for ungrouped."},{"name":"search","in":"query","schema":{"type":"string"},"required":false,"description":"Match on name or url."},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1},"description":"Page number (server clamps to ≥1).","required":false},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100,"default":25},"description":"Page size (server clamps to ≤100).","required":false}],"responses":{"200":{"description":"Paged jobs.","content":{"application/json":{"schema":{"type":"object","properties":{"jobs":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","maximum":100},"total":{"type":"integer"},"has_more":{"type":"boolean"},"next_page":{"type":"integer","nullable":true}}}}}},"400":{"description":"Malformed query — see the `usage` block.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"jobsList"},"post":{"tags":["Jobs"],"summary":"Create a job","responses":{"201":{"description":"Created."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope for this action (a read-only key on a write), or a plan limit was hit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error."},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"jobsCreate","description":"A job calls your url at the right time. Tie it to a schedule (business_hours_schedule_id) and runs that fall outside business hours or on holidays are held back (deferred) until the next opening.\n\nReturns: The job: {id: \"job_…\", status, next_run_at (UTC), next_run_at_local, …}. With timezones[]: {jobs: [...]}.\n\nExample: `POST /v1/jobs {\"type\":\"recurring\",\"name\":\"Send email batch\",\"url\":\"https://example.com/send\",\"method\":\"POST\",\"timezone\":\"Asia/Tokyo\",\"cron\":\"*/15 * * * *\",\"business_hours_schedule_id\":\"sch_16f3…\"}`","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"once = one run at run_at; recurring = repeats on cron; sequence = a series of steps with delays. Cannot be changed later.","enum":["once","recurring","sequence"]},"name":{"type":"string","description":"A name you will recognise, up to 200 characters."},"url":{"type":"string","description":"The URL Netsware calls when the job runs (your \"send\" endpoint). Use https. Private/internal addresses are refused. Required unless type=sequence."},"method":{"type":"string","description":"HTTP method used to call url. Default: POST.","enum":["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},"timezone":{"type":"string","description":"IANA timezone that run_at and cron are read in, e.g. Asia/Tokyo. Required unless timezones[] is given."},"timezones":{"type":"array","description":"Create one job per timezone in one call (max 32).","items":{"type":"string"}},"run_at":{"type":"string","description":"When a once job runs, local date-time in timezone, e.g. 2026-12-01T09:00:00. Required when type=once."},"cron":{"type":"string","description":"Standard 5-field cron in timezone, e.g. \"*/15 * * * *\" (every 15 min) or \"0 10 * * MON-FRI\". Required when type=recurring."},"steps":{"type":"array","description":"Sequence steps: delay (integer ≥ 0) + delay_unit (minutes|hours|days) + url (+ optional payload). Cannot be changed later. Required when type=sequence.","items":{"type":"object","description":"object {delay, delay_unit, url, payload?}"}},"payload":{"type":"object","description":"JSON body sent to url. May contain {{VARIABLE}} references."},"headers":{"type":"object","description":"Extra HTTP headers sent to url, e.g. {\"Authorization\":\"Bearer {{SEND_TOKEN}}\"}."},"business_hours_schedule_id":{"type":"string","description":"Only run while this schedule is open (sch_…). A run due while closed is deferred to the next opening."},"business_hours_schedule_ids":{"type":"array","description":"Several schedules (sch_…); combine them with business_hours_match.","items":{"type":"string"}},"business_hours_match":{"type":"string","description":"any = run when at least one schedule is open; all = only when every schedule is open. Default: any.","enum":["any","all"]},"retry":{"type":"object","description":"Retry policy for one-time jobs and sequence steps. A recurring job is not retried within a run: a failed run sends its failure alert and the job runs again at its next scheduled time (the value is accepted but not used). Shape: {attempts 0-10, backoff exponential|fixed, base_seconds 60-1800, max_seconds 300-7200}. Plan limits apply: Essentials 1 attempt, more on Standard and up; exponential backoff needs Pro or Max. Defaults depend on the plan."},"timeout_seconds":{"type":"integer","description":"Seconds to wait for url to answer, 1 to 300. Default: 30."},"success_codes":{"type":"array","description":"HTTP status codes that count as success. Default: [200,201,202,204].","items":{"type":"integer"}},"success_match":{"type":"string","description":"Text (or regex) the response body must match to count as success, up to 500 characters."},"success_match_mode":{"type":"string","description":"How success_match is applied.","enum":["contains","not_contains","regex"]},"timing_mode":{"type":"string","description":"jitter spreads recurring runs randomly by up to jitter_seconds. Default: exact.","enum":["exact","jitter"]},"jitter_seconds":{"type":"integer","description":"Random spread in seconds, 1 to 3600. Required when timing_mode=jitter."},"group_id":{"type":"string","description":"Put the job in a group (grp_…)."},"notify_channel_ids":{"type":"array","description":"Notification channels (Email, Slack, Telegram, Discord, Google Chat, Microsoft Teams, webhook; created in the dashboard) to alert when the job fails.","items":{"type":"string"}},"notify_channel_id":{"type":"string","description":"Single-channel form of notify_channel_ids."}},"required":["type"]}}}}}},"/v1/jobs/stats":{"get":{"tags":["Jobs"],"summary":"Job + run rollups","description":"Job state counts (active/disabled/deleted) and lifetime run counts (success/failed/deferred).\n\nReturns: {total_jobs, total_runs, successful_runs, failed_runs, deferred_runs, success_rate, jobs {...}, runs {...}}.\n\nExample: `GET /v1/jobs/stats`","responses":{"200":{"description":"Stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStats"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"jobsStats"}},"/v1/jobs/{id}":{"get":{"tags":["Jobs"],"summary":"Get a job","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Job id, e.g. job_a1f1fec8-…."}],"responses":{"200":{"description":"Job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"jobsGet","description":"Returns: The full job including next_run_at, last_run_at and run counters.\n\nExample: `GET /v1/jobs/job_a1f1…`"},"put":{"tags":["Jobs"],"summary":"Update a job","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Job id, e.g. job_a1f1fec8-…."}],"responses":{"200":{"description":"Updated."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"jobsUpdate","description":"Partial update. type and sequence steps cannot be changed. Send null to clear a nullable field (e.g. business_hours_schedule_id).\n\nReturns: The updated job.\n\nExample: `PUT /v1/jobs/job_a1f1… {\"cron\":\"0 10 * * MON-FRI\"}`","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"A name you will recognise, up to 200 characters."},"url":{"type":"string","description":"The URL Netsware calls when the job runs (your \"send\" endpoint). Use https. Private/internal addresses are refused."},"method":{"type":"string","description":"HTTP method used to call url.","enum":["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},"timezone":{"type":"string","description":"IANA timezone that run_at and cron are read in, e.g. Asia/Tokyo."},"run_at":{"type":"string","description":"When a once job runs, local date-time in timezone, e.g. 2026-12-01T09:00:00."},"cron":{"type":"string","description":"Standard 5-field cron in timezone, e.g. \"*/15 * * * *\" (every 15 min) or \"0 10 * * MON-FRI\"."},"payload":{"type":"object","description":"JSON body sent to url. May contain {{VARIABLE}} references."},"headers":{"type":"object","description":"Extra HTTP headers sent to url, e.g. {\"Authorization\":\"Bearer {{SEND_TOKEN}}\"}."},"business_hours_schedule_id":{"type":"string","description":"Only run while this schedule is open (sch_…). A run due while closed is deferred to the next opening."},"business_hours_schedule_ids":{"type":"array","description":"Several schedules (sch_…); combine them with business_hours_match.","items":{"type":"string"}},"business_hours_match":{"type":"string","description":"any = run when at least one schedule is open; all = only when every schedule is open.","enum":["any","all"]},"retry":{"type":"object","description":"Retry policy for one-time jobs and sequence steps. A recurring job is not retried within a run: a failed run sends its failure alert and the job runs again at its next scheduled time (the value is accepted but not used). Shape: {attempts 0-10, backoff exponential|fixed, base_seconds 60-1800, max_seconds 300-7200}. Plan limits apply: Essentials 1 attempt, more on Standard and up; exponential backoff needs Pro or Max. Defaults depend on the plan."},"timeout_seconds":{"type":"integer","description":"Seconds to wait for url to answer, 1 to 300."},"success_codes":{"type":"array","description":"HTTP status codes that count as success.","items":{"type":"integer"}},"success_match":{"type":"string","description":"Text (or regex) the response body must match to count as success, up to 500 characters."},"success_match_mode":{"type":"string","description":"How success_match is applied.","enum":["contains","not_contains","regex"]},"timing_mode":{"type":"string","description":"jitter spreads recurring runs randomly by up to jitter_seconds.","enum":["exact","jitter"]},"jitter_seconds":{"type":"integer","description":"Random spread in seconds, 1 to 3600. Required when timing_mode=jitter."},"group_id":{"type":"string","description":"Put the job in a group (grp_…)."},"notify_channel_ids":{"type":"array","description":"Notification channels (Email, Slack, Telegram, Discord, Google Chat, Microsoft Teams, webhook; created in the dashboard) to alert when the job fails.","items":{"type":"string"}},"notify_channel_id":{"type":"string","description":"Single-channel form of notify_channel_ids."}},"required":[]}}}}},"delete":{"tags":["Jobs"],"summary":"Cancel a job","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Job id, e.g. job_a1f1fec8-…."}],"responses":{"200":{"description":"Cancelled."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"jobsDelete","description":"Returns: The job with status \"cancelled\".\n\nExample: `DELETE /v1/jobs/job_a1f1…`"}},"/v1/jobs/{id}/pause":{"put":{"tags":["Jobs"],"summary":"Pause a job","description":"Fires `job.paused`.\n\nReturns: The job with status \"paused\".\n\nExample: `PUT /v1/jobs/job_a1f1…/pause`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Job id, e.g. job_a1f1fec8-…."}],"responses":{"200":{"description":"Paused."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"jobsPause"}},"/v1/jobs/{id}/resume":{"put":{"tags":["Jobs"],"summary":"Resume a job","description":"Fires `job.resumed`.\n\nReturns: The job with status \"scheduled\".\n\nExample: `PUT /v1/jobs/job_a1f1…/resume`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Job id, e.g. job_a1f1fec8-…."}],"responses":{"200":{"description":"Resumed."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"jobsResume"}},"/v1/jobs/{id}/logs":{"get":{"tags":["Jobs"],"summary":"Per-job run history","description":"One job's runs incl. retry details (attempt_number / max_attempts), newest first. Window is clamped to your plan retention (7/30/60/90 days). Optional outcome filter.\n\nReturns: {logs: [{run_id, attempt, attempt_number, max_attempts, status, http_status, error_message, duration_ms, executed_at}], pagination {page, limit, total, total_pages, has_next, has_prev}}. History is kept 7/30/60/90 days by plan.\n\nExample: `GET /v1/jobs/job_a1f1…/logs?status=failed&limit=50`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Job id, e.g. job_a1f1fec8-…."},{"name":"status","in":"query","schema":{"type":"string","enum":["success","failed","timeout"]},"description":"Optional outcome filter.","required":false},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1},"description":"Page number (server clamps to ≥1).","required":false},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100,"default":25},"description":"Page size (server clamps to ≤100).","required":false}],"responses":{"200":{"description":"Run history.","content":{"application/json":{"schema":{"type":"object","properties":{"logs":{"type":"array","items":{"$ref":"#/components/schemas/RunLog"}},"pagination":{"type":"object"}}}}}},"400":{"description":"Malformed query — see the `usage` block.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageError"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"jobsLogs"}},"/v1/jobs/{id}/runs/{run_id}":{"get":{"tags":["Jobs"],"summary":"One run's correlated trace","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Job id, e.g. job_a1f1fec8-…."},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Run UUID from the logs."}],"responses":{"200":{"description":"Run trace."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"jobsRun","description":"Returns: The run and each of its attempts (status, http_status, error, timing). 404 if the run is older than your plan history.\n\nExample: `GET /v1/jobs/job_a1f1…/runs/6f1c2c1e-…`"}},"/v1/runs":{"get":{"tags":["Runs & Metrics"],"summary":"Account-wide failed/deferred feed","description":"The \"what is broken everywhere?\" reconciliation feed. `status` is required (no success feed — use per-job logs for that). No total is returned (cursor pagination).\n\nReturns: {data: [{run_id, job_id, job_name, status, http_status, error, occurred_at}], pagination {page, limit, has_next, has_prev, next_page}}.\n\nExample: `GET /v1/runs?status=failed&since=24h&limit=50`","parameters":[{"name":"status","in":"query","required":true,"schema":{"type":"string","enum":["failed","deferred"]},"description":"failed = runs that failed; deferred = runs held back outside business hours."},{"name":"since","in":"query","schema":{"type":"string","enum":["24h","48h","7d"],"default":"24h"},"description":"Default 24h, hard max 7d.","required":false},{"name":"job","in":"query","schema":{"type":"string"},"description":"Narrow to one job id (optional).","required":false},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1},"description":"Page number (server clamps to ≥1).","required":false},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100,"default":25},"description":"Page size (server clamps to ≤100).","required":false}],"responses":{"200":{"description":"Run feed.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Run"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"has_next":{"type":"boolean"},"has_prev":{"type":"boolean"},"next_page":{"type":"integer","nullable":true}}}}}}}},"400":{"description":"Malformed query — see the `usage` block.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"runsFeed"}},"/v1/metrics":{"get":{"tags":["Runs & Metrics"],"summary":"Daily monitoring rollups","description":"A bounded daily series (≤90 points) for an external monitoring/NOC system to poll and reconcile against the webhook push path. Window is clamped to your plan retention.\n\nReturns: {window, from, to, totals {api_calls, job_executions, webhook_deliveries, runs {success, failed, timeout, deferred}}, series: [same per day], current {active_jobs, active_schedules}}.\n\nExample: `GET /v1/metrics?window=7d`","parameters":[{"name":"window","in":"query","schema":{"type":"string","enum":["24h","48h","7d","30d","60d","90d"],"default":"30d"},"required":false,"description":"Period, limited to your plan's history. Default: 30d."}],"responses":{"200":{"description":"Metrics rollup.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metrics"}}}},"400":{"description":"Malformed query — see the `usage` block.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"metricsGet"}},"/v1/groups":{"get":{"tags":["Groups"],"summary":"List groups","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1},"description":"Page number (server clamps to ≥1).","required":false},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100,"default":25},"description":"Page size (server clamps to ≤100).","required":false}],"responses":{"200":{"description":"Paged groups.","content":{"application/json":{"schema":{"type":"object","properties":{"groups":{"type":"array","items":{"$ref":"#/components/schemas/Group"}},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","maximum":100},"total":{"type":"integer"},"has_more":{"type":"boolean"},"next_page":{"type":"integer","nullable":true}}}}}},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"groupsList","description":"Returns: {groups: [{id, name, job_count, created_at}], page, limit, total, has_more}.\n\nExample: `GET /v1/groups`"},"post":{"tags":["Groups"],"summary":"Create a group","responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}}},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope for this action (a read-only key on a write), or a plan limit was hit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Plan group limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"groupsCreate","description":"Returns: {id: \"grp_…\", name, job_count, created_at}.\n\nExample: `POST /v1/groups {\"name\":\"Email\"}`","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Group name, 1 to 100 characters."}},"required":["name"]}}}}}},"/v1/groups/{id}":{"get":{"tags":["Groups"],"summary":"Get a group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Group id, e.g. grp_bbd7aca6-…."}],"responses":{"200":{"description":"Group."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"groupsGet","description":"Returns: {id, name, job_count, created_at}.\n\nExample: `GET /v1/groups/grp_bbd7…`"},"patch":{"tags":["Groups"],"summary":"Rename a group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Group id, e.g. grp_bbd7aca6-…."}],"responses":{"200":{"description":"Renamed."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"groupsRename","description":"Returns: The renamed group.\n\nExample: `PATCH /v1/groups/grp_bbd7… {\"name\":\"Newsletters\"}`","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New name, 1 to 100 characters."}},"required":["name"]}}}}},"delete":{"tags":["Groups"],"summary":"Delete a group (jobs are ungrouped, not deleted)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Group id, e.g. grp_bbd7aca6-…."}],"responses":{"200":{"description":"Deleted."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"groupsDelete","description":"Returns: {ok: true, id}.\n\nExample: `DELETE /v1/groups/grp_bbd7…`"}},"/v1/variables":{"get":{"tags":["Variables"],"summary":"List variables","description":"Secret variables are returned with `value: null` — secret values are WRITE-ONLY and never leave the platform.\n\nReturns: {variables: [{name, value (null when secret), is_secret, is_disabled, allowed_destinations, updated_at}]}.\n\nExample: `GET /v1/variables`","parameters":[{"name":"group_id","in":"query","schema":{"type":"string"},"description":"Scope to a group (optional).","required":false}],"responses":{"200":{"description":"Variables.","content":{"application/json":{"schema":{"type":"object","properties":{"variables":{"type":"array","items":{"$ref":"#/components/schemas/Variable"}}}}}}},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"variablesList"},"put":{"tags":["Variables"],"summary":"Create or update a variable (upsert by name)","description":"Set `is_secret: true` to seal the value at rest; the value can never be read back afterwards.\n\nUse it in a job as {{NAME}} inside url, headers or payload. Secrets are write-only: they can be used but never read back.\n\nReturns: {name, saved: true}.\n\nExample: `PUT /v1/variables {\"name\":\"SEND_TOKEN\",\"value\":\"…\",\"is_secret\":true,\"allowed_destinations\":[\"api.example.com\"]}`","responses":{"200":{"description":"Upserted."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope for this action (a read-only key on a write), or a plan limit was hit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Plan variable limit reached."},"422":{"description":"Validation error."},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"variablesUpsert","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"UPPER_SNAKE name starting with a letter, e.g. SEND_TOKEN."},"value":{"type":"string","description":"The value, up to 10,000 characters."},"is_secret":{"type":"boolean","description":"true = write-only, never shown again. Default: false."},"is_disabled":{"type":"boolean","description":"true = keep it but stop substituting it. Default: false."},"group_id":{"type":"string","description":"Scope the variable to a group (grp_…)."},"allowed_destinations":{"type":"array","description":"Hosts this value may be sent to, e.g. [\"api.example.com\", \".example.com\"] (max 50).","items":{"type":"string"}}},"required":["name","value"]}}}}}},"/v1/variables/{name}":{"delete":{"tags":["Variables"],"summary":"Delete a variable by name","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"Variable name, e.g. SEND_TOKEN."},{"name":"group_id","in":"query","schema":{"type":"string"},"required":false,"description":"The group it belongs to, if any."}],"responses":{"200":{"description":"Deleted."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found within your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"variablesDelete","description":"Returns: {ok: true}.\n\nExample: `DELETE /v1/variables/SEND_TOKEN`"}},"/v1/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhook registrations","responses":{"200":{"description":"Registrations."},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"webhooksList","description":"Returns: {webhooks: [{id, product, event, url, is_active, created_at, last_triggered_at}]}.\n\nExample: `GET /v1/webhooks`"},"post":{"tags":["Webhooks"],"summary":"Register a webhook endpoint (URL + secret) for an event","responses":{"201":{"description":"Created."},"400":{"description":"Validation error."},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope for this action (a read-only key on a write), or a plan limit was hit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"webhooksCreate","description":"Returns: {id: \"whk_…\", product, event, url, is_active, created_at, secret}. The secret is shown once.\n\nExample: `POST /v1/webhooks {\"product\":\"scheduled_jobs\",\"event\":\"job.failed\",\"url\":\"https://example.com/hook\"}`","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"product":{"type":"string","description":"Which product the event belongs to.","enum":["business_hours","scheduled_jobs"]},"event":{"type":"string","description":"The event to receive.","enum":["job.completed","job.failed","job.retry","job.recovered","job.scheduled","job.cancelled","job.paused","job.resumed","schedule.opened","schedule.closed","schedule.holiday","schedule.activated","schedule.deactivated"]},"url":{"type":"string","description":"Your https URL."}},"required":["product","event","url"]}}}}}},"/v1/usage":{"get":{"tags":["Usage"],"summary":"Account usage counters","responses":{"200":{"description":"Usage."},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"usageGet","description":"Returns: {plan, limit, current_month {total_calls, …}, executions {used, limit}, webhook_executions {used, limit}}.\n\nExample: `GET /v1/usage`"}},"/v1/hours/meta/countries":{"get":{"tags":["Business Hours"],"summary":"Supported countries with their timezones and weekends","responses":{"200":{"description":"{countries: [{code, name, timezones, weekend?}]}. weekend uses 0=Sunday … 6=Saturday."},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"hoursCountries","description":"Returns: {countries: [{code, name, timezones, weekend?}]}. weekend uses 0=Sunday … 6=Saturday.\n\nExample: `GET /v1/hours/meta/countries`"}},"/v1/hours/meta/regions":{"get":{"tags":["Business Hours"],"summary":"States/regions of a country (for region and regions[])","responses":{"200":{"description":"{country, regions: {CODE: name}, region_timezones: {CODE: timezone}}."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"hoursRegions","description":"Returns: {country, regions: {CODE: name}, region_timezones: {CODE: timezone}}.\n\nExample: `GET /v1/hours/meta/regions?country=US`","parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string"},"description":"ISO alpha-2 country, e.g. US."}]}},"/v1/schedules/resolve":{"get":{"tags":["Schedules"],"summary":"Combine several schedules: is any / are all open now?","responses":{"200":{"description":"{open, match, reason, next_transition {utc, local, day}, next_transition_to, contributing: [{id, name, open, reason}]}."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"schedulesResolve","description":"Returns: {open, match, reason, next_transition {utc, local, day}, next_transition_to, contributing: [{id, name, open, reason}]}.\n\nExample: `GET /v1/schedules/resolve?schedule_ids=sch_a,sch_b&match=all`","parameters":[{"name":"schedule_ids","in":"query","required":true,"schema":{"type":"string"},"description":"Comma-separated schedule ids, e.g. sch_a,sch_b."},{"name":"match","in":"query","required":false,"schema":{"type":"string","enum":["any","all"]},"description":"any = open if one is open; all = open only if all are open. Default: any."}]}},"/v1/schedules/{id}/check":{"get":{"tags":["Schedules"],"summary":"Is this saved schedule open right now?","responses":{"200":{"description":"{open, reason, local_time, next_open {utc, local, day}, schedule_id}."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"schedulesCheck","description":"Returns: {open, reason, local_time, next_open {utc, local, day}, schedule_id}.\n\nExample: `GET /v1/schedules/sch_16f3…/check`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Schedule id, e.g. sch_16f3561f-… (the sch_ prefix is optional)."}]}},"/v1/jobs/{id}/trigger":{"post":{"tags":["Jobs"],"summary":"Run a job now (manual test run)","responses":{"200":{"description":"{id, run_id, triggered: true, success, http_status, duration_ms, error}."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"jobsTrigger","description":"Runs once immediately and returns the result. Not available for sequence jobs (use retry). Uses one execution from the plan (shown as \"test\" in GET /v1/usage).\n\nReturns: {id, run_id, triggered: true, success, http_status, duration_ms, error}.\n\nExample: `POST /v1/jobs/job_a1f1…/trigger`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Job id, e.g. job_a1f1fec8-…."}]}},"/v1/jobs/{id}/retry":{"post":{"tags":["Jobs"],"summary":"Retry a failed job or sequence","responses":{"200":{"description":"The job, queued to run again. Only a failed job can be retried (otherwise error invalid_state)."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"jobsRetry","description":"Returns: The job, queued to run again. Only a failed job can be retried (otherwise error invalid_state).\n\nExample: `POST /v1/jobs/job_a1f1…/retry`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Job id, e.g. job_a1f1fec8-…."}]}},"/v1/webhooks/endpoints":{"post":{"tags":["Webhooks"],"summary":"Register one URL for many events (recommended)","responses":{"201":{"description":"{endpoint_id: \"wep_…\", url, events, secret: \"whsec_…\"}. The secret is shown ONCE: store it to verify X-Netsware-Signature."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"webhooksEndpointsCreate","description":"Returns: {endpoint_id: \"wep_…\", url, events, secret: \"whsec_…\"}. The secret is shown ONCE: store it to verify X-Netsware-Signature.\n\nExample: `POST /v1/webhooks/endpoints {\"url\":\"https://example.com/hook\",\"events\":[{\"product\":\"scheduled_jobs\",\"event\":\"job.failed\"}]}`","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Your https URL that receives the events."},"events":{"type":"array","description":"1 to 20 of {product: business_hours|scheduled_jobs, event: job.completed|job.failed|job.retry|job.recovered|job.scheduled|job.cancelled|job.paused|job.resumed|schedule.opened|schedule.closed|schedule.holiday|schedule.activated|schedule.deactivated}.","items":{"type":"object","description":"object {product, event}"}}},"required":["url","events"]}}}}},"get":{"tags":["Webhooks"],"summary":"List webhook endpoints","responses":{"200":{"description":"{endpoints: [{endpoint_id, url, is_active, events, created_at, last_triggered_at}]}."},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"webhooksEndpointsList","description":"Returns: {endpoints: [{endpoint_id, url, is_active, events, created_at, last_triggered_at}]}.\n\nExample: `GET /v1/webhooks/endpoints`"}},"/v1/webhooks/endpoints/{id}":{"patch":{"tags":["Webhooks"],"summary":"Change an endpoint (URL, events, on/off); the secret is kept","responses":{"200":{"description":"{ok: true}."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"webhooksEndpointsUpdate","description":"Returns: {ok: true}.\n\nExample: `PATCH /v1/webhooks/endpoints/wep_6d05… {\"is_active\":false}`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Webhook endpoint id, e.g. wep_6d0566c2-…."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"New https URL."},"is_active":{"type":"boolean","description":"false = stop sending."},"events":{"type":"array","description":"Replacement list of 1 to 20 events.","items":{"type":"object","description":"object {product, event}"}}},"required":[]}}}}},"delete":{"tags":["Webhooks"],"summary":"Delete an endpoint","responses":{"200":{"description":"{deleted: true}."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"webhooksEndpointsDelete","description":"Returns: {deleted: true}.\n\nExample: `DELETE /v1/webhooks/endpoints/wep_6d05…`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Webhook endpoint id, e.g. wep_6d0566c2-…."}]}},"/v1/webhooks/endpoints/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a signed test event to an endpoint","responses":{"200":{"description":"{sent, delivered}: whether the signed webhook.test event was sent and accepted (2xx) by your URL."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"webhooksEndpointsTest","description":"Returns: {sent, delivered}: whether the signed webhook.test event was sent and accepted (2xx) by your URL.\n\nExample: `POST /v1/webhooks/endpoints/wep_6d05…/test`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Webhook endpoint id, e.g. wep_6d0566c2-…."}]}},"/v1/webhooks/endpoints/{id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Recent deliveries to an endpoint","responses":{"200":{"description":"{deliveries: [...]}: the latest deliveries (up to 50) with event, status code, attempt and time."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"webhooksEndpointsDeliveries","description":"Returns: {deliveries: [...]}: the latest deliveries (up to 50) with event, status code, attempt and time.\n\nExample: `GET /v1/webhooks/endpoints/wep_6d05…/deliveries`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Webhook endpoint id, e.g. wep_6d0566c2-…."}]}},"/v1/webhooks/{id}":{"delete":{"tags":["Webhooks"],"summary":"Delete a single-event webhook","responses":{"200":{"description":"{deleted: true, id}."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"webhooksDelete","description":"Returns: {deleted: true, id}.\n\nExample: `DELETE /v1/webhooks/whk_…`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Single-event webhook id, e.g. whk_…."}]}},"/v1/webhooks/{id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Recent deliveries of a single-event webhook","responses":{"200":{"description":"{deliveries: [...]}: the latest deliveries (up to 50) with event, status code, attempt and time."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"webhooksDeliveries","description":"Returns: {deliveries: [...]}: the latest deliveries (up to 50) with event, status code, attempt and time.\n\nExample: `GET /v1/webhooks/whk_…/deliveries`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Single-event webhook id, e.g. whk_…."}]}},"/v1/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a signed test event to a single-event webhook","responses":{"200":{"description":"{sent, delivered}: whether the signed webhook.test event was sent and accepted (2xx) by your URL."},"400":{"description":"The request could not be used as sent: unreadable JSON, a malformed query, or a value rejected with its own error code (e.g. invalid_timezone). Includes `usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Read-only key used for a write, or a plan limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation_error: a field is missing or has the wrong format (the same status on every endpoint), or a value is not acceptable (e.g. points at something that is not yours). The reply names every problem in `fields` and includes `usage` with a working example.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"webhooksTest","description":"Returns: {sent, delivered}: whether the signed webhook.test event was sent and accepted (2xx) by your URL.\n\nExample: `POST /v1/webhooks/whk_…/test`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Single-event webhook id, e.g. whk_…."}]}},"/v1":{"get":{"tags":["Usage"],"summary":"List every endpoint (start here)","responses":{"200":{"description":"{guide, openapi, docs, endpoints: [{method, path, summary}]}."},"401":{"description":"Missing or invalid API key (send X-API-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota reached for your plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"index","description":"Returns: {guide, openapi, docs, endpoints: [{method, path, summary}]}.\n\nExample: `GET /v1`"}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Send your API key in the `X-API-Key` header: `X-API-Key: nw_live_…`. A read-only key is rejected on any write (403). Keys are managed in the dashboard."}},"schemas":{"Error":{"type":"object","description":"Every error is self-teaching. Read `fields` (each bad or missing field, named), `usage` (every field of this endpoint with required/allowed/default, plus a working `example`), fix the request and retry.","properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"message":{"type":"string","description":"Human-readable explanation naming every problem."},"fields":{"type":"array","description":"On validation errors: one entry per bad or missing field.","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}}}},"usage":{"type":"object","description":"On 400/415/422: how to call this endpoint correctly.","properties":{"endpoint":{"type":"string","example":"POST /v1/schedules"},"params":{"type":"object","additionalProperties":{"type":"string"}},"example":{"type":"string"}}},"docs":{"type":"string","format":"uri","description":"The documentation section for this endpoint."},"did_you_mean":{"type":"array","items":{"type":"string"},"description":"On 404 for an unknown /v1 path: the closest real endpoints."},"allowed_methods":{"type":"array","items":{"type":"string"},"description":"On 405: the methods this path supports (also in the Allow header)."},"help":{"type":"string","description":"On 401: how to authenticate."}},"required":["error","message"]},"UsageError":{"type":"object","description":"A `--help`-style structured 400 for a malformed list/feed query. The `usage` block tells an agent how to self-correct.","properties":{"error":{"type":"string","enum":["usage_error"]},"message":{"type":"string"},"usage":{"type":"object","properties":{"endpoint":{"type":"string"},"params":{"type":"object","additionalProperties":{"type":"string"}},"example":{"type":"string"}}}}},"Group":{"type":"object","properties":{"id":{"type":"string","example":"grp_…"},"name":{"type":"string"},"job_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}},"Variable":{"type":"object","properties":{"name":{"type":"string","example":"API_BASE_URL"},"value":{"type":"string","nullable":true,"description":"null for secret variables (write-only)."},"is_secret":{"type":"boolean"},"group_id":{"type":"string","nullable":true}}},"Schedule":{"type":"object","properties":{"id":{"type":"string","example":"sch_…"},"name":{"type":"string"},"status":{"type":"string","enum":["active","disabled","deleted"]},"country_code":{"type":"string","nullable":true},"timezone":{"type":"string"},"region":{"type":"string","nullable":true},"respect_holidays":{"type":"boolean","nullable":true},"created_at":{"type":"string","format":"date-time","nullable":true}}},"Job":{"type":"object","properties":{"id":{"type":"string","example":"job_…"},"name":{"type":"string","nullable":true},"type":{"type":"string","enum":["once","recurring","sequence"]},"status":{"type":"string"},"next_run_at":{"type":"string","format":"date-time","nullable":true},"last_run_at":{"type":"string","format":"date-time","nullable":true}}},"RunLog":{"type":"object","properties":{"run_id":{"type":"string","nullable":true},"attempt":{"type":"integer"},"attempt_number":{"type":"integer"},"max_attempts":{"type":"integer"},"status":{"type":"string"},"http_status":{"type":"integer","nullable":true},"error_message":{"type":"string","nullable":true},"duration_ms":{"type":"integer","nullable":true},"executed_at":{"type":"string","format":"date-time"}}},"Run":{"type":"object","properties":{"run_id":{"type":"string","nullable":true},"job_id":{"type":"string"},"job_name":{"type":"string","nullable":true},"status":{"type":"string"},"http_status":{"type":"integer","nullable":true},"error":{"type":"string","nullable":true},"occurred_at":{"type":"string","format":"date-time"}}},"JobStats":{"type":"object","properties":{"jobs":{"type":"object","properties":{"total":{"type":"integer"},"active":{"type":"integer"},"disabled":{"type":"integer"},"deleted":{"type":"integer"}}},"runs":{"type":"object","properties":{"success":{"type":"integer"},"failed":{"type":"integer"},"deferred":{"type":"integer"}}}}},"Metrics":{"type":"object","properties":{"window":{"type":"string"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"totals":{"type":"object","properties":{"api_calls":{"type":"integer"},"job_executions":{"type":"integer"},"webhook_deliveries":{"type":"integer"},"runs":{"$ref":"#/components/schemas/RunBreakdown"}}},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"api_calls":{"type":"integer"},"job_executions":{"type":"integer"},"webhook_deliveries":{"type":"integer"},"runs":{"$ref":"#/components/schemas/RunBreakdown"}}}},"current":{"type":"object","properties":{"active_jobs":{"type":"integer"},"active_schedules":{"type":"integer"}}}}},"RunBreakdown":{"type":"object","properties":{"success":{"type":"integer"},"failed":{"type":"integer"},"timeout":{"type":"integer"},"deferred":{"type":"integer"}}}}}}