Create a new membership
curl --request POST \
--url https://api.wellapp.ai/v1/memberships \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "membership",
"attributes": {
"role": "member"
},
"relationships": {
"workspace": {
"data": {
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440003"
}
},
"person": {
"data": {
"type": "people",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
}
}
}
'import requests
url = "https://api.wellapp.ai/v1/memberships"
payload = {
"type": "membership",
"attributes": { "role": "member" },
"relationships": {
"workspace": { "data": {
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440003"
} },
"person": { "data": {
"type": "people",
"id": "550e8400-e29b-41d4-a716-446655440000"
} }
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'membership',
attributes: {role: 'member'},
relationships: {
workspace: {data: {type: 'workspace', id: '550e8400-e29b-41d4-a716-446655440003'}},
person: {data: {type: 'people', id: '550e8400-e29b-41d4-a716-446655440000'}}
}
})
};
fetch('https://api.wellapp.ai/v1/memberships', 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.wellapp.ai/v1/memberships",
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([
'type' => 'membership',
'attributes' => [
'role' => 'member'
],
'relationships' => [
'workspace' => [
'data' => [
'type' => 'workspace',
'id' => '550e8400-e29b-41d4-a716-446655440003'
]
],
'person' => [
'data' => [
'type' => 'people',
'id' => '550e8400-e29b-41d4-a716-446655440000'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.wellapp.ai/v1/memberships"
payload := strings.NewReader("{\n \"type\": \"membership\",\n \"attributes\": {\n \"role\": \"member\"\n },\n \"relationships\": {\n \"workspace\": {\n \"data\": {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440003\"\n }\n },\n \"person\": {\n \"data\": {\n \"type\": \"people\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.wellapp.ai/v1/memberships")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"membership\",\n \"attributes\": {\n \"role\": \"member\"\n },\n \"relationships\": {\n \"workspace\": {\n \"data\": {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440003\"\n }\n },\n \"person\": {\n \"data\": {\n \"type\": \"people\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/memberships")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"membership\",\n \"attributes\": {\n \"role\": \"member\"\n },\n \"relationships\": {\n \"workspace\": {\n \"data\": {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440003\"\n }\n },\n \"person\": {\n \"data\": {\n \"type\": \"people\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "memberships",
"id": "550e8400-e29b-41d4-a716-446655440007",
"attributes": {
"role": "member",
"created_at": "2024-01-20T10:30:00Z",
"updated_at": "2024-01-20T10:30:00Z"
},
"relationships": {
"workspace": {
"data": {
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440003"
}
},
"person": {
"data": {
"type": "people",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
}
}
},
"included": [
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440003",
"attributes": {
"name": "Marketing Team Workspace",
"description": "Collaborative workspace for the marketing team to manage campaigns and content",
"avatar_color": "#FF5733",
"external_workspace_id": "mkt-workspace-001",
"auto_extract_enabled": false,
"created_at": "2024-01-05T08:00:00Z",
"updated_at": "2024-01-18T12:15:00Z"
}
},
{
"type": "people",
"id": "550e8400-e29b-41d4-a716-446655440000",
"attributes": {
"first_name": "Sarah",
"last_name": "Johnson",
"full_name": "Sarah Johnson",
"created_at": "2024-01-10T09:00:00Z",
"updated_at": "2024-01-10T09:00:00Z"
}
}
]
}{
"code": "SCHEMA_VALIDATION_ERROR",
"status": 400,
"title": "Validation Error",
"message": "The request is invalid",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
},
"details": [
{
"instancePath": "<string>",
"schemaPath": "<string>",
"keyword": "<string>",
"params": {},
"message": "<string>"
}
]
}{
"code": "UNAUTHORIZED",
"status": 401,
"title": "Unauthorized",
"message": "You are not authorized to access this resource",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
}
}{
"code": "COMPANY_OR_PERSON_NOT_FOUND",
"status": 404,
"title": "Company or Person Not Found",
"message": "The requested company or one of the specified people could not be found",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
}
}Memberships
Create Membership
Create a new membership linking a person to a workspace with a specific role
POST
/
v1
/
memberships
Create a new membership
curl --request POST \
--url https://api.wellapp.ai/v1/memberships \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "membership",
"attributes": {
"role": "member"
},
"relationships": {
"workspace": {
"data": {
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440003"
}
},
"person": {
"data": {
"type": "people",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
}
}
}
'import requests
url = "https://api.wellapp.ai/v1/memberships"
payload = {
"type": "membership",
"attributes": { "role": "member" },
"relationships": {
"workspace": { "data": {
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440003"
} },
"person": { "data": {
"type": "people",
"id": "550e8400-e29b-41d4-a716-446655440000"
} }
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'membership',
attributes: {role: 'member'},
relationships: {
workspace: {data: {type: 'workspace', id: '550e8400-e29b-41d4-a716-446655440003'}},
person: {data: {type: 'people', id: '550e8400-e29b-41d4-a716-446655440000'}}
}
})
};
fetch('https://api.wellapp.ai/v1/memberships', 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.wellapp.ai/v1/memberships",
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([
'type' => 'membership',
'attributes' => [
'role' => 'member'
],
'relationships' => [
'workspace' => [
'data' => [
'type' => 'workspace',
'id' => '550e8400-e29b-41d4-a716-446655440003'
]
],
'person' => [
'data' => [
'type' => 'people',
'id' => '550e8400-e29b-41d4-a716-446655440000'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.wellapp.ai/v1/memberships"
payload := strings.NewReader("{\n \"type\": \"membership\",\n \"attributes\": {\n \"role\": \"member\"\n },\n \"relationships\": {\n \"workspace\": {\n \"data\": {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440003\"\n }\n },\n \"person\": {\n \"data\": {\n \"type\": \"people\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.wellapp.ai/v1/memberships")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"membership\",\n \"attributes\": {\n \"role\": \"member\"\n },\n \"relationships\": {\n \"workspace\": {\n \"data\": {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440003\"\n }\n },\n \"person\": {\n \"data\": {\n \"type\": \"people\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/memberships")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"membership\",\n \"attributes\": {\n \"role\": \"member\"\n },\n \"relationships\": {\n \"workspace\": {\n \"data\": {\n \"type\": \"workspace\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440003\"\n }\n },\n \"person\": {\n \"data\": {\n \"type\": \"people\",\n \"id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "memberships",
"id": "550e8400-e29b-41d4-a716-446655440007",
"attributes": {
"role": "member",
"created_at": "2024-01-20T10:30:00Z",
"updated_at": "2024-01-20T10:30:00Z"
},
"relationships": {
"workspace": {
"data": {
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440003"
}
},
"person": {
"data": {
"type": "people",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
}
}
},
"included": [
{
"type": "workspace",
"id": "550e8400-e29b-41d4-a716-446655440003",
"attributes": {
"name": "Marketing Team Workspace",
"description": "Collaborative workspace for the marketing team to manage campaigns and content",
"avatar_color": "#FF5733",
"external_workspace_id": "mkt-workspace-001",
"auto_extract_enabled": false,
"created_at": "2024-01-05T08:00:00Z",
"updated_at": "2024-01-18T12:15:00Z"
}
},
{
"type": "people",
"id": "550e8400-e29b-41d4-a716-446655440000",
"attributes": {
"first_name": "Sarah",
"last_name": "Johnson",
"full_name": "Sarah Johnson",
"created_at": "2024-01-10T09:00:00Z",
"updated_at": "2024-01-10T09:00:00Z"
}
}
]
}{
"code": "SCHEMA_VALIDATION_ERROR",
"status": 400,
"title": "Validation Error",
"message": "The request is invalid",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
},
"details": [
{
"instancePath": "<string>",
"schemaPath": "<string>",
"keyword": "<string>",
"params": {},
"message": "<string>"
}
]
}{
"code": "UNAUTHORIZED",
"status": 401,
"title": "Unauthorized",
"message": "You are not authorized to access this resource",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
}
}{
"code": "COMPANY_OR_PERSON_NOT_FOUND",
"status": 404,
"title": "Company or Person Not Found",
"message": "The requested company or one of the specified people could not be found",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
}
}⌘I