Submit Employee Consent Data
curl --request POST \
--url https://{env}.tartanhq.com/api/v1/employee/consent-data/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"org": "9e3ba089-5cb6-407c-93db-e3b7ccaff3ed",
"employee_id": "0078",
"consent_language": "I have new consent.",
"consent_timestamp": "2024-11-20T10:30:00Z",
"consent_expiry": "2024-11-28T10:30:00Z"
}
'import requests
url = "https://{env}.tartanhq.com/api/v1/employee/consent-data/"
payload = {
"org": "9e3ba089-5cb6-407c-93db-e3b7ccaff3ed",
"employee_id": "0078",
"consent_language": "I have new consent.",
"consent_timestamp": "2024-11-20T10:30:00Z",
"consent_expiry": "2024-11-28T10:30:00Z"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
org: '9e3ba089-5cb6-407c-93db-e3b7ccaff3ed',
employee_id: '0078',
consent_language: 'I have new consent.',
consent_timestamp: '2024-11-20T10:30:00Z',
consent_expiry: '2024-11-28T10:30:00Z'
})
};
fetch('https://{env}.tartanhq.com/api/v1/employee/consent-data/', 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://{env}.tartanhq.com/api/v1/employee/consent-data/",
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([
'org' => '9e3ba089-5cb6-407c-93db-e3b7ccaff3ed',
'employee_id' => '0078',
'consent_language' => 'I have new consent.',
'consent_timestamp' => '2024-11-20T10:30:00Z',
'consent_expiry' => '2024-11-28T10:30:00Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://{env}.tartanhq.com/api/v1/employee/consent-data/"
payload := strings.NewReader("{\n \"org\": \"9e3ba089-5cb6-407c-93db-e3b7ccaff3ed\",\n \"employee_id\": \"0078\",\n \"consent_language\": \"I have new consent.\",\n \"consent_timestamp\": \"2024-11-20T10:30:00Z\",\n \"consent_expiry\": \"2024-11-28T10:30:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.post("https://{env}.tartanhq.com/api/v1/employee/consent-data/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"org\": \"9e3ba089-5cb6-407c-93db-e3b7ccaff3ed\",\n \"employee_id\": \"0078\",\n \"consent_language\": \"I have new consent.\",\n \"consent_timestamp\": \"2024-11-20T10:30:00Z\",\n \"consent_expiry\": \"2024-11-28T10:30:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{env}.tartanhq.com/api/v1/employee/consent-data/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"org\": \"9e3ba089-5cb6-407c-93db-e3b7ccaff3ed\",\n \"employee_id\": \"0078\",\n \"consent_language\": \"I have new consent.\",\n \"consent_timestamp\": \"2024-11-20T10:30:00Z\",\n \"consent_expiry\": \"2024-11-28T10:30:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"requestId": "d4e04a3f-08c2-45bd-a7de-ea37fc632a1f",
"message": "success",
"data": {
"id": "7",
"employeeId": "5",
"name": "Manas Mallik",
"email": "manas@tartanhq.com",
"personalEmail": "manas.mallik@gmail.com",
"doj": "2021-06-01",
"dob": "1983-06-08",
"status": "Active",
"employmentType": "Permanent",
"gender": "Male",
"pan": "************",
"aadhar": "************",
"uan": "************",
"mobileNumber": "************",
"maritalStatus": "Married",
"nationality": "Indian",
"fatherName": "Ritesh Mallik",
"bloodGroup": "AB +ve",
"designation": "NOT AVAILABLE",
"department": "Engineering",
"grade": "D-3",
"groupName": "NOT AVAILABLE",
"costCenter": "NOT AVAILABLE",
"companyName": "NOT AVAILABLE",
"terminationDate": "",
"manager": "Meet Semlani",
"managerEmail": "NOT AVAILABLE",
"managerEmail2": "NOT AVAILABLE",
"managerEmail3": "NOT AVAILABLE",
"managerEmail4": "NOT AVAILABLE",
"managerEmail5": "NOT AVAILABLE",
"countryCode": "IN",
"bankDetails": {
"accountNumber": "************",
"ifscCode": "************",
"bankName": "SBI"
},
"currentAddress": {
"addressPincode": "560080",
"addressCity": "Banglore",
"addressCountry": "India",
"addressState": "Karnataka",
"addressLine": "Sadashiva Nagar Armane Nagar"
},
"permanentAddress": {
"addressPincode": "226001",
"addressCity": "Luknow",
"addressCountry": "India",
"addressState": "Uttar Pradesh",
"addressLine": "Yarana Nagar Luknow"
},
"jobLocation": {
"pincode": "NOT AVAILABLE",
"city": "NOT AVAILABLE"
},
"employeeMetadata": {
"marriageDate": "NOT AVAILABLE"
},
"dependentDetails": [
{
"name": "Sohan Negi",
"relation": "Father",
"dob": "NOT AVAILABLE",
"email": "NOT AVAILABLE",
"gender": "NOT AVAILABLE",
"mobileNumber": "NOT AVAILABLE",
"profession": "NOT AVAILABLE"
}
],
"salaryDetails": {
"ctc": {
"basic": 50000,
"dearnessAllowance": 9000.9,
"hra": 25000.5,
"gratuity": 2000.7,
"medicalAllowance": 2000.7,
"travelAllowance": 2000.7,
"specialAllowance": null,
"otherAllowance": null,
"flexiBasketAllowance": null,
"grossPay": null,
"taxRegime": null,
"fixedPay": null,
"bonus": {
"joining": 80000,
"referral": null,
"retention": null,
"performance": null,
"relocation": null,
"misc": null
},
"deductions": {
"pf": 1800,
"esi": null,
"professionalTax": null,
"labourWelfareFund": null,
"misc": null,
"nps": null
}
},
"monthly": {
"month": 2,
"year": 2025,
"basic": null,
"dearnessAllowance": null,
"hra": null,
"medicalAllowance": null,
"travelAllowance": null,
"specialAllowance": null,
"flexiBasketAllowance": null,
"gratuity": 1600,
"otherAllowance": null,
"taxRegime": null,
"fixedPay": null,
"grossPay": null,
"bonus": {
"joining": 20000,
"referral": null,
"retention": null,
"performance": null,
"relocation": 28907.17,
"misc": null
},
"deductions": {
"pf": null,
"esi": null,
"professionalTax": 300,
"labourWelfareFund": null,
"tds": null,
"medicalClaimDeduction": null,
"groupTermInsuranceDeductions": null,
"earlyWageDeduction": null,
"misc": 162023.24,
"nps": 1234.34
},
"reimbursements": 93321.33
}
}
}
}{
"requestId": "8fae81c0-194c-45a2-a077-e6e4fc3fb6d1",
"message": "error",
"data": {
"consent_expiry": [
"The consent expiry timestamp must be in the future. Please provide a valid timestamp."
]
}
}{
"requestId": "a337d820-3661-4ddd-a2fe-6da518b87935",
"message": "Authentication credentials were not provided.",
"data": null
}{
"requestId": "0aaf653a-148e-4cbf-8346-742de60bb2c9",
"message": "Employee not found",
"data": null
}{
"requestId": "be2915d5-fc30-4d13-bcca-3d62aefac2a0",
"message": "Internal Server Error",
"data": null
}Internal
Employee Consent
API to submit or update employee consent data.
POST
/
api
/
v1
/
employee
/
consent-data
/
Submit Employee Consent Data
curl --request POST \
--url https://{env}.tartanhq.com/api/v1/employee/consent-data/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"org": "9e3ba089-5cb6-407c-93db-e3b7ccaff3ed",
"employee_id": "0078",
"consent_language": "I have new consent.",
"consent_timestamp": "2024-11-20T10:30:00Z",
"consent_expiry": "2024-11-28T10:30:00Z"
}
'import requests
url = "https://{env}.tartanhq.com/api/v1/employee/consent-data/"
payload = {
"org": "9e3ba089-5cb6-407c-93db-e3b7ccaff3ed",
"employee_id": "0078",
"consent_language": "I have new consent.",
"consent_timestamp": "2024-11-20T10:30:00Z",
"consent_expiry": "2024-11-28T10:30:00Z"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
org: '9e3ba089-5cb6-407c-93db-e3b7ccaff3ed',
employee_id: '0078',
consent_language: 'I have new consent.',
consent_timestamp: '2024-11-20T10:30:00Z',
consent_expiry: '2024-11-28T10:30:00Z'
})
};
fetch('https://{env}.tartanhq.com/api/v1/employee/consent-data/', 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://{env}.tartanhq.com/api/v1/employee/consent-data/",
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([
'org' => '9e3ba089-5cb6-407c-93db-e3b7ccaff3ed',
'employee_id' => '0078',
'consent_language' => 'I have new consent.',
'consent_timestamp' => '2024-11-20T10:30:00Z',
'consent_expiry' => '2024-11-28T10:30:00Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://{env}.tartanhq.com/api/v1/employee/consent-data/"
payload := strings.NewReader("{\n \"org\": \"9e3ba089-5cb6-407c-93db-e3b7ccaff3ed\",\n \"employee_id\": \"0078\",\n \"consent_language\": \"I have new consent.\",\n \"consent_timestamp\": \"2024-11-20T10:30:00Z\",\n \"consent_expiry\": \"2024-11-28T10:30:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.post("https://{env}.tartanhq.com/api/v1/employee/consent-data/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"org\": \"9e3ba089-5cb6-407c-93db-e3b7ccaff3ed\",\n \"employee_id\": \"0078\",\n \"consent_language\": \"I have new consent.\",\n \"consent_timestamp\": \"2024-11-20T10:30:00Z\",\n \"consent_expiry\": \"2024-11-28T10:30:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{env}.tartanhq.com/api/v1/employee/consent-data/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"org\": \"9e3ba089-5cb6-407c-93db-e3b7ccaff3ed\",\n \"employee_id\": \"0078\",\n \"consent_language\": \"I have new consent.\",\n \"consent_timestamp\": \"2024-11-20T10:30:00Z\",\n \"consent_expiry\": \"2024-11-28T10:30:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"requestId": "d4e04a3f-08c2-45bd-a7de-ea37fc632a1f",
"message": "success",
"data": {
"id": "7",
"employeeId": "5",
"name": "Manas Mallik",
"email": "manas@tartanhq.com",
"personalEmail": "manas.mallik@gmail.com",
"doj": "2021-06-01",
"dob": "1983-06-08",
"status": "Active",
"employmentType": "Permanent",
"gender": "Male",
"pan": "************",
"aadhar": "************",
"uan": "************",
"mobileNumber": "************",
"maritalStatus": "Married",
"nationality": "Indian",
"fatherName": "Ritesh Mallik",
"bloodGroup": "AB +ve",
"designation": "NOT AVAILABLE",
"department": "Engineering",
"grade": "D-3",
"groupName": "NOT AVAILABLE",
"costCenter": "NOT AVAILABLE",
"companyName": "NOT AVAILABLE",
"terminationDate": "",
"manager": "Meet Semlani",
"managerEmail": "NOT AVAILABLE",
"managerEmail2": "NOT AVAILABLE",
"managerEmail3": "NOT AVAILABLE",
"managerEmail4": "NOT AVAILABLE",
"managerEmail5": "NOT AVAILABLE",
"countryCode": "IN",
"bankDetails": {
"accountNumber": "************",
"ifscCode": "************",
"bankName": "SBI"
},
"currentAddress": {
"addressPincode": "560080",
"addressCity": "Banglore",
"addressCountry": "India",
"addressState": "Karnataka",
"addressLine": "Sadashiva Nagar Armane Nagar"
},
"permanentAddress": {
"addressPincode": "226001",
"addressCity": "Luknow",
"addressCountry": "India",
"addressState": "Uttar Pradesh",
"addressLine": "Yarana Nagar Luknow"
},
"jobLocation": {
"pincode": "NOT AVAILABLE",
"city": "NOT AVAILABLE"
},
"employeeMetadata": {
"marriageDate": "NOT AVAILABLE"
},
"dependentDetails": [
{
"name": "Sohan Negi",
"relation": "Father",
"dob": "NOT AVAILABLE",
"email": "NOT AVAILABLE",
"gender": "NOT AVAILABLE",
"mobileNumber": "NOT AVAILABLE",
"profession": "NOT AVAILABLE"
}
],
"salaryDetails": {
"ctc": {
"basic": 50000,
"dearnessAllowance": 9000.9,
"hra": 25000.5,
"gratuity": 2000.7,
"medicalAllowance": 2000.7,
"travelAllowance": 2000.7,
"specialAllowance": null,
"otherAllowance": null,
"flexiBasketAllowance": null,
"grossPay": null,
"taxRegime": null,
"fixedPay": null,
"bonus": {
"joining": 80000,
"referral": null,
"retention": null,
"performance": null,
"relocation": null,
"misc": null
},
"deductions": {
"pf": 1800,
"esi": null,
"professionalTax": null,
"labourWelfareFund": null,
"misc": null,
"nps": null
}
},
"monthly": {
"month": 2,
"year": 2025,
"basic": null,
"dearnessAllowance": null,
"hra": null,
"medicalAllowance": null,
"travelAllowance": null,
"specialAllowance": null,
"flexiBasketAllowance": null,
"gratuity": 1600,
"otherAllowance": null,
"taxRegime": null,
"fixedPay": null,
"grossPay": null,
"bonus": {
"joining": 20000,
"referral": null,
"retention": null,
"performance": null,
"relocation": 28907.17,
"misc": null
},
"deductions": {
"pf": null,
"esi": null,
"professionalTax": 300,
"labourWelfareFund": null,
"tds": null,
"medicalClaimDeduction": null,
"groupTermInsuranceDeductions": null,
"earlyWageDeduction": null,
"misc": 162023.24,
"nps": 1234.34
},
"reimbursements": 93321.33
}
}
}
}{
"requestId": "8fae81c0-194c-45a2-a077-e6e4fc3fb6d1",
"message": "error",
"data": {
"consent_expiry": [
"The consent expiry timestamp must be in the future. Please provide a valid timestamp."
]
}
}{
"requestId": "a337d820-3661-4ddd-a2fe-6da518b87935",
"message": "Authentication credentials were not provided.",
"data": null
}{
"requestId": "0aaf653a-148e-4cbf-8346-742de60bb2c9",
"message": "Employee not found",
"data": null
}{
"requestId": "be2915d5-fc30-4d13-bcca-3d62aefac2a0",
"message": "Internal Server Error",
"data": null
}Authorizations
Body
application/json
Organization UUID
Example:
"9e3ba089-5cb6-407c-93db-e3b7ccaff3ed"
Unique employee ID within the organization
Example:
"0078"
Consent statement or text given by the employee
Example:
"I have new consent."
Timestamp when the consent was given
Example:
"2024-11-20T10:30:00Z"
Consent expiration datetime
Example:
"2024-11-28T10:30:00Z"
⌘I

