cURL
curl --request DELETE \
--url https://api.nekt.ai/api/v1/workspace/invitations/{id}/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.nekt.ai/api/v1/workspace/invitations/{id}/"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.nekt.ai/api/v1/workspace/invitations/{id}/', 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.nekt.ai/api/v1/workspace/invitations/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.nekt.ai/api/v1/workspace/invitations/{id}/"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.nekt.ai/api/v1/workspace/invitations/{id}/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nekt.ai/api/v1/workspace/invitations/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyWorkspace invitations
Revoke a Workspace Invitation
Cancel an invitation that was issued in your current workspace and reaches no other.
DELETE
/
api
/
v1
/
workspace
/
invitations
/
{id}
/
cURL
curl --request DELETE \
--url https://api.nekt.ai/api/v1/workspace/invitations/{id}/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.nekt.ai/api/v1/workspace/invitations/{id}/"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.nekt.ai/api/v1/workspace/invitations/{id}/', 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.nekt.ai/api/v1/workspace/invitations/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.nekt.ai/api/v1/workspace/invitations/{id}/"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.nekt.ai/api/v1/workspace/invitations/{id}/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nekt.ai/api/v1/workspace/invitations/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyRevokes an invitation from the workspace side. Revoking takes the invitee out of the organization, so a workspace admin can only revoke an invitation that stays entirely inside their workspace: one issued in this workspace, whose invitee is in no other workspace.
Revoking removes the invitee’s pending membership with every group and grant it carries. If the invitation was the only reason that person existed in Nekt, the account is deleted too. This cannot be undone.
Shared invitations
When an invitation reaches beyond this workspace, the endpoint answers409 with the code invitation_shared. The List Workspace Invitations response flags these in advance with shared: true. An organization owner or admin revokes them through Revoke an Invitation.
Example
curl --request DELETE \
--url https://api.nekt.ai/api/v1/workspace/invitations/c1f0a9d4-5b62-4e18-9a73-2d8e4f6b0c51/ \
--header "x-api-key: YOUR_API_KEY"
Response
204 No Content.
Authentication
This endpoint requires an API key created by a workspace admin of the key’s workspace. Organization owners and admins are admins of every workspace.Errors
| Status | When |
|---|---|
403 | The key’s creator is not an admin of this workspace. |
404 | No outstanding invitation with that id is waiting in this workspace. |
409 | invitation_shared: the invitation was issued elsewhere, or the invitee is in another workspace too. |
Related
- List Workspace Invitations: where the
idandsharedcome from. - Revoke an Invitation: the organization-level revoke.
Was this page helpful?