Introduction

Hello Developer! Our REST API has been designed to provide you a secure, straightforward interface for interacting with Nile. We speak JSON, use standard HTTP verbs, return standard HTTP response codes, and strive for no surprises.

The root URL for all requests is https://api.thenile.dev.

Most requests require that you specify your workspace slug and database name in the URL path. For example:

https://api.thenile.dev/workspaces/my-workspace/databases/database-one/

Rate limiting

The API is currently subject to our terms of service. We may introduce rate limits in the future.

User Authentication

User login and sign-up requests return an authentication token in the form of a JWT. This token must be included in the Authorization header of all subsequent requests as a Bearer token.

Login a user with the email address and password provided during sign-up.

User Authentication Request
cURL
POST- /workspaces/:workspaceSlug/databases/:databaseName/users/login
curl 'https://api.thenile.dev/workspaces/<string>/databases/<string>/users/login' \
--header 'Content-Type: application/json' \
--data-raw '{
  "email": "<string>",
  "password": "<string>"
}'

The response will include the user id, tenant list, and token with metadata.

User Authentication Response
200
{
  "id": "018b6216-27a1-7e2b-aa83-67d7ba500982",
  "tenants": [
    "018b61ec-af9e-77e5-b27f-77239cd4a0bc"
  ],
  "token": {
    "jwt": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3RoZW5pbGUuZGV2IiwiYXVkIjpbImRhdGFiYXNlOjAxOGI2MWJjLWNmMmMtNzM5Mi05MmE2LWYxYTgxMWNmNDQxOSIsIm5pbGUiXSwiaWF0IjoxNjk4MTU5MDQ0LCJleHAiOjE2OTgxNjI2NDQsInN1YiI6IjAxOGI2MjE2LTI3YTEtN2UyYi1hYTgzLTY3ZDdiYTUwMDk4MiIsImp0aSI6IjkxN2I1MDA1LTRjNWEtNDdiYy1hNDE5LTc4M2Y5MzI5ZTdkMyIsIm5hbWUiOiJwc2NrYXVnaHQiLCJlbWFpbCI6InNjb3R0aWN1c0Btc24uY29tIiwic2NvcGUiOiJkYXNoYm9hcmQifQ.jxtxzgi6N66OXaeEZwjH4i_wIxvGDak4iAh4XHICzdtQYKnqc4tvBmQ3xxyjvy_u_wmwOMdw_YJlqGwiWVL5TJyyVuHTBV8z-EuXxV-rIMR7OPMRTY6PfQ7r0d_ivUoTY1uX4FLvNdj2cNP6z_VczWGwKdMQ04UJ4jNSD-eVpLOF-bjd0_w9huOaMyepK8SFURGKpdZe5qKS8ahl4W7kOKbJHonQ8SVKI8Xr0Rp3gLM4B2PjkUZL0ImICxlLcpz3q0PdL54nEU8iGFnlSrppAD5VzYK1H9Wfa9ycGDkSWGP4IejD7hHX3xAv-M8Uo1n2W-Pw4hECHkWInNHtmlRQZw",
    "maxAge": 3600,
    "type": "ACCESS_TOKEN"
  }
}

Use the JWT as a Bearer token in the Authorization header of subsequent requests.

API Requests
cURL
GET- /workspaces/:workspaceSlug/databases/:databaseName/users/me
curl 'https://api.thenile.dev/workspaces/<string>/databases/<string>/users/me' \
--header 'Authorization: Bearer <string>'