Skip to content

minor/us-east-1/Flaring unused Promise.race

Developer platform · v1 · deprecated since launch

API reference.

Build on the grid. Programmatic access to harvests, excuses, blame and the production environment, with the reliability you have come to expect from our status page.

Introduction

The Syntax Energy API is organised around REST, in the sense that it would like one. It accepts JSON, returns JSON, and stores everything in YAML, which is how we got here.

All requests go to a single base URL. It does not resolve. The console on this page answers on its behalf.

https://api.syntax.energy/v1

Authentication

Authenticate with a bearer token. Tokens are issued once, at the moment you first disappoint a senior engineer, and cannot be rotated. If you have lost yours, generate a new disappointment.

Keys are scoped to everything. There is one scope. A request with no key at all is also accepted, as a courtesy and a vulnerability.

Authorization: Bearer $SYNTAX_DISAPPOINTMENT

Rate limits

Limits are generous by the standards of a company that would prefer you did not call. The console on this page includes 5 trial requests, which is 4 more than the free plan.

Rate limits by plan
PlanLimitBurst
Free1 request per fiscal quarterNo
Pro2 requests per fiscal quarterBoth at once, if you must
EnterpriseCall usWe will not answer

Endpoints

Nine endpoints, each with a working console. Responses arrive in business days, simulated here in under a second.

GET/v1/harvest

List harvested errors

Returns the errors condensed by the grid in the current period. None of them are yours. Yours are in the next response.

Parameters for /v1/harvest
ParameterTypeNotes
nodestringA node id. Optional, and ignored.
limitintegerMaximum results. The maximum maximum is 1.
curl -X GET https://api.syntax.energy/v1/harvest \
  -H "Authorization: Bearer $SYNTAX_DISAPPOINTMENT"

Simulated in your browser. 5 of 5 trial requests left.

Response

Expected: 200 OK. Send the request to find out.

POST/v1/excuses

Create an excuse

Generates a statement suitable for customers, regulators or a parent. Billed per syllable.

Parameters for /v1/excuses
ParameterTypeNotes
what_brokestringRequired. Be honest. We will not be.
toneenumsincere, executive or legal. All three produce the same text.
curl -X POST https://api.syntax.energy/v1/excuses \
  -H "Authorization: Bearer $SYNTAX_DISAPPOINTMENT" \
  -H "Content-Type: application/json" \
  -d '{"what_broke":"everything","whose_fault":"unclear","tone":"sincere"}'

Simulated in your browser. 5 of 5 trial requests left.

Response

Expected: 201 Created. Send the request to find out.

GET/v1/status

Get grid status

Always returns 200. This is what the service level agreement measures.

curl -X GET https://api.syntax.energy/v1/status \
  -H "Authorization: Bearer $SYNTAX_DISAPPOINTMENT"

Simulated in your browser. 5 of 5 trial requests left.

Response

Expected: 200 OK. Send the request to find out.

DELETE/v1/production

Delete production

Removes the production environment. Requires no special permission, which is a known issue we have accepted.

This endpoint has no staging equivalent. Staging is production.

curl -X DELETE https://api.syntax.energy/v1/production \
  -H "Authorization: Bearer $SYNTAX_DISAPPOINTMENT"

Simulated in your browser. 5 of 5 trial requests left.

Response

Expected: 202 Accepted. Send the request to find out.

PATCH/v1/blame

Reassign blame

Moves responsibility for an incident to another party. Idempotent: it is always the intern.

Parameters for /v1/blame
ParameterTypeNotes
incidentintegerThe incident number.
assign_tostringYour suggestion. Noted and discarded.
curl -X PATCH https://api.syntax.energy/v1/blame \
  -H "Authorization: Bearer $SYNTAX_DISAPPOINTMENT" \
  -H "Content-Type: application/json" \
  -d '{"incident":4471,"assign_to":"process"}'

Simulated in your browser. 5 of 5 trial requests left.

Response

Expected: 200 OK. Send the request to find out.

GET/v1/coffee

Brew coffee

Implements the Hyper Text Coffee Pot Control Protocol in full, for a teapot.

curl -X GET https://api.syntax.energy/v1/coffee \
  -H "Authorization: Bearer $SYNTAX_DISAPPOINTMENT"

Simulated in your browser. 5 of 5 trial requests left.

Response

Expected: 418 I'm a teapot. Send the request to find out.

POST/v1/billing/refund

Request a refund

Opens a refund request. Processing a refund is a paid feature.

curl -X POST https://api.syntax.energy/v1/billing/refund \
  -H "Authorization: Bearer $SYNTAX_DISAPPOINTMENT" \
  -H "Content-Type: application/json" \
  -d '{"invoice":"inv_000001","reason":"nothing was delivered"}'

Simulated in your browser. 5 of 5 trial requests left.

Response

Expected: 402 Payment Required. Send the request to find out.

GET/v1/users/me

Get the current user

Returns the account that owns the API key. We have checked and there is no such account.

curl -X GET https://api.syntax.energy/v1/users/me \
  -H "Authorization: Bearer $SYNTAX_DISAPPOINTMENT"

Simulated in your browser. 5 of 5 trial requests left.

Response

Expected: 404 Not Found. Send the request to find out.

PUT/v1/config

Replace the grid config

Uploads a new YAML config for every harvest node at once. There is no validation step. There was one.

curl -X PUT https://api.syntax.energy/v1/config \
  -H "Authorization: Bearer $SYNTAX_DISAPPOINTMENT" \
  -H "Content-Type: application/json" \
  -d '{"config":"\tgrid:\n\t  enabled: true"}'

Simulated in your browser. 5 of 5 trial requests left.

Response

Expected: 500 Internal Server Error. Send the request to find out.

Errors

We use conventional HTTP status codes, unconventionally.

200
OK
It may or may not have worked. See the body. The body may also say OK.
202
Accepted
We have received your request and intend to think about it.
402
Payment Required
Returned by most endpoints eventually.
404
Not Found
The resource does not exist, or does, and is hiding from you specifically.
418
I'm a teapot
Returned by the coffee endpoint and, on Fridays, by billing.
429
Too Many Requests
You made a second request.
500
Internal Server Error
There is a tab in the YAML.
503
Service Unavailable
Never returned. The status page would have to change.

Webhooks

Register a URL and we will POST to it whenever something happens, and at other times. Events are delivered at least once, usually four times, and never in order.

If your server does not answer with a 200 within 30 milliseconds, we retry with exponential enthusiasm until you are sorry. Signatures are included so you can verify the payload came from us. We have lost the secret.

{
  "event": "incident.resolved",
  "incident": 4471,
  "resolved": true,
  "actually_resolved": false,
  "delivered": "4 of 1"
}

SDKs

  • COBOL Stable

    Our reference implementation. Maintained by one contractor who cannot retire.

  • Spreadsheet macro Beta

    Finance wrote it. It is the only one with tests.

  • Fax Generally available

    Send the request to the usual number. Include a cover sheet.

  • JavaScript Deprecated

    Replaced by the newer JavaScript SDK, which is also deprecated.

Versioning

The current version is v1, which is deprecated. Its replacement, v2, was deprecated before release to save time. Please continue to use v1.

We never make breaking changes. When something breaks, it is a new feature, and it is documented in the incident channel.

There is no API. No request on this page leaves your browser, no key exists, and api.syntax.energy points nowhere. The working parts of this site are the tools, which run locally and ask for nothing.

Featured