Login
curl --request POST \
--url https://api.superbox.ai/api/v1/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>",
"provider": "<string>",
"id_token": "<string>",
"access_token": "<string>",
"refresh_token": "<string>"
}
'import requests
url = "https://api.superbox.ai/api/v1/auth/login"
payload = {
"email": "<string>",
"password": "<string>",
"provider": "<string>",
"id_token": "<string>",
"access_token": "<string>",
"refresh_token": "<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({
email: '<string>',
password: '<string>',
provider: '<string>',
id_token: '<string>',
access_token: '<string>',
refresh_token: '<string>'
})
};
fetch('https://api.superbox.ai/api/v1/auth/login', 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.superbox.ai/api/v1/auth/login",
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([
'email' => '<string>',
'password' => '<string>',
'provider' => '<string>',
'id_token' => '<string>',
'access_token' => '<string>',
'refresh_token' => '<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.superbox.ai/api/v1/auth/login"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"provider\": \"<string>\",\n \"id_token\": \"<string>\",\n \"access_token\": \"<string>\",\n \"refresh_token\": \"<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.superbox.ai/api/v1/auth/login")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"provider\": \"<string>\",\n \"id_token\": \"<string>\",\n \"access_token\": \"<string>\",\n \"refresh_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.superbox.ai/api/v1/auth/login")
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 \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"provider\": \"<string>\",\n \"id_token\": \"<string>\",\n \"access_token\": \"<string>\",\n \"refresh_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id_token": "<string>",
"refresh_token": "<string>",
"expires_in": 123,
"email": "<string>",
"local_id": "<string>"
}Auth API
Login
Authenticate with email and password or an OAuth provider
POST
/
api
/
v1
/
auth
/
login
Login
curl --request POST \
--url https://api.superbox.ai/api/v1/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>",
"provider": "<string>",
"id_token": "<string>",
"access_token": "<string>",
"refresh_token": "<string>"
}
'import requests
url = "https://api.superbox.ai/api/v1/auth/login"
payload = {
"email": "<string>",
"password": "<string>",
"provider": "<string>",
"id_token": "<string>",
"access_token": "<string>",
"refresh_token": "<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({
email: '<string>',
password: '<string>',
provider: '<string>',
id_token: '<string>',
access_token: '<string>',
refresh_token: '<string>'
})
};
fetch('https://api.superbox.ai/api/v1/auth/login', 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.superbox.ai/api/v1/auth/login",
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([
'email' => '<string>',
'password' => '<string>',
'provider' => '<string>',
'id_token' => '<string>',
'access_token' => '<string>',
'refresh_token' => '<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.superbox.ai/api/v1/auth/login"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"provider\": \"<string>\",\n \"id_token\": \"<string>\",\n \"access_token\": \"<string>\",\n \"refresh_token\": \"<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.superbox.ai/api/v1/auth/login")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"provider\": \"<string>\",\n \"id_token\": \"<string>\",\n \"access_token\": \"<string>\",\n \"refresh_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.superbox.ai/api/v1/auth/login")
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 \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"provider\": \"<string>\",\n \"id_token\": \"<string>\",\n \"access_token\": \"<string>\",\n \"refresh_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id_token": "<string>",
"refresh_token": "<string>",
"expires_in": 123,
"email": "<string>",
"local_id": "<string>"
}Email / Password Login
Endpoint
POST /api/v1/auth/login
Request Body
string
required
Registered email address
string
required
Account password
Example Request
curl -X POST https://api.superbox.ai/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "SecurePass123!"
}'
const response = await fetch("https://api.superbox.ai/api/v1/auth/login", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
email: "user@example.com",
password: "SecurePass123!",
}),
});
const data = await response.json();
import requests
response = requests.post(
"https://api.superbox.ai/api/v1/auth/login",
json={
"email": "user@example.com",
"password": "SecurePass123!",
},
)
data = response.json()
Provider Login (Google / GitHub)
Exchange a Firebase-issued ID token or OAuth access token.Endpoint
POST /api/v1/auth/login/provider
Request Body
string
required
OAuth provider:
google or githubstring
Firebase ID token obtained from the provider. Use this OR
access_token.string
OAuth access token from the provider. Use this OR
id_token.Example Request
curl -X POST https://api.superbox.ai/api/v1/auth/login/provider \
-H "Content-Type: application/json" \
-d '{
"provider": "google",
"id_token": "<firebase-google-id-token>"
}'
Response
Both endpoints return the same response shape.string
Firebase ID token (JWT). Use as
Authorization: Bearer <id_token>.string
Refresh token. Use with
/auth/refresh to get a new ID token.number
Seconds until the ID token expires (3600 = 1 hour).
string
Authenticated email address.
string
Firebase user ID.
Success Response (200)
{
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6...",
"refresh_token": "AMf-vByW3...",
"expires_in": 3600,
"email": "user@example.com",
"local_id": "abc123def456"
}
Error Responses
{
"status": "error",
"detail": "Invalid email or password"
}
{
"status": "error",
"detail": "Invalid request: email is required"
}
Token Refresh
Use the refresh token to obtain a new ID token before the current one expires.Endpoint
POST /api/v1/auth/refresh
Request Body
string
required
Refresh token from a previous login or register response
Example
curl -X POST https://api.superbox.ai/api/v1/auth/refresh \
-H "Content-Type: application/json" \
-d '{"refresh_token": "AMf-vByW3..."}'
Using the Token
Include theid_token in all authenticated API requests:
curl https://api.superbox.ai/api/v1/servers \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6..."