Accept Invitation
curl --request POST \
--url https://api.bunship.com/api/v1/invitations/{token}/accept \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bunship.com/api/v1/invitations/{token}/accept"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bunship.com/api/v1/invitations/{token}/accept', 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/invitations/{token}/accept",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/invitations/{token}/accept"
req, _ := http.NewRequest("POST", 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.post("https://api.bunship.com/api/v1/invitations/{token}/accept")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunship.com/api/v1/invitations/{token}/accept")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Invitation accepted successfully",
"organization": {
"id": "org_cld2abc123def456",
"name": "Acme Corp",
"slug": "acme-corp"
}
}
Invitations
Accept Invitation
Accept an organization invitation
POST
/
api
/
v1
/
invitations
/
{token}
/
accept
Accept Invitation
curl --request POST \
--url https://api.bunship.com/api/v1/invitations/{token}/accept \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bunship.com/api/v1/invitations/{token}/accept"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bunship.com/api/v1/invitations/{token}/accept', 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/invitations/{token}/accept",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/invitations/{token}/accept"
req, _ := http.NewRequest("POST", 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.post("https://api.bunship.com/api/v1/invitations/{token}/accept")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunship.com/api/v1/invitations/{token}/accept")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Invitation accepted successfully",
"organization": {
"id": "org_cld2abc123def456",
"name": "Acme Corp",
"slug": "acme-corp"
}
}
Accepts an invitation using the token from the invite link. The authenticated user must be logged in with the same email address as the invitation. On success, a new membership is created with the role specified in the invitation.
Auth
Requires a valid Bearer token. The authenticated user’s email must match the invitation email.
Path Parameters
string
required
Invitation token from the invite URL.
Response
string
Confirmation message.
object
{
"message": "Invitation accepted successfully",
"organization": {
"id": "org_cld2abc123def456",
"name": "Acme Corp",
"slug": "acme-corp"
}
}
Errors
| Status | Code | Description |
|---|---|---|
400 | VALIDATION_ERROR | Invitation is expired, email mismatch, or organization no longer exists |
401 | AUTHENTICATION_ERROR | Not authenticated — must sign up or log in first |
404 | NOT_FOUND | Invalid or already-used invitation token |
409 | CONFLICT | User is already a member of this organization |
Example
curl -X POST https://api.bunship.com/api/v1/invitations/tok_abc123def456.../accept \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

