Cancel Invitation
curl --request DELETE \
--url https://api.bunship.com/api/v1/organizations/{orgId}/invitations/{invitationId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bunship.com/api/v1/organizations/{orgId}/invitations/{invitationId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bunship.com/api/v1/organizations/{orgId}/invitations/{invitationId}', 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/{invitationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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/{invitationId}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.bunship.com/api/v1/organizations/{orgId}/invitations/{invitationId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunship.com/api/v1/organizations/{orgId}/invitations/{invitationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Invitation cancelled successfully"
}
Invitations
Cancel Invitation
Cancel a pending invitation
DELETE
/
api
/
v1
/
organizations
/
{orgId}
/
invitations
/
{invitationId}
Cancel Invitation
curl --request DELETE \
--url https://api.bunship.com/api/v1/organizations/{orgId}/invitations/{invitationId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bunship.com/api/v1/organizations/{orgId}/invitations/{invitationId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bunship.com/api/v1/organizations/{orgId}/invitations/{invitationId}', 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/{invitationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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/{invitationId}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.bunship.com/api/v1/organizations/{orgId}/invitations/{invitationId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunship.com/api/v1/organizations/{orgId}/invitations/{invitationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Invitation cancelled successfully"
}
Cancels a pending invitation. Already-accepted invitations cannot be cancelled. Requires the
invitations:delete permission.
Auth
Requires a valid Bearer token with
invitations:delete permission.Path Parameters
Organization identifier.
Invitation identifier.
Response
Confirmation message.
{
"message": "Invitation cancelled successfully"
}
Errors
| Status | Code | Description |
|---|---|---|
400 | VALIDATION_ERROR | Cannot cancel an already-accepted invitation |
401 | AUTHENTICATION_ERROR | Missing or invalid Bearer token |
403 | AUTHORIZATION_ERROR | Insufficient permissions (invitations:delete required) |
404 | NOT_FOUND | Invitation not found |
Example
curl -X DELETE https://api.bunship.com/api/v1/organizations/org_cld2abc123def456/invitations/inv_abc123 \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
⌘I

