List organization invitations
curl --request GET \
--url https://asteragents.com/api/admin/invitations \
--header 'Authorization: Bearer <token>'import requests
url = "https://asteragents.com/api/admin/invitations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://asteragents.com/api/admin/invitations', 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://asteragents.com/api/admin/invitations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://asteragents.com/api/admin/invitations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://asteragents.com/api/admin/invitations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://asteragents.com/api/admin/invitations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "orginv_2ABC123DEF",
"emailAddress": "newuser@company.com",
"role": "org:member",
"status": "pending",
"publicMetadata": {
"department": "sales"
},
"createdAt": 1705363800000,
"updatedAt": 1705363800000
},
{
"id": "orginv_2XYZ789GHI",
"emailAddress": "admin@company.com",
"role": "org:admin",
"status": "pending",
"publicMetadata": null,
"createdAt": 1705276800000,
"updatedAt": 1705276800000
}
],
"totalCount": 2
}{
"error": "User is not part of any organization"
}{
"error": "Unauthorized: User is not an admin in this organization"
}{
"error": "Internal Server Error"
}Admin API
List organization invitations
Retrieve a paginated list of organization invitations.
By default, only shows pending invitations. Use the status parameter
to filter by different statuses or see historical invitations.
GET
/
admin
/
invitations
List organization invitations
curl --request GET \
--url https://asteragents.com/api/admin/invitations \
--header 'Authorization: Bearer <token>'import requests
url = "https://asteragents.com/api/admin/invitations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://asteragents.com/api/admin/invitations', 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://asteragents.com/api/admin/invitations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://asteragents.com/api/admin/invitations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://asteragents.com/api/admin/invitations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://asteragents.com/api/admin/invitations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "orginv_2ABC123DEF",
"emailAddress": "newuser@company.com",
"role": "org:member",
"status": "pending",
"publicMetadata": {
"department": "sales"
},
"createdAt": 1705363800000,
"updatedAt": 1705363800000
},
{
"id": "orginv_2XYZ789GHI",
"emailAddress": "admin@company.com",
"role": "org:admin",
"status": "pending",
"publicMetadata": null,
"createdAt": 1705276800000,
"updatedAt": 1705276800000
}
],
"totalCount": 2
}{
"error": "User is not part of any organization"
}{
"error": "Unauthorized: User is not an admin in this organization"
}{
"error": "Internal Server Error"
}Authorizations
JWT token from Clerk authentication.
Must be from a user with org:admin role.
Query Parameters
Number of results to return
Required range:
1 <= x <= 500Number of results to skip for pagination
Required range:
x >= 0Comma-separated list of statuses to filter by
⌘I