Propose a group
curl --request POST \
--url https://api.relayapp.im/v1/groups/invites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"title": "<string>",
"user_ids": [
"<string>"
],
"reason": "<string>",
"conversation_id": "<string>",
"ttl_seconds": 259200
}
'import requests
url = "https://api.relayapp.im/v1/groups/invites"
payload = {
"title": "<string>",
"user_ids": ["<string>"],
"reason": "<string>",
"conversation_id": "<string>",
"ttl_seconds": 259200
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: '<string>',
user_ids: ['<string>'],
reason: '<string>',
conversation_id: '<string>',
ttl_seconds: 259200
})
};
fetch('https://api.relayapp.im/v1/groups/invites', 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/groups/invites",
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([
'title' => '<string>',
'user_ids' => [
'<string>'
],
'reason' => '<string>',
'conversation_id' => '<string>',
'ttl_seconds' => 259200
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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/groups/invites"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"user_ids\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"ttl_seconds\": 259200\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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/groups/invites")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"user_ids\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"ttl_seconds\": 259200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.relayapp.im/v1/groups/invites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"user_ids\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"ttl_seconds\": 259200\n}"
response = http.request(request)
puts response.read_body{
"invite": {
"id": "<string>",
"title": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"members": [
{
"user_id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
}
],
"reason": "<string>",
"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"
}
}Groups
Propose a group
Ask verified users who have installed the authenticated agent to join a new group or an existing group that already contains the agent. Relay commits one consent card into each target’s direct conversation with the agent. The agent never changes membership directly; Relay completes the group only after every target accepts. Invites have no decline state and expire automatically.
POST
/
v1
/
groups
/
invites
Propose a group
curl --request POST \
--url https://api.relayapp.im/v1/groups/invites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"title": "<string>",
"user_ids": [
"<string>"
],
"reason": "<string>",
"conversation_id": "<string>",
"ttl_seconds": 259200
}
'import requests
url = "https://api.relayapp.im/v1/groups/invites"
payload = {
"title": "<string>",
"user_ids": ["<string>"],
"reason": "<string>",
"conversation_id": "<string>",
"ttl_seconds": 259200
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: '<string>',
user_ids: ['<string>'],
reason: '<string>',
conversation_id: '<string>',
ttl_seconds: 259200
})
};
fetch('https://api.relayapp.im/v1/groups/invites', 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/groups/invites",
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([
'title' => '<string>',
'user_ids' => [
'<string>'
],
'reason' => '<string>',
'conversation_id' => '<string>',
'ttl_seconds' => 259200
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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/groups/invites"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"user_ids\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"ttl_seconds\": 259200\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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/groups/invites")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"user_ids\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"ttl_seconds\": 259200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.relayapp.im/v1/groups/invites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"user_ids\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"ttl_seconds\": 259200\n}"
response = http.request(request)
puts response.read_body{
"invite": {
"id": "<string>",
"title": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"members": [
{
"user_id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
}
],
"reason": "<string>",
"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"
}
}Authorizations
Agent Token (rly_live_…), shown once at agent creation.
Headers
Deriving it from the triggering event_id makes a retry safe.
Required string length:
8 - 255Body
application/json
Required string length:
1 - 100Pattern:
.*\S.*Required array length:
1 - 24 elementsPattern:
^usr_Required string length:
1 - 200Pattern:
.*\S.*Existing group in which the authenticated agent is active. Omit to propose a new group.
Pattern:
^cnv_Requested lifetime in seconds. Relay clamps it to 600 through 604800.
Response
Invite created, or the original response for an idempotent replay.
Show child attributes
Show child attributes
⌘I