> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.crehana.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.crehana.com/_mcp/server.

# Delete Time Off Request

DELETE https://www.crehana.com/api/v5/rest/org/{organization_slug}/timeoff/requests/{request_id}/

Deletes a time off request of the organization. The request stops counting as vacations/leave and the time it had consumed is released back to the user's balance. A request that no longer exists cannot be deleted.

Reference: https://developer.crehana.com/api-reference/endpoints/time-off/delete-timeoff-request

## Authentication

- `Api-Key` header (required) — API key of the organization. Always sent together with the `Secret-Access` header.

## Servers

- `https://www.crehana.com` (Production, default)
- `https://qa.creha.co` (QA)

## Request

### Path parameters

- `organization_slug` (string, required)
- `request_id` (integer, required)

## Response

### 200

Time off request deleted

- `success` (boolean, required) — True when the request was deleted.
- `message` (string, required) — Human readable result of the deletion.
- `code` (string, required) — Result code of the operation, namespaced by section — not an HTTP status. The reason of a failed deletion travels in the error payload instead.
- `datetime` (string, required) — Datetime of the API in ISO Format
- `data` (DeletedTimeoffRequest, required) — Identification of the deleted time off request.

## Errors

### 400 Bad Request Error

Bad Request

- `message` (string, required)
- `errors` (list of string, required)
- `datetime` (string, optional)

### 403 Forbidden Error

Forbidden

- `message` (string, required)
- `errors` (list of string, required)
- `datetime` (string, optional)

### 404 Not Found Error

Not Found

- `message` (string, required)
- `errors` (list of string, required)
- `datetime` (string, optional)

### 409 Conflict Error

Conflict

- `message` (string, required)
- `errors` (list of string, required)
- `datetime` (string, optional)

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### DeletedTimeoffRequest

The time off request the call deleted.

- `request_id` (string, required) — Id of the deleted time off request.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

## Examples

**Response**

```json
{
  "success": true,
  "message": "string",
  "code": "string",
  "datetime": "string",
  "data": {
    "request_id": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://www.crehana.com/api/v5/rest/org/organization_slug/timeoff/requests/1/"

headers = {
    "Secret-Access": "Secret-Access",
    "Api-Key": "<apiKey>"
}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://www.crehana.com/api/v5/rest/org/organization_slug/timeoff/requests/1/';
const options = {
  method: 'DELETE',
  headers: {'Secret-Access': 'Secret-Access', 'Api-Key': '<apiKey>'}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://www.crehana.com/api/v5/rest/org/organization_slug/timeoff/requests/1/"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Secret-Access", "Secret-Access")
	req.Header.Add("Api-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://www.crehana.com/api/v5/rest/org/organization_slug/timeoff/requests/1/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Secret-Access"] = 'Secret-Access'
request["Api-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://www.crehana.com/api/v5/rest/org/organization_slug/timeoff/requests/1/")
  .header("Secret-Access", "Secret-Access")
  .header("Api-Key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://www.crehana.com/api/v5/rest/org/organization_slug/timeoff/requests/1/', [
  'headers' => [
    'Api-Key' => '<apiKey>',
    'Secret-Access' => 'Secret-Access',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://www.crehana.com/api/v5/rest/org/organization_slug/timeoff/requests/1/");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Secret-Access", "Secret-Access");
request.AddHeader("Api-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Secret-Access": "Secret-Access",
  "Api-Key": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://www.crehana.com/api/v5/rest/org/organization_slug/timeoff/requests/1/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```