Add a member to a workspace
curl --request POST \
--url https://v1.api.altostrat.io/workspaces/{workspaceId}/members \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "auth0|abcdef1234567890",
"role": "viewer"
}
'import requests
url = "https://v1.api.altostrat.io/workspaces/{workspaceId}/members"
payload = {
"user_id": "auth0|abcdef1234567890",
"role": "viewer"
}
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_id: 'auth0|abcdef1234567890', role: 'viewer'})
};
fetch('https://v1.api.altostrat.io/workspaces/{workspaceId}/members', 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://v1.api.altostrat.io/workspaces/{workspaceId}/members",
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_id' => 'auth0|abcdef1234567890',
'role' => 'viewer'
]),
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://v1.api.altostrat.io/workspaces/{workspaceId}/members"
payload := strings.NewReader("{\n \"user_id\": \"auth0|abcdef1234567890\",\n \"role\": \"viewer\"\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://v1.api.altostrat.io/workspaces/{workspaceId}/members")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"auth0|abcdef1234567890\",\n \"role\": \"viewer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/workspaces/{workspaceId}/members")
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_id\": \"auth0|abcdef1234567890\",\n \"role\": \"viewer\"\n}"
response = http.request(request)
puts response.read_body{
"user_id": "auth0|64f5a6b7c8d9e0f1a2b3c4d5",
"workspace_id": "ws_a1b2c3d4e5f6g7h8",
"role": "admin",
"created_at": "2025-10-29T00:40:06.000000Z",
"updated_at": "2025-10-29T00:40:06.000000Z"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot exceed 50 characters.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "unprocessable_entity",
"code": "member_already_exists",
"message": "The user is already a member of this workspace with role: admin.",
"doc_url": "https://docs.altostrat.io/errors/member_already_exists"
}{
"type": "api_error",
"code": "internal_server_error",
"message": "An internal server error occurred. Please try again later.",
"doc_url": "https://docs.altostrat.io/errors/internal_server_error"
}Workspace Members
Add a member to a workspace
Adds a new user to a workspace with a specified role. Only workspace owners and admins can add new members. A workspace cannot have more than 100 members.
POST
/
workspaces
/
{workspaceId}
/
members
Add a member to a workspace
curl --request POST \
--url https://v1.api.altostrat.io/workspaces/{workspaceId}/members \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "auth0|abcdef1234567890",
"role": "viewer"
}
'import requests
url = "https://v1.api.altostrat.io/workspaces/{workspaceId}/members"
payload = {
"user_id": "auth0|abcdef1234567890",
"role": "viewer"
}
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_id: 'auth0|abcdef1234567890', role: 'viewer'})
};
fetch('https://v1.api.altostrat.io/workspaces/{workspaceId}/members', 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://v1.api.altostrat.io/workspaces/{workspaceId}/members",
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_id' => 'auth0|abcdef1234567890',
'role' => 'viewer'
]),
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://v1.api.altostrat.io/workspaces/{workspaceId}/members"
payload := strings.NewReader("{\n \"user_id\": \"auth0|abcdef1234567890\",\n \"role\": \"viewer\"\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://v1.api.altostrat.io/workspaces/{workspaceId}/members")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"auth0|abcdef1234567890\",\n \"role\": \"viewer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/workspaces/{workspaceId}/members")
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_id\": \"auth0|abcdef1234567890\",\n \"role\": \"viewer\"\n}"
response = http.request(request)
puts response.read_body{
"user_id": "auth0|64f5a6b7c8d9e0f1a2b3c4d5",
"workspace_id": "ws_a1b2c3d4e5f6g7h8",
"role": "admin",
"created_at": "2025-10-29T00:40:06.000000Z",
"updated_at": "2025-10-29T00:40:06.000000Z"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot exceed 50 characters.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "unprocessable_entity",
"code": "member_already_exists",
"message": "The user is already a member of this workspace with role: admin.",
"doc_url": "https://docs.altostrat.io/errors/member_already_exists"
}{
"type": "api_error",
"code": "internal_server_error",
"message": "An internal server error occurred. Please try again later.",
"doc_url": "https://docs.altostrat.io/errors/internal_server_error"
}Authorizations
Enter your JWT in the format: Bearer {token}
Path Parameters
The ID of the workspace.
Example:
"ws_a1b2c3d4e5f6g7h8"
Body
application/json
Response
The member was added successfully.
The unique identifier for the user (Auth0 sub).
Example:
"auth0|64f5a6b7c8d9e0f1a2b3c4d5"
The ID of the workspace this membership belongs to.
Example:
"ws_a1b2c3d4e5f6g7h8"
The role of the user within the workspace.
Available options:
owner, admin, viewer Example:
"admin"
The timestamp when the member was added.
Example:
"2025-10-29T00:40:06.000000Z"
The timestamp when the member's role was last updated.
Example:
"2025-10-29T00:40:06.000000Z"
Was this page helpful?
⌘I