Add team member
curl --request POST \
--url https://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com"
}
'import requests
url = "https://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId}"
payload = { "email": "jsmith@example.com" }
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({email: 'jsmith@example.com'})
};
fetch('https://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId}', 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://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId}",
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' => 'jsmith@example.com'
]),
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://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId}"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\"\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://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId}")
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 \"email\": \"jsmith@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}Team Members
Add Team Member
POST
/
api
/
v2
/
admin
/
team-members
/
{tenantId}
Add team member
curl --request POST \
--url https://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com"
}
'import requests
url = "https://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId}"
payload = { "email": "jsmith@example.com" }
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({email: 'jsmith@example.com'})
};
fetch('https://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId}', 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://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId}",
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' => 'jsmith@example.com'
]),
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://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId}"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\"\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://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://faisalshop.mvp-apps.ae/api/v2/admin/team-members/{tenantId}")
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 \"email\": \"jsmith@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}Overview
Add a new or existing user to a tenant. If the user doesn’t exist, a new account will be created automatically.Authorization
- User must be authenticated with a valid Bearer token
- User must have ADMIN role in the specified tenant
Behavior
- If the email doesn’t exist in the system, creates a new user account
- If the user exists, adds them to the tenant with the specified role
- Sets
is_activeto true and updateslast_active_at - Fires a
UserRegisteredevent for webhook integrations
Validation Rules
email: Required, must be a valid email formatrole: Required, must be either “ADMIN” or “MEMBER”
Example Usage
curl -X POST \
https://faisalshop.mvp-apps.ae/api/v2/admin/team-members/1 \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"email": "newuser@example.com",
"role": "MEMBER"
}'
await axios.post(
`/api/v2/admin/team-members/${tenantId}`,
{
email: 'newuser@example.com',
role: 'MEMBER'
},
{
headers: { Authorization: `Bearer ${token}` }
}
);
Error Responses
Already a Member (400)
{
"error": "user@example.com is already a member of this Organization"
}
Validation Error (422)
{
"message": "The email field must be a valid email address.",
"errors": {
"email": ["The email field must be a valid email address."]
}
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Tenant ID
Body
application/json
Response
200 - application/json
Member added