Getting started
Introduction
Netsware is one API for two things every product eventually needs: knowing whether a business is open right now (across timezones and public holidays in 226 countries and territories), and running scheduled jobs that fire real HTTP webhooks, including jobs that wait for the next open minute.
Base URL
https://app.netsware.com
All endpoints are under /v1, accept and return JSON, and are authenticated with an API key. Start with Authentication, then the Quickstart.
What you can build
- Business Hours API: real-time open/closed checks, holiday calendars, and custom schedules.
- Scheduled Jobs API: one-time, recurring, and sequence jobs with signed delivery, and retries for one-time jobs and sequence steps.
- Business-hours-aware execution: link a job to a schedule and it defers to the next open time on its own.
Getting started
Authentication
Every /v1 request is authenticated with an API key, sent in the X-API-Key header. Create keys in your dashboard under Developer, API Keys; a default key is created for you automatically.
# Send your key on every request curl "https://app.netsware.com/v1/hours/check?country=IN&timezone=Asia/Kolkata" \ -H "X-API-Key: nw_live_xxxxxxxxxxxx"
Keys look like nw_live_<40 hex>. The secret is shown once at creation and stored only as a hash, so keep it safe.
Per-key controls
- IP allowlist: restrict a key to specific source IPs.
- Scope:
read_write(default) orread_only(blocks mutating requests). - Expiry: an optional expiry date, after which the key stops working.
A missing or invalid key returns 401. See Errors.
Getting started
Quickstart
Make your first call in under a minute.
1. Get an API key
Sign up (free, no card), open the dashboard, go to Developer › API Keys, and create a key. Copy the secret when it is shown, because it is only shown once.
2. Ask if a business is open
curl "https://app.netsware.com/v1/hours/check?country=IN&timezone=Asia/Kolkata" \ -H "X-API-Key: nw_live_xxx"
{
"open": false,
"reason": "public_holiday",
"holiday_name": "Republic Day",
"local_time": "2026-01-26T10:00:00+05:30",
"next_open": { "local": "2026-01-27T09:00:00+05:30" }
}
That is it. Next: explore the Business Hours and Scheduled Jobs endpoints.
Business Hours
/v1/hours/checkCheck business hours
Returns whether a business is open at a given instant, the reason, and the next opening time. Overnight and holiday aware.
Query parameters
| Parameter | Required | Description |
|---|---|---|
timezone | Yes | IANA timezone, e.g. Asia/Kolkata. |
country | Yes | ISO 3166-1 alpha-2, e.g. IN. |
timestamp | No | ISO 8601 with offset. Defaults to now. |
open_time, close_time | No | HH:MM. Default 09:00 to 18:00. If close is before open it is an overnight shift. |
days | No | Working days, e.g. MON,TUE,WED,THU,FRI. |
region | No | State/region code for regional holidays (available for any country in your plan). |
Response
{
"open": true,
"reason": "open",
"local_time": "2026-07-20T14:05:00+05:30",
"timezone": "Asia/Kolkata",
"country": "IN"
}
reason is one of open, weekend, public_holiday, after_hours, or before_hours. When closed, a next_open object gives the next opening in UTC and local time. The response also carries checked_at (when the check was run, i.e. the current time; the evaluated instant is your timestamp when supplied) and, on a public holiday, holiday_name.
Business Hours
/v1/hours/holidaysHolidays
Public holidays for a country and year, for 226 countries and territories. Add a region for state-level calendars.
| Parameter | Required | Description |
|---|---|---|
country | Yes | ISO 3166-1 alpha-2. |
year | Yes | 4-digit year. |
region | No | State/region code (available for any country in your plan). |
type | No | Filter by holiday type. |
{
"country": "FR", "year": 2026, "count": 11,
"holidays": [
{ "date": "2026-01-01", "name": "New Year's Day", "name_local": "Nouvel An", "type": "public" }
]
}
name is the English holiday name; name_local is the name in the country's own language (identical where there is no separate translation).
The Essentials plan covers 10 popular countries, including their regional calendars; Standard and above cover all 226. An out-of-plan country returns 403 country_not_in_plan; an unknown country returns 404 country_not_supported.
Business Hours
/v1/schedulesSchedules
A schedule is a reusable set of business hours for a place: its country, timezone, weekly hours, and whether it respects public holidays. Jobs can link to a schedule to become business-hours-aware.
Create a schedule
POST /v1/schedules { "name": "Mumbai office", "timezone": "Asia/Kolkata", "country_code": "IN", "respect_holidays": true, "days": ["MON", "TUE", "WED", "THU", "FRI"], "open_time": "09:00", "close_time": "18:00" }
- Working days:
daystakes 3-letter codes fromMON,TUE,WED,THU,FRI,SAT,SUN. A singleopen_time/close_timeapplies to all of them; for different hours per day, create one schedule per group. - Overnight hours: set
close_timeearlier thanopen_time(e.g. 22:00 to 06:00); the shift is owned by its start day. - Multi-timezone: pass
timezones: []to fan out one schedule per zone. - Live check:
GET /v1/schedules/:id/checkruns the schedule now.
List with GET /v1/schedules, replace with PUT /v1/schedules/:id, and delete with DELETE /v1/schedules/:id (soft by default; add ?permanent=true to hard-delete).
Scheduled Jobs
Jobs overview
A job delivers an HTTP request to a URL you choose, at a time you choose. Three types:
| Type | Fires |
|---|---|
once | A single time at run_at. |
recurring | On a cron schedule. |
sequence | A series of steps with cumulative delays (a drip). |
Every job supports a timeout_seconds, custom headers, a JSON payload, and custom success_codes. One-time jobs and sequence steps also take a retry policy; a recurring job that fails runs again at its next scheduled time. Retries are plan-limited; see Rate limits & plans.
Scheduled Jobs
/v1/jobsCreate a job
POST /v1/jobs { "type": "once", "url": "https://app.com/webhook", "run_at": "2026-07-01T09:00:00", "timezone": "Asia/Kolkata", "payload": { "userId": "123" }, "retry": { "attempts": 1 }, "business_hours_schedule_id": "sch_office" }
For recurring, send a cron expression instead of run_at. For sequence, send a steps array. Manage jobs with GET /v1/jobs, PUT /v1/jobs/:id, pause/resume, retry, and DELETE. This example runs on every plan; attempts above 1 requires Standard and "backoff": "exponential" requires Pro or Max (see plans).
Scheduled Jobs
Business-hours-aware execution
This is the feature no other scheduler has. Set business_hours_schedule_id on a job and it only fires while the business is open. If it comes due while closed (weekend, after hours, a public holiday), Netsware moves it to the schedule’s exact next open minute automatically.
- The deferral is logged with a reason and counts toward the job’s
deferred_runs. - A
job.scheduledwebhook event fires withdeferred_reasonand the newnext_run_atnested underdata. - Deferrals never consume the retry budget.
- A missing or deleted schedule fails safe: the job is deferred rather than fired at the wrong time. (Only an internal resolver error falls back to running the job immediately.)
→ {
"event": "job.scheduled",
"timestamp": "2026-07-01T18:30:00Z",
"data": {
"job_id": "job_...",
"job_name": "Nightly export",
"run_id": "run_...",
"deferred_reason": "public_holiday",
"next_run_at": "2026-07-02T09:00:00+05:30"
}
}
Automation & Monitoring
/v1/groupsGroups
Groups are folder-style organization for jobs, ideal when you hand a key to an AI agent and ask it to keep your automations tidy. Deleting a group ungroups its jobs; it never deletes them. Group counts are enforced per plan.
POST /v1/groups # { "name": "Nightly" } -> { id: "grp_...", name, job_count, created_at } GET /v1/groups?page=1&limit=25 # { groups: [...], page, limit, total, has_more, next_page } GET /v1/groups/grp_... PATCH /v1/groups/grp_... # { "name": "Renamed" } DELETE /v1/groups/grp_...
Assign a job to a group by setting group_id on create/update, and filter the job list with GET /v1/jobs?group=grp_.... Over the plan limit returns 409 limit_reached.
Automation & Monitoring
/v1/variablesVariables & secrets
Variables are reusable values (base URLs, tokens, flags) referenced by your jobs. Names are UPPER_SNAKE. Set is_secret: true to seal a value at rest.
Secret values are write-only. You can create or overwrite a secret, but its plaintext is never returned: a listed secret always comes back as value: null. This is deliberate: it keeps the platform from ever becoming a “seamless migration” export of your credentials.
PUT /v1/variables { "name": "API_TOKEN", "value": "t0ken", "is_secret": true } # -> { name, saved: true } GET /v1/variables?group_id=grp_... # secret -> { name, value: null, is_secret: true } DELETE /v1/variables/API_TOKEN
Automation & Monitoring
/v1/jobs/:id/logsPer-job run history
Drill into one job’s runs, newest first, with retry detail. Add ?status=success|failed|timeout to filter by outcome. The window is clamped to your plan’s data retention (7 / 30 / 60 / 90 days); older rows are pruned. Always paginated (limit ≤ 100).
GET /v1/jobs/job_.../logs?status=failed&limit=50 { "logs": [ { "run_id": "a1b2...", "status": "failed", "http_status": 500, "attempt_number": 2, "max_attempts": 3, "error_message": "Upstream timeout", "executed_at": "2026-07-01T09:00:00Z" } ], "pagination": { "page": 1, "total": 7, "has_next": false } }
One run’s full correlated trace (job → run → retries) is at GET /v1/jobs/:id/runs/:run_id.
Automation & Monitoring
/v1/runsAccount-wide failure feed
The “what’s broken everywhere?” feed across all your jobs: the reconciliation companion to webhooks. status is required (failed or deferred); there is no account-wide success feed (use per-job history for that). since defaults to 24h and is hard-capped at 7 days. Cursor-paginated (no total).
GET /v1/runs?status=failed&since=24h&limit=50 { "data": [ { "run_id": "a1b2...", "job_id": "job_...", "job_name": "Nightly export", "status": "failed", "http_status": 500, "error": "Upstream timeout", "occurred_at": "2026-07-01T09:00:00Z" } ], "pagination": { "page": 1, "limit": 50, "has_next": false, "next_page": null } }
A malformed query returns a self-describing 400 usage_error whose usage block lists the accepted params and an example, so an AI agent can correct itself without reading these docs.
Automation & Monitoring
/v1/metricsMonitoring rollups
A bounded daily rollup for your own monitoring / NOC dashboard to poll. window is one of 24h|48h|7d|30d|60d|90d (default 30d), clamped to your plan retention. The series is a fixed small size (≤ 90 daily points), so the response never grows unbounded.
GET /v1/metrics?window=30d { "window": "30d", "from": "...", "to": "...", "totals": { "api_calls": 1240, "job_executions": 860, "webhook_deliveries": 312, "runs": { "success": 800, "failed": 48, "timeout": 6, "deferred": 6 } }, "series": [ { "date": "2026-06-02", "api_calls": 41, "runs": { ... } } ], "current": { "active_jobs": 12, "active_schedules": 4 } }
Webhook vs API doctrine. Webhooks push what happened in real time (alerting / NOC). The API reads authoritative state (dashboards, history, analytics). If you miss a webhook, reconcile with /v1/runs and /v1/metrics. Never treat a webhook as your only record.
Automation & Monitoring
/llms-full.txtAI assistants and machine discovery
Using an AI assistant? Give it one link: app.netsware.com/llms-full.txt. It is the complete manual for AI agents: how Netsware works, step-by-step recipes, every endpoint and field, every error and how to fix it, webhooks and plan limits.
GET https://app.netsware.com/llms-full.txt: the complete guide for AI agents. Start here.GET https://app.netsware.com/llms.txt: a short index in the llmstxt.org format.GET https://app.netsware.com/openapi.json: the full OpenAPI 3.1 description of every /v1 endpoint.
Errors that teach. When a request is wrong, the reply names each field that failed and includes a usage block with the right endpoint, its parameters and a working example. An agent can correct itself without guessing.
These files describe the contract only. They contain no keys, secrets, or internal endpoints. Hand a read-only key to an agent for reporting, and a read-write key to let it create and manage automations. A read-only key is rejected on any write with 403 read_only_key.
Webhooks
/v1/webhooks/endpointsRegister a webhook
Register an endpoint (one URL, which must use https) that receives many events. Each event is a { product, event } pair, product is scheduled_jobs or business_hours, and the event must belong to that product. The response includes one signing secret for the endpoint, shown once.
POST /v1/webhooks/endpoints { "url": "https://app.com/events", "events": [ { "product": "scheduled_jobs", "event": "job.completed" }, { "product": "scheduled_jobs", "event": "job.failed" } ] }
Event catalog
Scheduled Jobs: job.scheduled, job.completed, job.failed, job.retry, job.recovered, job.cancelled, job.paused, job.resumed. Business Hours: schedule.opened, schedule.closed, schedule.holiday, schedule.activated, schedule.deactivated. An event must be paired with its own product (mismatches are rejected). A webhook.test event is delivered only when you send a manual test (POST /v1/webhooks/endpoints/:id/test).
job.recovered fires when a job succeeds on a run whose immediately-prior run had failed: the “back to green” signal for monitoring. job.paused / job.resumed and schedule.activated / schedule.deactivated fire on those lifecycle transitions.
Common envelope
Every delivery carries a stable event_id (evt_…) you can use for idempotency (the same id is reused across retries of a delivery) and an occurred_at timestamp, with the event-specific fields nested under data:
→ {
"event": "job.recovered",
"event_id": "evt_9f3c...",
"occurred_at": "2026-07-01T09:05:00Z",
"data": { "job_id": "job_...", "run_id": "a1b2...", "previous_status": "failed", "http_status": 200 }
}
List endpoints with GET /v1/webhooks/endpoints; edit one in place with PATCH /v1/webhooks/endpoints/:id (body {url?, is_active?, events?}, with the signing secret preserved); remove one with DELETE /v1/webhooks/endpoints/:id. Deliveries retry (immediate, then +5 min, then +30 min); inspect attempts with GET /v1/webhooks/endpoints/:id/deliveries. The legacy single-event POST /v1/webhooks still works.
Webhooks
Verify signatures
Every delivery carries a timestamp and an HMAC-SHA256 signature so you can confirm it came from Netsware and was not replayed.
X-Netsware-Timestamp: 1753000000 X-Netsware-Signature: sha256=<hex>
The signature is HMAC-SHA256(secret, "{timestamp}.{rawBody}"). Recompute it over the raw request body and compare in constant time. Both SDKs ship a verifyWebhook helper that does this for you.
import { verifyWebhook } from "netsware-sdk"; const ok = verifyWebhook({ payload: rawBody, signature: req.headers["x-netsware-signature"], timestamp: req.headers["x-netsware-timestamp"], secret, }); if (!ok) return res.status(400).end();
Reference
Rate limits & plans
The monthly quota is enforced per account; the per-minute limit is enforced per API key (bounded by your plan's active-key cap). Successful and throttled /v1 responses carry X-RateLimit-Limit, -Remaining, and -Reset headers.
| Limit | Essentials | Standard | Pro | Max |
|---|---|---|---|---|
| Price * | $0 | $6/mo | $15/mo | $30/mo |
| API requests / minute | 30 | 120 | 300 | 600 |
| API requests / month | 20,000 | 200,000 | 1,500,000 | 4,000,000 |
| Job executions / month | 10,000 | 100,000 | 750,000 | 2,000,000 |
| Webhook deliveries / month | 1,000 | 10,000 | 75,000 | 200,000 |
| Scheduled jobs | 40 | 200 | 1,000 | 5,000 |
| Business-hours schedules | 20 | 100 | 500 | 2,500 |
| Holiday countries | 10 | All 226 | All 226 | All 226 |
| Region / state calendars | Yes (its 10 countries) | Yes | Yes | Yes |
| Retries per job | 1 | 3 | 5 + exponential | 10 + exponential |
| Team workspaces | Personal | Personal | Up to 10 members | Up to 20 members |
| Data retention | 7 days | 30 days | 60 days | 90 days |
* The final price, including any taxes that apply to your location, is shown at checkout. International prices include applicable taxes. See Billing & taxes.
Over the per-minute limit returns 429 rate_limit_exceeded; over the monthly cap returns 429 monthly_quota_exceeded. Job executions are metered with a protective brake (jobs pause, then resume at the monthly reset). Requesting more retries than your plan allows returns 422 retry_limit_exceeded, and exponential backoff below Pro returns 422 backoff_requires_pro. Current usage is available at GET /v1/usage.
Reference
Errors
Errors use standard HTTP status codes and a consistent JSON body.
{
"error": "country_not_in_plan",
"message": "Holiday data for FR is available on Standard and above."
}
Every /v1 error also carries a docs link. Validation errors add fields and usage.
| Status | Meaning |
|---|---|
400 | The request could not be used as sent, e.g. invalid_body, invalid_timezone, invalid_query. |
401 | missing_api_key / invalid_api_key / key_expired. |
403 | Plan gate or access denied, e.g. country_not_in_plan, read_only_key, ip_not_allowed. |
404 | Not found, or country_not_supported. A mistyped /v1 path includes did_you_mean. |
405 | Method not allowed on that path. The Allow header and allowed_methods list what works. |
422 | validation_error: a field is missing or has the wrong format, the same on every endpoint. fields lists each problem. Also rejected values, e.g. retry_limit_exceeded. |
429 | rate_limit_exceeded / monthly_quota_exceeded. |
503 | Temporarily unavailable (rate limiter fails closed without its store). |
Reference
SDKs
The API is plain REST, so any HTTP client works. We also ship SDKs with a typed client and a verifyWebhook helper. Install steps and worked examples for Node.js and Python are on the SDK page.
npm install netsware-sdk # or: pip install netsware-sdk
import { Netsware } from "netsware-sdk"; const ns = new Netsware("nw_live_xxx"); const status = await ns.hours.check({ country: "IN", timezone: "Asia/Kolkata" });
The client exposes ns.hours, ns.jobs, ns.groups, ns.variables, ns.runs, ns.metrics, ns.webhooks, and ns.usage (v2.1+). Signed-webhook verification is built in; see Verify signatures. For a running history of changes, see the Changelog.