curl --request POST \
--url https://api.v3.andteam.com/v1/leave-requests/{id}/withdraw \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://api.v3.andteam.com/v1/leave-requests/{id}/withdraw"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.v3.andteam.com/v1/leave-requests/{id}/withdraw', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.v3.andteam.com/v1/leave-requests/{id}/withdraw"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"employeeId": "<string>",
"companyId": "<string>",
"leaveTypeId": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"partOfDay": "am",
"amount": 123,
"unit": "days",
"status": "awaiting_approval",
"decidedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}Withdraw a leave request this key made
Needs the Leave field group’s Write switch. Takes back a request this key made while it still awaits approval. Only the key that filed a request may withdraw it; anything else is 409 not-withdrawable. Fires leave_request.decided with status withdrawn.
curl --request POST \
--url https://api.v3.andteam.com/v1/leave-requests/{id}/withdraw \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://api.v3.andteam.com/v1/leave-requests/{id}/withdraw"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.v3.andteam.com/v1/leave-requests/{id}/withdraw', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.v3.andteam.com/v1/leave-requests/{id}/withdraw"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"employeeId": "<string>",
"companyId": "<string>",
"leaveTypeId": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"partOfDay": "am",
"amount": 123,
"unit": "days",
"status": "awaiting_approval",
"decidedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
],
"fields": [
"<string>"
],
"existingId": "<string>",
"step": "<string>"
}Authorizations
Authorization: Bearer atk_live_… (a sandbox's keys are atk_test_…). Created in the API keys section of the Integrations settings; the secret is shown once.
Headers
Unique per request; reuse it only to retry the same request with the same body. Remembered 24 hours.
255Path Parameters
The leave request id.
Response
Withdrawn. The request as it now stands.
^\d{4}-\d{2}-\d{2}$^\d{4}-\d{2}-\d{2}$A half day: am or pm. Null for whole days.
am, pm Working days, or hours for an hours type, as counted when the request was made.
days, hours awaiting_approval, approved, declined, withdrawn The last approval or decline time, else the approval time. Null while the request awaits approval, or when nobody decided it. A request withdrawn after approval keeps its approval time.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$