GitFlare を日本語でご利用いただけます。 日本語で見る · GitFlare 提供简体中文站点。 查看简体中文 ·

API reference

Base URL: https://api.gitflare.net/v1. Authenticate with a bearer token.

Base URL https://api.gitflare.net/v1. All calls are HTTPS. Tokens are sent as Bearer credentials and should be scoped to a single account.

Authentication

$ export GITFLARE_API_TOKEN=gf_live_...
$ curl -sS https://api.gitflare.net/v1/accounts/me \
  -H "Authorization: Bearer $GITFLARE_API_TOKEN" \
  -H "Accept: application/json"

Create a Worker from a bundled script

$ tar -C dist -czf bundle.tgz .
$ curl -sS -X PUT https://api.gitflare.net/v1/workers/checkout-api \
  -H "Authorization: Bearer $GITFLARE_API_TOKEN" \
  -H "Content-Type: application/gzip" \
  --data-binary @bundle.tgz

Purge cache

const res = await fetch("https://api.gitflare.net/v1/zones/example.com/purge", {
  method: "POST",
  headers: {
    authorization: `Bearer ${token}`,
    "content-type": "application/json",
  },
  body: JSON.stringify({ prefixes: ["/assets/", "/api/v2/"] }),
});

List DNS records

$ curl -sS "https://api.gitflare.net/v1/zones/example.com/dns?type=A" \
  -H "Authorization: Bearer $GITFLARE_API_TOKEN" | jq .result

Errors

Error bodies use {"error": {"code": "rate_limited", "request_id": "..."}}. 429 responses include Retry-After. Idempotency keys are honoured on PUT for 24 hours.