curl --request POST \
--url https://api.useanima.sh/v1/agent/elevate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"otp_code": "<string>",
"grant": "<string>",
"enroll": true
}
'import requests
url = "https://api.useanima.sh/v1/agent/elevate"
payload = {
"otp_code": "<string>",
"grant": "<string>",
"enroll": True
}
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({otp_code: '<string>', grant: '<string>', enroll: true})
};
fetch('https://api.useanima.sh/v1/agent/elevate', 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.useanima.sh/v1/agent/elevate",
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([
'otp_code' => '<string>',
'grant' => '<string>',
'enroll' => true
]),
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.useanima.sh/v1/agent/elevate"
payload := strings.NewReader("{\n \"otp_code\": \"<string>\",\n \"grant\": \"<string>\",\n \"enroll\": true\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.useanima.sh/v1/agent/elevate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"otp_code\": \"<string>\",\n \"grant\": \"<string>\",\n \"enroll\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/agent/elevate")
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 \"otp_code\": \"<string>\",\n \"grant\": \"<string>\",\n \"enroll\": true\n}"
response = http.request(request)
puts response.read_body{
"api_key": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"api_key_id": "<string>",
"grant": "<string>",
"grant_expires_at": "2023-11-07T05:31:56Z"
}Post agentelevate
curl --request POST \
--url https://api.useanima.sh/v1/agent/elevate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"otp_code": "<string>",
"grant": "<string>",
"enroll": true
}
'import requests
url = "https://api.useanima.sh/v1/agent/elevate"
payload = {
"otp_code": "<string>",
"grant": "<string>",
"enroll": True
}
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({otp_code: '<string>', grant: '<string>', enroll: true})
};
fetch('https://api.useanima.sh/v1/agent/elevate', 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.useanima.sh/v1/agent/elevate",
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([
'otp_code' => '<string>',
'grant' => '<string>',
'enroll' => true
]),
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.useanima.sh/v1/agent/elevate"
payload := strings.NewReader("{\n \"otp_code\": \"<string>\",\n \"grant\": \"<string>\",\n \"enroll\": true\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.useanima.sh/v1/agent/elevate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"otp_code\": \"<string>\",\n \"grant\": \"<string>\",\n \"enroll\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/agent/elevate")
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 \"otp_code\": \"<string>\",\n \"grant\": \"<string>\",\n \"enroll\": true\n}"
response = http.request(request)
puts response.read_body{
"api_key": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"api_key_id": "<string>",
"grant": "<string>",
"grant_expires_at": "2023-11-07T05:31:56Z"
}Authorizations
JWT Bearer token obtained from authentication. Pass as: Authorization: Bearer
Body
Step-up parameters
The 6-digit code emailed to the owner by /agent/elevate/request
1An owner grant from a previous enrolment, used instead of an emailed code. The caller is expected to have kept it behind a local human-presence gate.
1Also return a durable owner grant, so later step-ups on this machine need no email. Honoured only when authorising with otp_code — a grant cannot mint its successor.
Response
OK
Short-lived master credential
Short-lived key with master capability. Shown once; store it now.
When the key stops working
Id of the issued key, for revoking it early
Durable owner grant. Shown once; store it behind a human-presence gate.
When the grant stops being accepted and an emailed code is needed again
