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

# Delete a finished Job and erase its data

DELETE https://api.morphiaone.ai/v1/jobs/{job_id}

Erases a terminal job's input snapshot and result bytes now and keeps a minimal
durable tombstone for usage, audit and idempotency. After it, `GET` answers
`404 JOB_NOT_FOUND` and a request reusing the job's `Idempotency-Key` answers
`410 JOB_DELETED`; the key stays claimed until its retention ends. A `queued` or
`running` job answers `409 JOB_IN_PROGRESS`: cancel it and wait first. Usage
already recorded for the job is unchanged. Idempotent: a repeat answers `204`.
Requires the scope of the job's operation.

Reference: https://docs.morphiaone.ai/api-reference/endpoints/jobs/delete

## Authentication

- `X-API-Key` header (required) — API key for one environment of your account. Keep server-side; never expose in browser clients.

## Request

### Path parameters

- `job_id` (string, required)

## Response

### 204

Job deleted and its bytes erased (or already deleted)

## Errors

### 400 Bad Request Error

Invalid request

- `error` (ErrorDetail, required)

### 401 Unauthorized Error

Missing API key

- `error` (ErrorDetail, required)

### 403 Forbidden Error

Invalid API key or missing scope

- `error` (ErrorDetail, required)

### 404 Not Found Error

Job not found

- `error` (ErrorDetail, required)

### 409 Conflict Error

Job still queued or running

- `error` (ErrorDetail, required)

### 500 Internal Server Error

Unexpected server error

- `error` (ErrorDetail, required)

### 503 Service Unavailable Error

Job store unavailable

- `error` (ErrorDetail, required)

## Types

### ErrorDetail

- `code` (string, required)
- `message` (string, required)
- `request_id` (string, required)
- `details` (ErrorDetailDetails, optional)
- `doc_url` (string, optional, nullable)
- `retryable` (boolean, optional, nullable)

### ErrorDetailDetails

## Examples

**SDK Code**

```python
import requests

url = "https://api.morphiaone.ai/v1/jobs/job_id"

headers = {"X-API-Key": "<apiKey>"}

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

print(response.json())
```

```javascript
const url = 'https://api.morphiaone.ai/v1/jobs/job_id';
const options = {method: 'DELETE', headers: {'X-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://api.morphiaone.ai/v1/jobs/job_id"

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

	req.Header.Add("X-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://api.morphiaone.ai/v1/jobs/job_id")

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

request = Net::HTTP::Delete.new(url)
request["X-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://api.morphiaone.ai/v1/jobs/job_id")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.morphiaone.ai/v1/jobs/job_id', [
  'headers' => [
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.morphiaone.ai/v1/jobs/job_id");
var request = new RestRequest(Method.DELETE);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.morphiaone.ai/v1/jobs/job_id")! 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()
```