Skip to main content
POST
/
v1
/
auth
/
agent
Agent registration (auth.md)
curl --request POST \
  --url https://api.vidjutsu.ai/v1/auth/agent \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "anonymous",
  "requested_credential_type": "api_key"
}
'
import requests

url = "https://api.vidjutsu.ai/v1/auth/agent"

payload = {
"type": "anonymous",
"requested_credential_type": "api_key"
}
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({type: 'anonymous', requested_credential_type: 'api_key'})
};

fetch('https://api.vidjutsu.ai/v1/auth/agent', 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.vidjutsu.ai/v1/auth/agent",
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([
'type' => 'anonymous',
'requested_credential_type' => 'api_key'
]),
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.vidjutsu.ai/v1/auth/agent"

payload := strings.NewReader("{\n \"type\": \"anonymous\",\n \"requested_credential_type\": \"api_key\"\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.vidjutsu.ai/v1/auth/agent")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"anonymous\",\n \"requested_credential_type\": \"api_key\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.vidjutsu.ai/v1/auth/agent")

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 \"type\": \"anonymous\",\n \"requested_credential_type\": \"api_key\"\n}"

response = http.request(request)
puts response.read_body
{
  "registration_id": "<string>",
  "credential_type": "api_key",
  "credential": "<string>",
  "credential_expires": 123,
  "scopes": [
    "<string>"
  ],
  "post_claim_scopes": [
    "<string>"
  ],
  "claim_url": "<string>",
  "claim_token": "<string>",
  "claim_token_expires": 123
}

Body

application/json
type
enum<string>
required
Available options:
anonymous
requested_credential_type
enum<string>

Requested credential type. Currently only api_key is supported.

Available options:
api_key

Response

200 - application/json

The request has succeeded.

registration_id
string
required

Server-generated registration id (rgn_...).

registration_type
enum<string>
required

How the registration was initiated.

Available options:
anonymous,
email-verification
credential_type
enum<string>

Credential type returned, when issued immediately. Omitted on flows that require claim_token first.

Available options:
api_key
credential
string

Live credential (API key) issued by the server, when one is issued immediately.

credential_expires
integer<int64>

Unix epoch ms when the credential expires, or null/undefined for non-expiring keys.

scopes
string[]

Scopes the credential is authorized for at issue time.

post_claim_scopes
string[]

Scopes that will be added after the claim flow completes.

claim_url
string

URL the agent should direct the principal to in order to complete claim/verification.

claim_token
string

Opaque token used to complete the claim flow.

claim_token_expires
integer<int64>

Unix epoch ms when the claim_token expires.