curl --location 'https://integrations.projectcor.com/v2/integrations/leaves-types' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {
"source": "GLOBANT"
},
"id": "type external",
"name": "Custom name"
}'
import requests
url = "https://integrations.projectcor.com/v2/integrations/leaves-types"
payload = {
"metadata": {
"source": "GLOBANT"
},
"id": "type external",
"name": "Custom name"
}
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch(
'https://integrations.projectcor.com/v2/integrations/leaves-types',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
metadata: {
source: 'GLOBANT'
},
id: 'type external',
name: 'Custom name'
})
}
);
const data = await response.json();
console.log(data);
{
"statusCode": 201,
"status": "success",
"data": {
"id": 12345,
"name": "Custom name",
"company_id": 2336,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"active": true
}
}
{
"status": 400,
"name": "COR_CUSTOM_ERROR",
"code": "ZC002",
"message": "Source is required in metadata"
}
User Leaves
Create Leave Type
Creates a new leave type in your COR instance with external ID mapping
POST
/
v2
/
integrations
/
leaves-types
curl --location 'https://integrations.projectcor.com/v2/integrations/leaves-types' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {
"source": "GLOBANT"
},
"id": "type external",
"name": "Custom name"
}'
import requests
url = "https://integrations.projectcor.com/v2/integrations/leaves-types"
payload = {
"metadata": {
"source": "GLOBANT"
},
"id": "type external",
"name": "Custom name"
}
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch(
'https://integrations.projectcor.com/v2/integrations/leaves-types',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
metadata: {
source: 'GLOBANT'
},
id: 'type external',
name: 'Custom name'
})
}
);
const data = await response.json();
console.log(data);
{
"statusCode": 201,
"status": "success",
"data": {
"id": 12345,
"name": "Custom name",
"company_id": 2336,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"active": true
}
}
{
"status": 400,
"name": "COR_CUSTOM_ERROR",
"code": "ZC002",
"message": "Source is required in metadata"
}
Creates a new leave type in your COR instance through the integrations service.
Request Body Requirements
string
required
External leave type ID from your source system
string
required
Leave type name
Known Errors
ValidationError— Missing required fieldsDuplicateExternalIdError— A leave type with this external ID already exists for this source
curl --location 'https://integrations.projectcor.com/v2/integrations/leaves-types' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {
"source": "GLOBANT"
},
"id": "type external",
"name": "Custom name"
}'
import requests
url = "https://integrations.projectcor.com/v2/integrations/leaves-types"
payload = {
"metadata": {
"source": "GLOBANT"
},
"id": "type external",
"name": "Custom name"
}
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch(
'https://integrations.projectcor.com/v2/integrations/leaves-types',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
metadata: {
source: 'GLOBANT'
},
id: 'type external',
name: 'Custom name'
})
}
);
const data = await response.json();
console.log(data);
{
"statusCode": 201,
"status": "success",
"data": {
"id": 12345,
"name": "Custom name",
"company_id": 2336,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"active": true
}
}
{
"status": 400,
"name": "COR_CUSTOM_ERROR",
"code": "ZC002",
"message": "Source is required in metadata"
}
Was this page helpful?
⌘I

