Update user subscription
curl --request POST \
--url https://api.justanotheruptime.com/admin/users/{userId}/subscription \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subscription": "pro"
}
'import requests
url = "https://api.justanotheruptime.com/admin/users/{userId}/subscription"
payload = { "subscription": "pro" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({subscription: 'pro'})
};
fetch('https://api.justanotheruptime.com/admin/users/{userId}/subscription', 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.justanotheruptime.com/admin/users/{userId}/subscription",
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([
'subscription' => 'pro'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.justanotheruptime.com/admin/users/{userId}/subscription"
payload := strings.NewReader("{\n \"subscription\": \"pro\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.justanotheruptime.com/admin/users/{userId}/subscription")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subscription\": \"pro\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.justanotheruptime.com/admin/users/{userId}/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscription\": \"pro\"\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"email": "user@example.com",
"firstName": "John",
"lastName": "Doe",
"roles": [
"user",
"admin"
],
"subscription": "pro",
"subscriptionStatus": "active",
"createdAt": "2025-01-01T00:00:00.000Z"
}Admin
Update user subscription
POST
/
admin
/
users
/
{userId}
/
subscription
Update user subscription
curl --request POST \
--url https://api.justanotheruptime.com/admin/users/{userId}/subscription \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subscription": "pro"
}
'import requests
url = "https://api.justanotheruptime.com/admin/users/{userId}/subscription"
payload = { "subscription": "pro" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({subscription: 'pro'})
};
fetch('https://api.justanotheruptime.com/admin/users/{userId}/subscription', 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.justanotheruptime.com/admin/users/{userId}/subscription",
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([
'subscription' => 'pro'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.justanotheruptime.com/admin/users/{userId}/subscription"
payload := strings.NewReader("{\n \"subscription\": \"pro\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.justanotheruptime.com/admin/users/{userId}/subscription")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subscription\": \"pro\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.justanotheruptime.com/admin/users/{userId}/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscription\": \"pro\"\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"email": "user@example.com",
"firstName": "John",
"lastName": "Doe",
"roles": [
"user",
"admin"
],
"subscription": "pro",
"subscriptionStatus": "active",
"createdAt": "2025-01-01T00:00:00.000Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the user to update
Body
application/json
New subscription details
Available options:
free, pro Example:
"pro"
Response
User subscription updated successfully
Example:
"123e4567-e89b-12d3-a456-426614174000"
Example:
"user@example.com"
Example:
"John"
Example:
"Doe"
Example:
["user", "admin"]
Available options:
free, pro Example:
"pro"
Example:
"active"
Example:
"2025-01-01T00:00:00.000Z"
⌘I