Skip to main content
miktingHttp can call any HTTP API. These examples cover request bodies, authentication, response handling, pagination, and webhooks. See Actions for every argument and Secrets for credential setup.

Make a request

This example sends a message as a query parameter and replies with a field from the JSON response:
Put follow-up-actions under args. The follow-ups run after success or failure. A request sets status, success, body, JSON and response-header variables. storeAs creates namespaced copies. JSON fields are flattened into variable names, replacing dots with underscores. Use miktingJson { op: query, path: ... } for nested fields that are not available as flattened variables. Branch on the HTTP status or mikting_ok:
A condition can also handle a non-2xx status:

Send a body

A body is optional. When present, choose one form: json for a templated JSON object, form for URL-encoded fields, or text for a raw string.

Authenticate

Keep credentials in environment variables and refer to them by name. With the default MIKTING_ prefix, {{secret.API_TOKEN}} reads MIKTING_API_TOKEN. You can set the Authorization header directly or use the bearer/basic shortcuts:
A missing secret sets mikting_error to missing_secret:NAME. The action’s follow-ups still run.

Set limits

Timeout defaults to 10 seconds, retries to one for idempotent methods, and the maximum response body to 1 MiB. POST requests are not retried. Cache only GET and HEAD responses using cacheTtlSec. Optional local rate limiting is off by default; when enabled, rejected requests set mikting_error to rate_limited. Webhook payloads default to 256 KiB.

Follow pagination

miktingHttpPaginate reads a next URL from a dot path or an RFC 5988 Link header and follows up to maxPages. It combines response items in the named array and reports the page count:

Send to a Discord webhook

miktingWebhookSend sends a Discord webhook request. Store the URL in an environment secret:

Complete examples

The examples/ directory contains a GET request, a JSON API flag gate, and a webhook relay. Those files show the full script configuration. Documentation home · Source Markdown