> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.paywithatoa.co.uk/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Endpoint | Webhooks API

> Delete endpoint via the Atoa Webhooks API, request parameters, response schema and code samples in cURL, Python, JavaScript, PHP, Go and Java.

Permanently deletes a webhook endpoint and all its event subscriptions. Webhook deliveries stop immediately.

### Authorization

Bearer `<token>`

**Path Parameters**

<ParamField path="endpointId" type="string" required>
  The unique identifier of the endpoint to delete.
</ParamField>

**Response**

Returns `200 OK` with a JSON body on success.

<RequestExample>
  ```bash cURL theme={null}
  curl --request DELETE \
    --url https://api.atoa.me/api/webhook/v2/endpoints/4a124f25-fe8d-47a0-92c8-16d94cbfe24c \
    --header 'Authorization: Bearer <token>'
  ```

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

  endpoint_id = "4a124f25-fe8d-47a0-92c8-16d94cbfe24c"
  url = f"https://api.atoa.me/api/webhook/v2/endpoints/{endpoint_id}"

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

  response = requests.request("DELETE", url, headers=headers)
  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const endpointId = "4a124f25-fe8d-47a0-92c8-16d94cbfe24c";

  fetch(`https://api.atoa.me/api/webhook/v2/endpoints/${endpointId}`, {
    method: 'DELETE',
    headers: { Authorization: 'Bearer <token>' }
  })
    .then(response => console.log(response.status)) // 200 on success
    .catch(err => console.error(err));
  ```

  ```php PHP theme={null}
  <?php

  $curl = curl_init();

  $endpointId = "4a124f25-fe8d-47a0-92c8-16d94cbfe24c";

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.atoa.me/api/webhook/v2/endpoints/{$endpointId}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => [
      "Authorization: Bearer <token>"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

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

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

  func main() {

  	endpointId := "4a124f25-fe8d-47a0-92c8-16d94cbfe24c"
  	url := "https://api.atoa.me/api/webhook/v2/endpoints/" + endpointId

  	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(string(body))

  }
  ```

  ```java Java theme={null}
  HttpResponse<String> response = Unirest.delete("https://api.atoa.me/api/webhook/v2/endpoints/{endpointId}")
    .header("Authorization", "Bearer <token>")
    .routeParam("endpointId", "4a124f25-fe8d-47a0-92c8-16d94cbfe24c")
    .asString();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "message": "Webhook endpoint deleted successfully"
  }
  ```

  ```json 401 theme={null}
  {
    "name": "UNAUTHORIZED",
    "message": "Unauthorized",
    "status": 401,
    "errors": "[]"
  }
  ```

  ```json 404 theme={null}
  {
    "name": "NOT_FOUND",
    "message": "Webhook not found",
    "status": 404
  }
  ```
</ResponseExample>

<ResponseField name="success" type="boolean">
  `true` when the endpoint was successfully deleted.
</ResponseField>

<ResponseField name="message" type="string">
  Webhook endpoint deleted successfully
</ResponseField>
