Create or update a team
curl --request PUT \
--url https://app.trelica.com/api/people/v1/teams \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"parentId": "65207c3ffa0d2abb07955315",
"id": "65207c3ffa0d2abb07955316",
"name": "Customer Success"
}
'import requests
url = "https://app.trelica.com/api/people/v1/teams"
payload = {
"parentId": "65207c3ffa0d2abb07955315",
"id": "65207c3ffa0d2abb07955316",
"name": "Customer Success"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
parentId: '65207c3ffa0d2abb07955315',
id: '65207c3ffa0d2abb07955316',
name: 'Customer Success'
})
};
fetch('https://app.trelica.com/api/people/v1/teams', 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://app.trelica.com/api/people/v1/teams",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'parentId' => '65207c3ffa0d2abb07955315',
'id' => '65207c3ffa0d2abb07955316',
'name' => 'Customer Success'
]),
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://app.trelica.com/api/people/v1/teams"
payload := strings.NewReader("{\n \"parentId\": \"65207c3ffa0d2abb07955315\",\n \"id\": \"65207c3ffa0d2abb07955316\",\n \"name\": \"Customer Success\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.trelica.com/api/people/v1/teams")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"parentId\": \"65207c3ffa0d2abb07955315\",\n \"id\": \"65207c3ffa0d2abb07955316\",\n \"name\": \"Customer Success\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trelica.com/api/people/v1/teams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"parentId\": \"65207c3ffa0d2abb07955315\",\n \"id\": \"65207c3ffa0d2abb07955316\",\n \"name\": \"Customer Success\"\n}"
response = http.request(request)
puts response.read_body{
"parentId": "65207c3ffa0d2abb07955315",
"id": "65207c3ffa0d2abb07955316",
"name": "Customer Success"
}{
"type": "about:blank",
"title": "One or more validation errors occurred.",
"status": 400,
"detail": "The request body failed validation. See errors for the offending fields.",
"errors": {
"email": [
"The email field is required."
]
},
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
}{
"type": "about:blank",
"title": "Not found.",
"status": 404,
"detail": "The requested resource does not exist or you do not have access to it.",
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
}Teams
Create or update a team
Creates a new team when no ID is supplied (returns 201 with the created team), or updates an existing team’s name and/or parent when an ID is supplied (returns 200). A team cannot be moved beneath one of its own descendants.
Required scope: People.Write (Write access to people and teams)
PUT
/
api
/
people
/
v1
/
teams
Create or update a team
curl --request PUT \
--url https://app.trelica.com/api/people/v1/teams \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"parentId": "65207c3ffa0d2abb07955315",
"id": "65207c3ffa0d2abb07955316",
"name": "Customer Success"
}
'import requests
url = "https://app.trelica.com/api/people/v1/teams"
payload = {
"parentId": "65207c3ffa0d2abb07955315",
"id": "65207c3ffa0d2abb07955316",
"name": "Customer Success"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
parentId: '65207c3ffa0d2abb07955315',
id: '65207c3ffa0d2abb07955316',
name: 'Customer Success'
})
};
fetch('https://app.trelica.com/api/people/v1/teams', 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://app.trelica.com/api/people/v1/teams",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'parentId' => '65207c3ffa0d2abb07955315',
'id' => '65207c3ffa0d2abb07955316',
'name' => 'Customer Success'
]),
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://app.trelica.com/api/people/v1/teams"
payload := strings.NewReader("{\n \"parentId\": \"65207c3ffa0d2abb07955315\",\n \"id\": \"65207c3ffa0d2abb07955316\",\n \"name\": \"Customer Success\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.trelica.com/api/people/v1/teams")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"parentId\": \"65207c3ffa0d2abb07955315\",\n \"id\": \"65207c3ffa0d2abb07955316\",\n \"name\": \"Customer Success\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trelica.com/api/people/v1/teams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"parentId\": \"65207c3ffa0d2abb07955315\",\n \"id\": \"65207c3ffa0d2abb07955316\",\n \"name\": \"Customer Success\"\n}"
response = http.request(request)
puts response.read_body{
"parentId": "65207c3ffa0d2abb07955315",
"id": "65207c3ffa0d2abb07955316",
"name": "Customer Success"
}{
"type": "about:blank",
"title": "One or more validation errors occurred.",
"status": 400,
"detail": "The request body failed validation. See errors for the offending fields.",
"errors": {
"email": [
"The email field is required."
]
},
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
}{
"type": "about:blank",
"title": "Not found.",
"status": 404,
"detail": "The requested resource does not exist or you do not have access to it.",
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
}Authorizations
OAuth 2.0. Obtain an access token via the Client Credentials or Authorization Code flow, then send it as Authorization: Bearer <token>.
Body
application/json
Response
OK
Related topics
Create or update a contractManage service accountsSet up your team to use 1Password developer toolsWas this page helpful?
⌘I