> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hirempire.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a job

> Delete a job posting from your Hirempire account

## Parameters

<ParamField query="job_id" type="string" required placeholder="Enter job ID">
  The job ID to retrieve
</ParamField>

## Authentication

<ResponseField name="Authorization" type="string" required>
  Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request DELETE 'https://api.hirempire.com/v1/delete-job?job_id={job_id}' \
  --header 'Authorization: Bearer YOUR_TOKEN'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.hirempire.com/v1/delete-job?job_id={job_id}', {
    method: 'DELETE',
    headers: {
      'Authorization': 'Bearer YOUR_TOKEN'
    }
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.hirempire.com/v1/delete-job"
  headers = {
      "Authorization": "Bearer YOUR_TOKEN"
  }
  params = {
      "job_id": "{job_id}"
  }

  response = requests.delete(url, headers=headers, params=params)
  data = response.json()
  print(data)
  ```

  ```php PHP theme={null}
  <?php
  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api.hirempire.com/v1/delete-job?job_id={job_id}',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => array(
      'Authorization: Bearer YOUR_TOKEN'
    ),
  ));

  $response = curl_exec($curl);
  curl_close($curl);

  $data = json_decode($response, true);
  print_r($data);
  ?>
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'

  uri = URI('https://api.hirempire.com/v1/delete-job')
  uri.query = URI.encode_www_form({ job_id: '{job_id}' })

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

  request = Net::HTTP::Delete.new(uri)
  request['Authorization'] = 'Bearer YOUR_TOKEN'

  response = http.request(request)
  data = JSON.parse(response.body)
  puts data
  ```

  ```go Go theme={null}
  package main

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

  func main() {
      client := &http.Client{}
      req, _ := http.NewRequest("DELETE", "https://api.hirempire.com/v1/delete-job?job_id={job_id}", nil)
      req.Header.Add("Authorization", "Bearer YOUR_TOKEN")
      
      resp, _ := client.Do(req)
      defer resp.Body.Close()
      
      body, _ := io.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.URI;

  public class HirempireAPI {
      public static void main(String[] args) throws Exception {
          HttpClient client = HttpClient.newHttpClient();
          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create("https://api.hirempire.com/v1/delete-job?job_id={job_id}"))
              .header("Authorization", "Bearer YOUR_TOKEN")
              .DELETE()
              .build();
              
          HttpResponse<String> response = client.send(request, 
              HttpResponse.BodyHandlers.ofString());
          System.out.println(response.body());
      }
  }
  ```

  ```csharp C# theme={null}
  using System;
  using System.Net.Http;
  using System.Threading.Tasks;

  class Program
  {
      private static readonly HttpClient client = new HttpClient();

      static async Task Main(string[] args)
      {
          client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_TOKEN");
          
          HttpResponseMessage response = await client.DeleteAsync("https://api.hirempire.com/v1/delete-job?job_id={job_id}");
          string responseBody = await response.Content.ReadAsStringAsync();
          
          Console.WriteLine(responseBody);
      }
  }
  ```

  ```swift Swift theme={null}
  import Foundation

  let url = URL(string: "https://api.hirempire.com/v1/delete-job?job_id={job_id}")!
  var request = URLRequest(url: url)
  request.httpMethod = "DELETE"
  request.setValue("Bearer YOUR_TOKEN", forHTTPHeaderField: "Authorization")

  let task = URLSession.shared.dataTask(with: request) { data, response, error in
      if let data = data {
          let json = try? JSONSerialization.jsonObject(with: data)
          print(json ?? "No data")
      }
  }

  task.resume()
  ```

  ```kotlin Kotlin theme={null}
  import kotlinx.coroutines.*
  import java.net.http.HttpClient
  import java.net.http.HttpRequest
  import java.net.http.HttpResponse
  import java.net.URI

  fun main() = runBlocking {
      val client = HttpClient.newHttpClient()
      val request = HttpRequest.newBuilder()
          .uri(URI.create("https://api.hirempire.com/v1/delete-job?job_id={job_id}"))
          .header("Authorization", "Bearer YOUR_TOKEN")
          .DELETE()
          .build()
          
      val response = client.send(request, HttpResponse.BodyHandlers.ofString())
      println(response.body())
  }
  ```

  ```rust Rust theme={null}
  use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION};

  #[tokio::main]
  async fn main() -> Result<(), Box<dyn std::error::Error>> {
      let mut headers = HeaderMap::new();
      headers.insert(AUTHORIZATION, HeaderValue::from_str("Bearer YOUR_TOKEN")?);
      
      let client = reqwest::Client::new();
      let response = client
          .delete("https://api.hirempire.com/v1/delete-job")
          .query(&[("job_id", "{job_id}")])
          .headers(headers)
          .send()
          .await?;
          
      let body = response.text().await?;
      println!("{}", body);
      
      Ok(())
  }
  ```
</RequestExample>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the job was deleted successfully
</ResponseField>

<ResponseField name="job_id" type="string">
  The unique identifier of the deleted job
</ResponseField>

<ResponseField name="message" type="string">
  Confirmation message about the deletion
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "job_id": "f3a2c1d4-1111-4222-9333-444455556666",
    "message": "Job deleted successfully",
    "deleted": "2026-06-27T10:42:00.000Z"
  }
  ```
</ResponseExample>

<Info>
  Jobs are **soft-deleted** — they are flagged as `archived` rather than removed from the database. The `id` of an archived job remains stable; subsequent GET requests for that id return `404 Not Found`.
</Info>

## Error Responses

### Authorization Errors

**400 - Bad Request**

```json theme={null}
{
    "success": false,
    "error": "Missing 'Authorization' header."
}
```

**400 - Bad Request**

```json theme={null}
{
    "success": false,
    "error": "Authorization header must start with 'Bearer '."
}
```

### Request Format Errors

**400 - Bad Request**

```json theme={null}
{
    "success": false,
    "error": "Request params are not allowed."
}
```

**400 - Bad Request**

```json theme={null}
{
    "success": false,
    "error": "Request body is not allowed."
}
```

**400 - Bad Request**

```json theme={null}
{
    "success": false,
    "error": "Missing required query parameter 'job_id'."
}
```

**400 - Bad Request**

```json theme={null}
{
    "success": false,
    "error": "Only 'job_id' query parameter is allowed."
}
```

### Token Validation Errors

**401 - Unauthorized**

```json theme={null}
{
    "success": false,
    "error": "Invalid token"
}
```

**401 - Unauthorized**

```json theme={null}
{
    "success": false,
    "error": "Token is expired"
}
```

### Job Access Errors

**404 - Not Found**

```json theme={null}
{
    "success": false,
    "error": "Job not found"
}
```
