Create label
POST
https://api.catenda.com/v2/projects/{project-id}/labels
Path Parameters
- project-idstringrequiredExampleDescription
Query Parameters
- includestringDescription
Body Parameters
- bodyobjectrequired
- namestringrequiredExampleDescription
- colorstringrequiredExampleDescription
- labelGroupIdstringExampleDescription
Responses
200
- label
- idstringExampleDescription
- namestringExampleDescription
- colorstringExampleDescription
- grouplabel-group
- idstringExampleDescription
- namestringExampleDescription
- deletedbooleanDescription
curl
curl --request POST \
--url https://api.catenda.com/v2/projects/{project-id}/labels \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"name": "Label 1",
"color": "#6aa84f"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"name": "Label 1",
"color": "#6aa84f"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.catenda.com/v2/projects/{project-id}/labels", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.catenda.com/v2/projects/{project-id}/labels")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"name": "Label 1",
"color": "#6aa84f"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.catenda.com/v2/projects/{project-id}/labels"
payload = json.dumps({
"name": "Label 1",
"color": "#6aa84f"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// OK
{
"id": "397t0ccc8f74619096c738de15dc6512",
"name": "Label 1",
"color": "#6aa84f",
"group": {
"id": "357t0ccc8f74719096c734de18fc6512",
"name": "Group name"
},
"deleted": false
}