Skip to main content
A RequestScript server exposes these endpoints. Examples use http://localhost:3000 as the server address. Your server may also require authentication headers; ask its administrator. In URLs, the dots of a contract’s path become slashes: shop.orders.LineTotal is /run/shop/orders/LineTotal.

Run a request

POST /run Runs a request script once. Send the script source as the request body.
Response 200
Sending a contract script to this endpoint is rejected with 400 InvalidScript.

Save a contract

POST /contracts Saves a contract script. Send the script source as the request body.
Response 201
  • 409 ContractExists if that path, name and version is already saved.
  • 400 InvalidScript if the script is a request rather than a contract.

Invoke a contract

POST /run/<path>/<Name> or POST /run/<path>/<Name>@<version> Runs a saved contract. Without a version, the latest version runs. Send parameters as JSON under parameters. For a contract without parameters, send {} or no body.
Response 200
See Invoking contracts for how parameters are converted.

List contracts

GET /contracts Lists every saved version of every contract. Response 200

Delete a contract

DELETE /contracts/<path>/<Name> or DELETE /contracts/<path>/<Name>@<version> Without a version, deletes every version of the contract. With a version, deletes only that version. Response 204 with no body.

Errors

Every error response has the same shape:
See Errors for what causes script errors. A failing resource call is not an error response: it’s reported to the script, and the request still succeeds.