Add user to group
curl --request POST \
--url https://api.tightknit.ai/admin/v0/groups/{group_id}/members \
--header 'Authorization: Bearer <token>' \
--header 'content-type: <content-type>' \
--data '
{
"user": {
"slack_user_id": "<string>"
}
}
'import requests
url = "https://api.tightknit.ai/admin/v0/groups/{group_id}/members"
payload = { "user": { "slack_user_id": "<string>" } }
headers = {
"content-type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'content-type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({user: {slack_user_id: '<string>'}})
};
fetch('https://api.tightknit.ai/admin/v0/groups/{group_id}/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://api.tightknit.ai/admin/v0/groups/{group_id}/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' => [
'slack_user_id' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"content-type: <content-type>"
],
]);
$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.tightknit.ai/admin/v0/groups/{group_id}/members"
payload := strings.NewReader("{\n \"user\": {\n \"slack_user_id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
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.tightknit.ai/admin/v0/groups/{group_id}/members")
.header("content-type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"user\": {\n \"slack_user_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tightknit.ai/admin/v0/groups/{group_id}/members")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"user\": {\n \"slack_user_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": true
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}Groups
Add user to group
Adds a user as a group member. The user must not already be a member of the group.
POST
/
admin
/
v0
/
groups
/
{group_id}
/
members
Add user to group
curl --request POST \
--url https://api.tightknit.ai/admin/v0/groups/{group_id}/members \
--header 'Authorization: Bearer <token>' \
--header 'content-type: <content-type>' \
--data '
{
"user": {
"slack_user_id": "<string>"
}
}
'import requests
url = "https://api.tightknit.ai/admin/v0/groups/{group_id}/members"
payload = { "user": { "slack_user_id": "<string>" } }
headers = {
"content-type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'content-type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({user: {slack_user_id: '<string>'}})
};
fetch('https://api.tightknit.ai/admin/v0/groups/{group_id}/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://api.tightknit.ai/admin/v0/groups/{group_id}/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' => [
'slack_user_id' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"content-type: <content-type>"
],
]);
$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.tightknit.ai/admin/v0/groups/{group_id}/members"
payload := strings.NewReader("{\n \"user\": {\n \"slack_user_id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
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.tightknit.ai/admin/v0/groups/{group_id}/members")
.header("content-type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"user\": {\n \"slack_user_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tightknit.ai/admin/v0/groups/{group_id}/members")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"user\": {\n \"slack_user_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": true
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Available options:
application/json Path Parameters
Body
application/json
The user identifier, which must be exactly one of the following: Slack user ID, email, or Tightknit profile ID
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Response
User is already a member of the group
Was this page helpful?
⌘I

