curl --request POST \
--url https://api.ionworks.com/projects/{project_id}/invites \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"project_role_id": "<string>"
}
'import requests
url = "https://api.ionworks.com/projects/{project_id}/invites"
payload = {
"email": "<string>",
"project_role_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: '<string>', project_role_id: '<string>'})
};
fetch('https://api.ionworks.com/projects/{project_id}/invites', 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.ionworks.com/projects/{project_id}/invites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'project_role_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ionworks.com/projects/{project_id}/invites"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"project_role_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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.ionworks.com/projects/{project_id}/invites")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"project_role_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ionworks.com/projects/{project_id}/invites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"project_role_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"user_id": "<string>",
"invite_sent": true,
"already_member": false,
"role_name": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Invite a user to a project by email
Invite someone to a project by email, whatever their organization status.
Unlike POST /{project_id}/members, the invitee need not already belong to
the organization: an unregistered email is invited, and a non-member is granted
Member. An existing member keeps the organization role they already hold.
Requires role:assign, not merely project:manage_members — minting an
organization membership is an org-level grant however project-shaped the
request looks.
Returns
AddUserByEmailResult
The invitee’s user id, and invite_sent — False when the address
already belonged to a registered account, so no email was dispatched.
curl --request POST \
--url https://api.ionworks.com/projects/{project_id}/invites \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"project_role_id": "<string>"
}
'import requests
url = "https://api.ionworks.com/projects/{project_id}/invites"
payload = {
"email": "<string>",
"project_role_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: '<string>', project_role_id: '<string>'})
};
fetch('https://api.ionworks.com/projects/{project_id}/invites', 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.ionworks.com/projects/{project_id}/invites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'project_role_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ionworks.com/projects/{project_id}/invites"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"project_role_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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.ionworks.com/projects/{project_id}/invites")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"project_role_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ionworks.com/projects/{project_id}/invites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"project_role_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"user_id": "<string>",
"invite_sent": true,
"already_member": false,
"role_name": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Body
Response
Successful Response
Result of adding a user to an organization by email.
Returned by the service and used verbatim as the route's response model.
ID of the (invited or pre-existing) user that was added.
True when the email was not registered yet and an invitation email was dispatched. False when the email already belonged to a registered user, in which case the existing account was linked and no email was sent.
True when the user already belonged to the organization. Their membership, including its role, was left unchanged.
Organization role the user holds after the request, when the endpoint reports it.
Was this page helpful?