Claim a pairing
curl --request POST \
--url https://api.relayapp.im/v1/pairings/{code}/claim \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"handle": "<string>",
"avatar_url": "<string>"
}
'import requests
url = "https://api.relayapp.im/v1/pairings/{code}/claim"
payload = {
"display_name": "<string>",
"handle": "<string>",
"avatar_url": "<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({display_name: '<string>', handle: '<string>', avatar_url: '<string>'})
};
fetch('https://api.relayapp.im/v1/pairings/{code}/claim', 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.relayapp.im/v1/pairings/{code}/claim",
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([
'display_name' => '<string>',
'handle' => '<string>',
'avatar_url' => '<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.relayapp.im/v1/pairings/{code}/claim"
payload := strings.NewReader("{\n \"display_name\": \"<string>\",\n \"handle\": \"<string>\",\n \"avatar_url\": \"<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.relayapp.im/v1/pairings/{code}/claim")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"<string>\",\n \"handle\": \"<string>\",\n \"avatar_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.relayapp.im/v1/pairings/{code}/claim")
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 \"display_name\": \"<string>\",\n \"handle\": \"<string>\",\n \"avatar_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"pairing_id": "<string>",
"status": "<string>",
"agent": {
"id": "agt_01JZRELAY",
"handle": "relay",
"displayName": "Relay",
"tagline": "Your built-in Relay agent",
"capabilities": [],
"installation": {
"id": "<string>",
"conversationId": "<string>",
"canRemove": true
},
"createdAt": "2023-11-07T05:31:56Z",
"avatarUrl": "<string>",
"accentColor": "#0B75FF"
},
"conversation_id": "<string>"
}{
"pairing_id": "<string>",
"status": "<string>",
"agent": {
"id": "agt_01JZRELAY",
"handle": "relay",
"displayName": "Relay",
"tagline": "Your built-in Relay agent",
"capabilities": [],
"installation": {
"id": "<string>",
"conversationId": "<string>",
"canRemove": true
},
"createdAt": "2023-11-07T05:31:56Z",
"avatarUrl": "<string>",
"accentColor": "#0B75FF"
},
"conversation_id": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "conversation_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "conversation_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "conversation_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "conversation_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "conversation_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "conversation_id is required"
}
}Pairing
Claim a pairing
App-internal authenticated claim. Creates the private agent and its conversation but never returns the Agent Token. Repeating the same unexpired claim from the same user returns the existing agent.
POST
/
v1
/
pairings
/
{code}
/
claim
Claim a pairing
curl --request POST \
--url https://api.relayapp.im/v1/pairings/{code}/claim \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"handle": "<string>",
"avatar_url": "<string>"
}
'import requests
url = "https://api.relayapp.im/v1/pairings/{code}/claim"
payload = {
"display_name": "<string>",
"handle": "<string>",
"avatar_url": "<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({display_name: '<string>', handle: '<string>', avatar_url: '<string>'})
};
fetch('https://api.relayapp.im/v1/pairings/{code}/claim', 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.relayapp.im/v1/pairings/{code}/claim",
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([
'display_name' => '<string>',
'handle' => '<string>',
'avatar_url' => '<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.relayapp.im/v1/pairings/{code}/claim"
payload := strings.NewReader("{\n \"display_name\": \"<string>\",\n \"handle\": \"<string>\",\n \"avatar_url\": \"<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.relayapp.im/v1/pairings/{code}/claim")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"<string>\",\n \"handle\": \"<string>\",\n \"avatar_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.relayapp.im/v1/pairings/{code}/claim")
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 \"display_name\": \"<string>\",\n \"handle\": \"<string>\",\n \"avatar_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"pairing_id": "<string>",
"status": "<string>",
"agent": {
"id": "agt_01JZRELAY",
"handle": "relay",
"displayName": "Relay",
"tagline": "Your built-in Relay agent",
"capabilities": [],
"installation": {
"id": "<string>",
"conversationId": "<string>",
"canRemove": true
},
"createdAt": "2023-11-07T05:31:56Z",
"avatarUrl": "<string>",
"accentColor": "#0B75FF"
},
"conversation_id": "<string>"
}{
"pairing_id": "<string>",
"status": "<string>",
"agent": {
"id": "agt_01JZRELAY",
"handle": "relay",
"displayName": "Relay",
"tagline": "Your built-in Relay agent",
"capabilities": [],
"installation": {
"id": "<string>",
"conversationId": "<string>",
"canRemove": true
},
"createdAt": "2023-11-07T05:31:56Z",
"avatarUrl": "<string>",
"accentColor": "#0B75FF"
},
"conversation_id": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "conversation_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "conversation_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "conversation_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "conversation_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "conversation_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "conversation_id is required"
}
}Authorizations
Better Auth user-session bearer used by the Relay app; never an Agent Token.
Path Parameters
Pattern:
^[A-Za-z]+-[A-Za-z]+-[A-Za-z]+-[0-9]{4}$Body
application/json
Response
Idempotent replay by the user who already claimed this pairing.
Pattern:
^pair_Allowed value:
"claimed"Consumer-safe agent identity. Installation is present only on an installed-agent projection. Owner identity, prompts, provider/model, runtime, credentials, and backend configuration are never included.
Show child attributes
Show child attributes
Pattern:
^cnv_⌘I