Create a new tag for a tag group
curl --request POST \
--url https://external.pleo.io/v0/tag-groups/{groupId}/tags \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"archived": false,
"code": "12345",
"name": "Lunch allowance",
"otherDimensionValues": [
"value1",
"value2"
]
}
'import requests
url = "https://external.pleo.io/v0/tag-groups/{groupId}/tags"
payload = {
"archived": False,
"code": "12345",
"name": "Lunch allowance",
"otherDimensionValues": ["value1", "value2"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({
archived: false,
code: '12345',
name: 'Lunch allowance',
otherDimensionValues: ['value1', 'value2']
})
};
fetch('https://external.pleo.io/v0/tag-groups/{groupId}/tags', 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://external.pleo.io/v0/tag-groups/{groupId}/tags",
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([
'archived' => false,
'code' => '12345',
'name' => 'Lunch allowance',
'otherDimensionValues' => [
'value1',
'value2'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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://external.pleo.io/v0/tag-groups/{groupId}/tags"
payload := strings.NewReader("{\n \"archived\": false,\n \"code\": \"12345\",\n \"name\": \"Lunch allowance\",\n \"otherDimensionValues\": [\n \"value1\",\n \"value2\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://external.pleo.io/v0/tag-groups/{groupId}/tags")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"archived\": false,\n \"code\": \"12345\",\n \"name\": \"Lunch allowance\",\n \"otherDimensionValues\": [\n \"value1\",\n \"value2\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.pleo.io/v0/tag-groups/{groupId}/tags")
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;charset=UTF-8'
request.body = "{\n \"archived\": false,\n \"code\": \"12345\",\n \"name\": \"Lunch allowance\",\n \"otherDimensionValues\": [\n \"value1\",\n \"value2\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"archived": false,
"code": "12345",
"createdAt": "2023-08-23T03:11:48Z",
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "c04c7e9e-6c15-11ee-b962-0242ac120002",
"updatedAt": "2023-08-23T03:11:48Z",
"name": "Lunch allowance"
}
}Tags
Creates a new tag sub-resource under the given tag group
POST
/
v0
/
tag-groups
/
{groupId}
/
tags
Create a new tag for a tag group
curl --request POST \
--url https://external.pleo.io/v0/tag-groups/{groupId}/tags \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"archived": false,
"code": "12345",
"name": "Lunch allowance",
"otherDimensionValues": [
"value1",
"value2"
]
}
'import requests
url = "https://external.pleo.io/v0/tag-groups/{groupId}/tags"
payload = {
"archived": False,
"code": "12345",
"name": "Lunch allowance",
"otherDimensionValues": ["value1", "value2"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({
archived: false,
code: '12345',
name: 'Lunch allowance',
otherDimensionValues: ['value1', 'value2']
})
};
fetch('https://external.pleo.io/v0/tag-groups/{groupId}/tags', 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://external.pleo.io/v0/tag-groups/{groupId}/tags",
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([
'archived' => false,
'code' => '12345',
'name' => 'Lunch allowance',
'otherDimensionValues' => [
'value1',
'value2'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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://external.pleo.io/v0/tag-groups/{groupId}/tags"
payload := strings.NewReader("{\n \"archived\": false,\n \"code\": \"12345\",\n \"name\": \"Lunch allowance\",\n \"otherDimensionValues\": [\n \"value1\",\n \"value2\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://external.pleo.io/v0/tag-groups/{groupId}/tags")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"archived\": false,\n \"code\": \"12345\",\n \"name\": \"Lunch allowance\",\n \"otherDimensionValues\": [\n \"value1\",\n \"value2\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.pleo.io/v0/tag-groups/{groupId}/tags")
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;charset=UTF-8'
request.body = "{\n \"archived\": false,\n \"code\": \"12345\",\n \"name\": \"Lunch allowance\",\n \"otherDimensionValues\": [\n \"value1\",\n \"value2\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"archived": false,
"code": "12345",
"createdAt": "2023-08-23T03:11:48Z",
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "c04c7e9e-6c15-11ee-b962-0242ac120002",
"updatedAt": "2023-08-23T03:11:48Z",
"name": "Lunch allowance"
}
}Authorizations
bearerAuthbasicAuth
Body
application/json;charset=UTF-8
Dimension values outside the two main dimensions ordered by display order. Values not provided will be given empty values.Values will be ignored if there is not enough dimensions to add them to.
Dimension values outside the two main dimensions ordered by display order. Values not provided will be given empty values.Values will be ignored if there is not enough dimensions to add them to.
Example:
["value1", "value2"]
Was this page helpful?