Hwip Docs

REST API

Send a push with one curl line, read the error codes, and verify webhook signatures.

Everything the CLI and SDK do goes through one HTTP API. Call it directly when you work from a language without the SDK, or from a CI step where installing the CLI is not worth it.

https://api.hwip.app/v1

Every success body is { "data": ... }. Every error body is { "error": { "code", "message", "status", "details?" } }. Deletes return 204 with no body.

Authenticate

Send an API key in the X-API-Key header. hwip install creates one and saves it in ~/.hwip/config.json. A key carries permissions such as push:write, push:read, channel:read and file:upload. A call the key lacks the permission for fails with 403 FORBIDDEN, and an expired key fails with 401.

Send a push

curl -X POST https://api.hwip.app/v1/pushes/send \
  -H "X-API-Key: $HWIP_API_KEY" \
  -H "Idempotency-Key: deploy-4812" \
  -H "Content-Type: application/json" \
  -d '{"title": "Deploy finished", "body": "main is live"}'

The key needs push:write. Idempotency-Key is optional: send the same key and the same body again within 24 hours and you get the first push back instead of a second one, so a retry is safe. The same key with a different body fails with 422 IDEMPOTENCY_KEY_REUSED.

To post to a channel you own, add its id as channelId (GET /v1/channels lists them; the key needs channel:read too). A channel post is plain text and goes to every subscriber:

curl -X POST https://api.hwip.app/v1/pushes/send \
  -H "X-API-Key: $HWIP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"channelId": "ch_...", "title": "v2.1.0", "body": "shipped"}'

A push sent this way is not sealed on your machine. The server stores and relays it as plain text. The CLI and SDK seal everything they send — see Encryption.

Error codes

StatuscodeWhat it means
400VALIDATION_ERRORA field is missing, the wrong type, or over its limit. message names it
400SEALED_ANSWER_REQUIREDThe question is sealed, so a plain-text answer is refused
401UNAUTHORIZEDNo key or token, an invalid one, or an expired key
403FORBIDDENThe key lacks the permission the route needs, or you do not own the resource
403QUOTA_EXCEEDEDA plan limit is used up. details has resource, current, limit, tier and sometimes resetAt
404<THING>_NOT_FOUNDThe id does not exist, for example PUSH_NOT_FOUND
409CONCURRENT_UPDATEThe record kept changing while the server wrote it. Send it again
409IDEMPOTENCY_IN_PROGRESSThe first request with this Idempotency-Key is still running. Retry in a moment
409EVENT_NOT_PENDINGThe question was already answered, cancelled or expired
422IDEMPOTENCY_KEY_REUSEDThis key was used with a different body or route
429RATE_LIMIT_EXCEEDEDToo many requests. Wait Retry-After seconds
503SERVICE_UNAVAILABLEThe sign-in provider is throttling. Retry after Retry-After

QUOTA_EXCEEDED is a 403, not a 429. A rate limit clears in a minute. A quota is a plan limit: waiting a minute changes nothing, and for the daily push count details.resetAt says when the counter starts again (00:00 UTC).

Limits

Rate. Each caller gets 60 requests a minute across the API. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. A 429 adds Retry-After and details.retryAfter.

Daily pushes. A successful POST /pushes/send or inbound webhook also returns X-Quota-Remaining (pushes left today) and X-Quota-Reset (the next UTC midnight, epoch seconds), so a script can stop before it hits QUOTA_EXCEEDED. Unlimited plans and Idempotency-Key replays do not carry them.

Input. title is up to 500 characters. body is up to 96 KiB, counted as it travels (a Korean character is 3 bytes, a newline 2). A whole request body is up to 120 KiB. Over any of these is a 400, and it is refused before it counts against your quota.

Plan.

ResourceFreePro
Pushes per day (resets 00:00 UTC)100unlimited
Largest file25 MiB1 GiB
Hook triggers per month1005,000
API keys1010
Hooks2525
Webhooks1010

Webhooks

Receive Hwip events

Hwip posts push.created and push.deleted to an HTTPS URL you register. You register it with POST /v1/webhooks ({ "url", "events", "format" }) using a sign-in token, not an API key; the response shows the signing secret once. A format of json (the default), slack or discord picks the body.

Each delivery carries X-Webhook-Event, X-Webhook-Delivery (a UUID that stays the same across retries of one delivery, so you can drop duplicates) and X-Webhook-Signature: sha256=<hex>, the HMAC-SHA256 of the exact body bytes with your secret. Verify before you trust it:

import { createHmac, timingSafeEqual } from 'node:crypto';

export function verify(rawBody, header, secret) {
  const expected = 'sha256=' + createHmac('sha256', secret).update(rawBody).digest('hex');
  const a = Buffer.from(expected);
  const b = Buffer.from(header ?? '');
  return a.length === b.length && timingSafeEqual(a, b);
}

Hwip waits 5 seconds for an answer. It retries a 5xx, a 429 or a connection failure up to 3 times, then drops the delivery. A redirect counts as a failure, and a URL that resolves to a private address is refused.

A sealed push reaches a webhook as New push (encrypted) and its id, nothing else.

Send Hwip a notification

An inbound webhook turns a signed POST into a push:

POST /v1/webhooks/{webhookId}/incoming
X-Webhook-Signature: sha256=<hex of the body, keyed with the secret>
{ "title": "Build failed", "body": "api, step 3" }

A missing or wrong signature is 401 (MISSING_SIGNATURE, INVALID_SIGNATURE_FORMAT, INVALID_SIGNATURE). A switched-off webhook is 400 WEBHOOK_INACTIVE. The push counts toward the daily quota.

On this page