Sign Testing JWT
curl --request POST \
--url https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt \
--header 'Content-Type: application/json' \
--data '
{
"privateKey": "<string>",
"payload": {},
"projectId": "<string>"
}
'import requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt"
payload = {
"privateKey": "<string>",
"payload": {},
"projectId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({privateKey: '<string>', payload: {}, projectId: '<string>'})
};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'privateKey' => '<string>',
'payload' => [
],
'projectId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt"
payload := strings.NewReader("{\n \"privateKey\": \"<string>\",\n \"payload\": {},\n \"projectId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt")
.header("Content-Type", "application/json")
.body("{\n \"privateKey\": \"<string>\",\n \"payload\": {},\n \"projectId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"privateKey\": \"<string>\",\n \"payload\": {},\n \"projectId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyCrypto
Sign Testing JWT
Generate a signed RS256 JWT for development and testing
POST
/
:projectId
/
api
/
v7
/
crypto
/
sign-testing-jwt
Sign Testing JWT
curl --request POST \
--url https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt \
--header 'Content-Type: application/json' \
--data '
{
"privateKey": "<string>",
"payload": {},
"projectId": "<string>"
}
'import requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt"
payload = {
"privateKey": "<string>",
"payload": {},
"projectId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({privateKey: '<string>', payload: {}, projectId: '<string>'})
};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'privateKey' => '<string>',
'payload' => [
],
'projectId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt"
payload := strings.NewReader("{\n \"privateKey\": \"<string>\",\n \"payload\": {},\n \"projectId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt")
.header("Content-Type", "application/json")
.body("{\n \"privateKey\": \"<string>\",\n \"payload\": {},\n \"projectId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/crypto/sign-testing-jwt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"privateKey\": \"<string>\",\n \"payload\": {},\n \"projectId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySigns a short-lived JWT (5 minutes) using your project’s RSA private key. Use this during development to generate tokens for testing external auth without needing to implement JWT signing in your test environment.
The JWT is signed with
Returned when
Returned when the
Never use this endpoint in production. It requires your RSA private key in the request body, which must be kept secret. Use it only in local development or CI environments.
Body Parameters
string
required
Your RSA private key encoded as a Base64 string. This is the private key associated with the public key configured in your project’s external auth settings.
object
required
The JWT payload. Must include at least an
id field (the user’s ID in your system). All fields are included in the userData claim.{
"id": "user-123",
"email": "alice@example.com",
"name": "Alice"
}
string
The project ID. Can be provided in the body or as a URL path parameter (
:projectId). The body value takes precedence if both are provided.Response
Returns the signed JWT as a plain text string (not JSON):eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
RS256, expires in 5 minutes, and includes:
sub— the user’sidfrom the payloadiss— the project IDaud—"sublay.io"userData— the full payload object
Error Responses
Missing Parameters — 400
Missing Parameters — 400
Missing params in request body
projectId, privateKey, or payload is missing.Missing User ID — 400
Missing User ID — 400
{ "error": "Missing user id in payload.", "code": "crypto/missing-params" }
payload object does not include an id field.
