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

# Cancel Case

DELETE https://ops-test.hugin.com.tr/api/v1/cases/48

# Cancel Case - Talep İptal

Talep takip numarası ile oluşturulan talebi iptal eder.

## Path Parameters

| Parametre  | Tip | Açıklama             |
| ---------- | --- | -------------------- |
| `{caseId}` | int | Talep takip numarası |

## İş Kuralları

1. Talep durumu "New" olmalıdır
2. İptal edilmiş talep tekrar iptal edilemez (idempotent)

Reference: https://ops-apidoc.hugin.co/hugin-ops-api/cases/cancel-case

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Response

### 200

OK

- `status` (string, required)
- `data` (object, required)
  - `caseId` (integer, required)
- `metadata` (object, required)
  - `instance` (string, required)
  - `timestamp` (datetime, required)

## Errors

### 400 Bad Request Error

Bad Request

- `status` (string, required)
- `error` (object, required)
  - `code` (string, required)
  - `title` (string, required)
  - `description` (string, required)
- `metadata` (object, required)
  - `instance` (string, required)
  - `timestamp` (datetime, required)

### 404 Not Found Error

Not Found

- `status` (string, required)
- `error` (object, required)
  - `code` (string, required)
  - `title` (string, required)
  - `description` (string, required)
- `metadata` (object, required)
  - `instance` (string, required)
  - `timestamp` (datetime, required)

## Examples

**Response**

```json
{
  "status": "SUCCESS",
  "data": {
    "caseId": 456
  },
  "metadata": {
    "instance": "/api/v1/cases/21027",
    "timestamp": "2026-01-02T06:32:02.596341Z"
  }
}
```

**SDK Code**

```python Success - Case Cancelled
import requests

url = "https://ops-test.hugin.com.tr/api/v1/cases/48"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript Success - Case Cancelled
const url = 'https://ops-test.hugin.com.tr/api/v1/cases/48';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

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

```go Success - Case Cancelled
package main

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

func main() {

	url := "https://ops-test.hugin.com.tr/api/v1/cases/48"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby Success - Case Cancelled
require 'uri'
require 'net/http'

url = URI("https://ops-test.hugin.com.tr/api/v1/cases/48")

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

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Success - Case Cancelled
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://ops-test.hugin.com.tr/api/v1/cases/48")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Success - Case Cancelled
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://ops-test.hugin.com.tr/api/v1/cases/48', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Success - Case Cancelled
using RestSharp;

var client = new RestClient("https://ops-test.hugin.com.tr/api/v1/cases/48");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Success - Case Cancelled
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://ops-test.hugin.com.tr/api/v1/cases/48")! 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()
```