ohyay exposes a backend API that can be used to manage rooms. All API actions are tied to your user account.

Creating an API Token

Before you can use the API, you need to create an API token, which can be done from

Sending a Request

Requests can be sent over HTTPS POST to the endpoint that corresponds to the operation you want to perform. The body of the request contains a JSON web token signed with your API key. The payload of the web token should contain the parameters for the request.

Example: JavaScript

The jsonwebtoken package can be used to generate the token needed for the request. Start by installing this package.

npm install --save jsonwebtoken

Once you've installed the library, you can generate requests like so

import * as jwt from 'jsonwebtoken';

// Create the request. Each request must container your user id.
// You can get your user id from
const req = { userId: <User ID> };
const apiKey = <your api key>;
const token = jwt.sign(req, apiKey)
fetch('', {
  method: 'POST',
  headers: {
    'Content-Type': 'text/plain'
  body: token,

Example: Python

JSON web tokens can be generated in python using the pyjwt package.

pip install pyjwt
import jwt

# This example uses the requests package for HTTP requests
# It can be installed with `pip install requests`
import requests

token = jwt.encode({
  "userId": "<user id>",
}, "<api key>", algorithm="HS256")

res =
  headers={ "content-type": "text/plain" },

print(res.text) # Contains response json

Did this page help you?