curl --request POST \
--url https://api.wotnot.io/v1/accounts/{account_id}/user \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user": {
"email": "john.doe@gmail.com",
"first_name": "John",
"last_name": "Doe",
"role_id": "262185"
},
"notify_user": "true"
}
'import requests
url = "https://api.wotnot.io/v1/accounts/{account_id}/user"
payload = {
"user": {
"email": "john.doe@gmail.com",
"first_name": "John",
"last_name": "Doe",
"role_id": "262185"
},
"notify_user": "true"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user: {
email: 'john.doe@gmail.com',
first_name: 'John',
last_name: 'Doe',
role_id: '262185'
},
notify_user: 'true'
})
};
fetch('https://api.wotnot.io/v1/accounts/{account_id}/user', 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.wotnot.io/v1/accounts/{account_id}/user",
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([
'user' => [
'email' => 'john.doe@gmail.com',
'first_name' => 'John',
'last_name' => 'Doe',
'role_id' => '262185'
],
'notify_user' => 'true'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.wotnot.io/v1/accounts/{account_id}/user"
payload := strings.NewReader("{\n \"user\": {\n \"email\": \"john.doe@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"role_id\": \"262185\"\n },\n \"notify_user\": \"true\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.wotnot.io/v1/accounts/{account_id}/user")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user\": {\n \"email\": \"john.doe@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"role_id\": \"262185\"\n },\n \"notify_user\": \"true\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wotnot.io/v1/accounts/{account_id}/user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user\": {\n \"email\": \"john.doe@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"role_id\": \"262185\"\n },\n \"notify_user\": \"true\"\n}"
response = http.request(request)
puts response.read_body{
"invitation_link": "{{customer_portal_domain}}/create-your-account?invitation_key={{invitation_key}}",
"ok": true,
"status": "invited"
}{
"error": "BAD_REQUEST",
"ok": false,
"status": 400,
"message": [
{
"message": "\"user.email\" must be a valid email",
"path": [
"user",
"email"
]
}
]
}{
"error": "UNAUTHORIZED",
"ok": false,
"status": 401,
"message": "Invalid token. Provide the valid account token."
}{
"error": "ROLE_NOT_FOUND",
"ok": false,
"status": 404,
"message": "Role not found for this account."
}Invite user
Invites a user to your account with a role, and returns their invitation link.
curl --request POST \
--url https://api.wotnot.io/v1/accounts/{account_id}/user \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user": {
"email": "john.doe@gmail.com",
"first_name": "John",
"last_name": "Doe",
"role_id": "262185"
},
"notify_user": "true"
}
'import requests
url = "https://api.wotnot.io/v1/accounts/{account_id}/user"
payload = {
"user": {
"email": "john.doe@gmail.com",
"first_name": "John",
"last_name": "Doe",
"role_id": "262185"
},
"notify_user": "true"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user: {
email: 'john.doe@gmail.com',
first_name: 'John',
last_name: 'Doe',
role_id: '262185'
},
notify_user: 'true'
})
};
fetch('https://api.wotnot.io/v1/accounts/{account_id}/user', 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.wotnot.io/v1/accounts/{account_id}/user",
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([
'user' => [
'email' => 'john.doe@gmail.com',
'first_name' => 'John',
'last_name' => 'Doe',
'role_id' => '262185'
],
'notify_user' => 'true'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.wotnot.io/v1/accounts/{account_id}/user"
payload := strings.NewReader("{\n \"user\": {\n \"email\": \"john.doe@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"role_id\": \"262185\"\n },\n \"notify_user\": \"true\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.wotnot.io/v1/accounts/{account_id}/user")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user\": {\n \"email\": \"john.doe@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"role_id\": \"262185\"\n },\n \"notify_user\": \"true\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wotnot.io/v1/accounts/{account_id}/user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user\": {\n \"email\": \"john.doe@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"role_id\": \"262185\"\n },\n \"notify_user\": \"true\"\n}"
response = http.request(request)
puts response.read_body{
"invitation_link": "{{customer_portal_domain}}/create-your-account?invitation_key={{invitation_key}}",
"ok": true,
"status": "invited"
}{
"error": "BAD_REQUEST",
"ok": false,
"status": 400,
"message": [
{
"message": "\"user.email\" must be a valid email",
"path": [
"user",
"email"
]
}
]
}{
"error": "UNAUTHORIZED",
"ok": false,
"status": 401,
"message": "Invalid token. Provide the valid account token."
}{
"error": "ROLE_NOT_FOUND",
"ok": false,
"status": 404,
"message": "Role not found for this account."
}Authorizations
All of WotNot's APIs use Bearer token authentication. Send your account token as Bearer <token>. You can find it in Settings > Account Settings > Developer. Keep it on your server: anyone who has it can call the API as your account.
Path Parameters
The ID of your WotNot account.
Body
The user to invite and the role to give them.
Response
The user was invited. Returns their invitation_link and status.
The link the user opens to create their account. {{customer_portal_domain}} stands in for your portal's domain, and {{invitation_key}} for the user's invitation key.
"{{customer_portal_domain}}/create-your-account?invitation_key={{invitation_key}}"
true when the request worked. Errors return false.
true
The invitation's status, for example invited.
"invited"
Was this page helpful?