List Invitations
curl --request GET \
--url https://api.bunship.com/api/v1/organizations/{orgId}/invitations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bunship.com/api/v1/organizations/{orgId}/invitations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bunship.com/api/v1/organizations/{orgId}/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://api.bunship.com/api/v1/organizations/{orgId}/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://api.bunship.com/api/v1/organizations/{orgId}/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://api.bunship.com/api/v1/organizations/{orgId}/invitations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunship.com/api/v1/organizations/{orgId}/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{
"invitations": [
{
"id": "inv_abc123",
"organizationId": "org_cld2abc123def456",
"email": "newmember@example.com",
"role": "member",
"invitedBy": {
"id": "usr_cld2abc123def456",
"email": "owner@example.com",
"fullName": "John Doe"
},
"expiresAt": "2024-01-22T10:00:00Z",
"createdAt": "2024-01-15T10:00:00Z",
"status": "pending"
}
],
"total": 1
}
Invitations
List Invitations
List pending invitations for the organization
GET
/
api
/
v1
/
organizations
/
{orgId}
/
invitations
List Invitations
curl --request GET \
--url https://api.bunship.com/api/v1/organizations/{orgId}/invitations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bunship.com/api/v1/organizations/{orgId}/invitations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bunship.com/api/v1/organizations/{orgId}/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://api.bunship.com/api/v1/organizations/{orgId}/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://api.bunship.com/api/v1/organizations/{orgId}/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://api.bunship.com/api/v1/organizations/{orgId}/invitations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunship.com/api/v1/organizations/{orgId}/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{
"invitations": [
{
"id": "inv_abc123",
"organizationId": "org_cld2abc123def456",
"email": "newmember@example.com",
"role": "member",
"invitedBy": {
"id": "usr_cld2abc123def456",
"email": "owner@example.com",
"fullName": "John Doe"
},
"expiresAt": "2024-01-22T10:00:00Z",
"createdAt": "2024-01-15T10:00:00Z",
"status": "pending"
}
],
"total": 1
}
Returns all pending invitations for the organization, including the inviter’s details and current status. Requires the
invitations:read permission.
Auth
Requires a valid Bearer token with
invitations:read permission.Path Parameters
Organization identifier.
Response
Array of invitation objects.
Show invitation properties
Show invitation properties
Invitation identifier.
Organization identifier.
Invited email address.
Assigned role:
"owner", "admin", "member", or "viewer".Inviter profile with
id, email, and fullName.ISO 8601 expiration timestamp.
ISO 8601 creation timestamp.
"pending", "accepted", or "expired".Total number of invitations.
{
"invitations": [
{
"id": "inv_abc123",
"organizationId": "org_cld2abc123def456",
"email": "newmember@example.com",
"role": "member",
"invitedBy": {
"id": "usr_cld2abc123def456",
"email": "owner@example.com",
"fullName": "John Doe"
},
"expiresAt": "2024-01-22T10:00:00Z",
"createdAt": "2024-01-15T10:00:00Z",
"status": "pending"
}
],
"total": 1
}
Errors
| Status | Code | Description |
|---|---|---|
401 | AUTHENTICATION_ERROR | Missing or invalid Bearer token |
403 | AUTHORIZATION_ERROR | Insufficient permissions (invitations:read required) |
404 | NOT_FOUND | Organization not found |
Example
curl https://api.bunship.com/api/v1/organizations/org_cld2abc123def456/invitations \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
⌘I

