curl --request POST \
--url https://api.botshield.ai/operations/sdk/confirm-link \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "<string>",
"partner_user_ref": "<string>",
"partner_user_id": "<string>"
}
'import requests
url = "https://api.botshield.ai/operations/sdk/confirm-link"
payload = {
"request_id": "<string>",
"partner_user_ref": "<string>",
"partner_user_id": "<string>"
}
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({
request_id: '<string>',
partner_user_ref: '<string>',
partner_user_id: '<string>'
})
};
fetch('https://api.botshield.ai/operations/sdk/confirm-link', 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.botshield.ai/operations/sdk/confirm-link",
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([
'request_id' => '<string>',
'partner_user_ref' => '<string>',
'partner_user_id' => '<string>'
]),
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.botshield.ai/operations/sdk/confirm-link"
payload := strings.NewReader("{\n \"request_id\": \"<string>\",\n \"partner_user_ref\": \"<string>\",\n \"partner_user_id\": \"<string>\"\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.botshield.ai/operations/sdk/confirm-link")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"request_id\": \"<string>\",\n \"partner_user_ref\": \"<string>\",\n \"partner_user_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.botshield.ai/operations/sdk/confirm-link")
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 \"request_id\": \"<string>\",\n \"partner_user_ref\": \"<string>\",\n \"partner_user_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"data": {
"linked": true,
"state": "live",
"first_time": true,
"request_id": "<string>",
"handle": "<string>",
"trusted": true,
"trusted_since": "2023-11-07T05:31:56Z",
"verification_token": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>",
"statusCode": 123
}
}
}Confirm a link that waits for your server
Confirms, from your server, a link that is waiting for it. A link waits when the key that started it has A link waits for my server’s confirm on (Console → Settings → Developer Tools; on by default for keys made since 4.0): the person taps and confirms with their passkey, account.link_pending fires, and the link goes live only when your server names the account.
Call with your secret API key and the account your own signed-in session shows. The same account the link was started for makes it live: account.secured fires and this response carries the finished token, the only place it is returned. Another account is refused (link_account_mismatch) and the waiting link is dropped. A link not confirmed within 24 hours expires (link_expired). Confirming a live link again with the same account answers live again, with first_time: false and no second webhook.
You can also confirm by sending partner_user_ref to POST /sdk/verify-token with the waiting token.
curl --request POST \
--url https://api.botshield.ai/operations/sdk/confirm-link \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "<string>",
"partner_user_ref": "<string>",
"partner_user_id": "<string>"
}
'import requests
url = "https://api.botshield.ai/operations/sdk/confirm-link"
payload = {
"request_id": "<string>",
"partner_user_ref": "<string>",
"partner_user_id": "<string>"
}
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({
request_id: '<string>',
partner_user_ref: '<string>',
partner_user_id: '<string>'
})
};
fetch('https://api.botshield.ai/operations/sdk/confirm-link', 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.botshield.ai/operations/sdk/confirm-link",
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([
'request_id' => '<string>',
'partner_user_ref' => '<string>',
'partner_user_id' => '<string>'
]),
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.botshield.ai/operations/sdk/confirm-link"
payload := strings.NewReader("{\n \"request_id\": \"<string>\",\n \"partner_user_ref\": \"<string>\",\n \"partner_user_id\": \"<string>\"\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.botshield.ai/operations/sdk/confirm-link")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"request_id\": \"<string>\",\n \"partner_user_ref\": \"<string>\",\n \"partner_user_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.botshield.ai/operations/sdk/confirm-link")
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 \"request_id\": \"<string>\",\n \"partner_user_ref\": \"<string>\",\n \"partner_user_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"data": {
"linked": true,
"state": "live",
"first_time": true,
"request_id": "<string>",
"handle": "<string>",
"trusted": true,
"trusted_since": "2023-11-07T05:31:56Z",
"verification_token": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>",
"statusCode": 123
}
}
}Authorizations
Your secret API key (bs_dev_… for development, bs_production_… for production), or a site key (pk_test_… / pk_live_…) when calling from an allowed origin. The Verified Accounts operations take the secret API key only and refuse site keys. Create keys in the Console under Settings → Developer Tools.
Body
Response
Result. Errors arrive here (HTTP 200) as data.error with code, message and statusCode: secret_key_required (401), invalid_key (401), account_required (400), link_not_found (404 — no waiting link with this id for your organization), environment_mismatch (403), link_account_mismatch (403 — nothing linked, the waiting link is dropped), link_expired (410), link_refused (409), rebind_requires_prior_id (409), already_trusted (409; reason_name: account_limit_reached when your account limit refused it), unavailable (503 — retry).
