Revoke invitation
Invitation link stops working. Only the owner key with team:manage permission.
DELETE /team/invitations/{id}
- Key Permission:
team:manage - Key: only live key sk_live (test key will get 403 test_key_cannot_buy)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | yes | Invitation number (the id field from the response). |
Important to know
- Only a production key with
team:managerights created by the account owner can modify the team. Other keys receive 403 (owner_key_required,insufficient_scope,test_key_cannot_buy). - Every action is logged in the account audit log and sent as notifications to owners and administrators.
Request example
curl -X DELETE https://api.shippickup.com/v1/team/invitations/2f9b6d0c8e1a4573b4c2a9e6d8 \
-H "Authorization: Bearer $SHIPPICKUP_API_KEY"<?php
$ch = curl_init('https://api.shippickup.com/v1/team/invitations/2f9b6d0c8e1a4573b4c2a9e6d8');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SHIPPICKUP_API_KEY'),
],
]);
$response = json_decode((string) curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
print_r([$status, $response]);
import os
import requests
r = requests.delete(
"https://api.shippickup.com/v1/team/invitations/2f9b6d0c8e1a4573b4c2a9e6d8",
headers={
"Authorization": "Bearer " + os.environ["SHIPPICKUP_API_KEY"],
},
timeout=30,
)
print(r.status_code, r.json())
const res = await fetch("https://api.shippickup.com/v1/team/invitations/2f9b6d0c8e1a4573b4c2a9e6d8", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.SHIPPICKUP_API_KEY}`,
},
});
console.log(res.status, await res.json());
Response example 200
JSON
{
"data": {
"id": "2f9b6d0c8e1a4573b4c2a9e6d8",
"revoked": true
}
}Possible errors
| HTTP | Code | Description |
|---|---|---|
| 403 | test_key_cannot_buy | Test key does not purchase labels or order pickups, use a live key. |
| 403 | owner_key_required | Командой может управлять только ключ, созданный владельцем аккаунта. |
| 404 | not_found | Object not found among your account's objects (order, address, invoice, webhook, member, or team invitation), or the order has no active pickup, or the method does not exist. Objects belonging to others appear as non-existent. |
| 403 | insufficient_scope | Key lacks the required permission, specified in error.details.required_scope. |
| 429 | rate_limited | Key request limit exceeded. Retry after the time specified in the Retry-After header. |