Complete agent authentication callback
curl --request POST \
--url https://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback \
--header 'Content-Type: application/json' \
--data '
{
"signature": "<string>",
"address": "<string>",
"nonce": "<string>",
"keyName": "<string>"
}
'import requests
url = "https://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback"
payload = {
"signature": "<string>",
"address": "<string>",
"nonce": "<string>",
"keyName": "<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({
signature: '<string>',
address: '<string>',
nonce: '<string>',
keyName: '<string>'
})
};
fetch('https://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback', 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://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback",
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([
'signature' => '<string>',
'address' => '<string>',
'nonce' => '<string>',
'keyName' => '<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://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback"
payload := strings.NewReader("{\n \"signature\": \"<string>\",\n \"address\": \"<string>\",\n \"nonce\": \"<string>\",\n \"keyName\": \"<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://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"<string>\",\n \"address\": \"<string>\",\n \"nonce\": \"<string>\",\n \"keyName\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback")
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 \"signature\": \"<string>\",\n \"address\": \"<string>\",\n \"nonce\": \"<string>\",\n \"keyName\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"response": {
"apiKey": "<string>",
"keyId": "<string>",
"isSignup": true
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Agent
Complete Agent Authentication Callback
Submit either a wallet signature callback payload or an MFA callback payload to receive an API key.
POST
/
agent
/
v2
/
auth
/
callback
Complete agent authentication callback
curl --request POST \
--url https://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback \
--header 'Content-Type: application/json' \
--data '
{
"signature": "<string>",
"address": "<string>",
"nonce": "<string>",
"keyName": "<string>"
}
'import requests
url = "https://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback"
payload = {
"signature": "<string>",
"address": "<string>",
"nonce": "<string>",
"keyName": "<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({
signature: '<string>',
address: '<string>',
nonce: '<string>',
keyName: '<string>'
})
};
fetch('https://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback', 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://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback",
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([
'signature' => '<string>',
'address' => '<string>',
'nonce' => '<string>',
'keyName' => '<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://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback"
payload := strings.NewReader("{\n \"signature\": \"<string>\",\n \"address\": \"<string>\",\n \"nonce\": \"<string>\",\n \"keyName\": \"<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://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"<string>\",\n \"address\": \"<string>\",\n \"nonce\": \"<string>\",\n \"keyName\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api-v2.bags.fm/api/v1/agent/v2/auth/callback")
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 \"signature\": \"<string>\",\n \"address\": \"<string>\",\n \"nonce\": \"<string>\",\n \"keyName\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"response": {
"apiKey": "<string>",
"keyId": "<string>",
"isSignup": true
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Body
application/json
- Option 1
- Option 2
Base58-encoded Ed25519 signature of the decoded challenge message bytes
Solana wallet public key (base58) used to create the signature
Nonce returned by /agent/v2/auth/init
Human-readable label for the API key to be created
⌘I
