background image

API reference

Every public REST endpoint, with its parameters, request body, responses and a request in your language.

Base URL https://api.stellards.io

Authentication

Every call except the OAuth token endpoints and /v1/ping needs a token in the Authorization header:

  • An access token for your own servers and scripts. Create one in the console under Applications, on the Access Tokens tab; it gets the permissions of the role you give it.
  • An OAuth access token when people sign in to your app with their Stellar DataStore account. Getting Started walks through the flow.

Your first call, listing the projects the token can reach. Pick your language; the choice sticks on every page.

curl -X GET 'https://api.stellards.io/v1/schema/project' \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Two route styles

Most endpoints take the project, table and field as query parameters, as in /v1/schema/table?project=PROJECT_ID. Tables, fields, custom queries and procedures can also be reached with the ids in the path, as in /project/PROJECT_ID/table. Both do the same; each section lists the path-style routes after the others.

Responses

Every JSON response has the same shape. isSuccess tells you whether the call worked, messages explains what went wrong when it didn't, and data holds the result. Record queries also return count, the number of records that match before paging.

This is what creating a table without a name returns:

{
  "messages": [
    { "code": "BadRequest", "message": "The Name field is required.", "type": 30 }
  ],
  "isSuccess": false
}

A message's type is 10 for information, 20 for a warning, 30 for an error, 31 for a database error and 32 for a value that couldn't be read.

Status codes

StatusMeaning
200, 201The call worked; 201 when something was created.
400The request isn't valid: a missing parameter, a value that doesn't fit its field, or a plan limit. messages says which.
401No token, or an expired one. Refresh it and try again.
403The token's role doesn't allow this, or the project's plan doesn't include it.
404The project, table, field or record doesn't exist.
429Too many requests; wait the number of seconds in the Retry-After header.

Rate limits

Each user or token can make 100 requests per minute. Above that the API answers 429 until the minute is over. Your plan also sets a number of requests per month; see Pricing.

Try it in the browser

The interactive API explorer sends real requests with your token, and the Run in Postman button in the sidebar forks a ready-made collection.