Transfer team ownership
curl --request POST \
--url https://api.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator', 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.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator"
req, _ := http.NewRequest("POST", url, nil)
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.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"statusCode": 400,
"error": "Bad Request",
"message": "The target member role, should be the same as yours",
"data": {
"code": "target_member_role_should_be_the_same_as_yours"
}
}{
"error": "Unauthorized."
}{
"statusCode": 403,
"error": "Forbidden",
"message": "You are not allowed to change the team creator",
"data": {
"code": "not_allowed_to_change_team_creator"
}
}{
"statusCode": 404,
"error": "Not Found",
"message": "Member not found",
"data": {
"code": "member_not_found"
}
}Teams
Transfer team ownership
Makes another member the team creator. Only the current team creator can do this, and it needs the team.manage permission. The new creator must already have the same role as you. This can be done only once per team.
POST
/
v2
/
teams
/
{teamID}
/
{memberID}
/
change-team-creator
Transfer team ownership
curl --request POST \
--url https://api.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator', 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.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator"
req, _ := http.NewRequest("POST", url, nil)
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.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.liara.ir/v2/teams/{teamID}/{memberID}/change-team-creator")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"statusCode": 400,
"error": "Bad Request",
"message": "The target member role, should be the same as yours",
"data": {
"code": "target_member_role_should_be_the_same_as_yours"
}
}{
"error": "Unauthorized."
}{
"statusCode": 403,
"error": "Forbidden",
"message": "You are not allowed to change the team creator",
"data": {
"code": "not_allowed_to_change_team_creator"
}
}{
"statusCode": 404,
"error": "Not Found",
"message": "Member not found",
"data": {
"code": "member_not_found"
}
}Authorizations
Send your API token as Authorization: Bearer <api-token>.
Path Parameters
The team's ID. 24-character hexadecimal ID.
Pattern:
^[0-9a-fA-F]{24}$The membership's _id from GET /v2/teams/{teamID}/members (not the user's ID).
24-character hexadecimal ID.
Pattern:
^[0-9a-fA-F]{24}$Response
Ownership was transferred. The response body is empty.
⌘I
