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

# Delete Call Logs by ID

> Delete specific call-log entries by ID.

Permanently removes the call-log rows whose IDs are listed in the request body. Use this to clean up specific entries the operator picked from the call-log table.

<Note>
  IDs are accepted in the **request body** even though the method is `DELETE`. The `getmcp/v1` REST controller registers the same route for `GET` (list) and `DELETE` (this endpoint), keying off the HTTP method.
</Note>

<Note>
  Permission is gated on the WordPress core capability `manage_options` — site admins only. Users with the lighter `getmcp_view_analytics` capability can read call logs but cannot delete them.
</Note>

## Body Parameters

<ParamField body="ids" type="array" required>
  Array of call-log row IDs (integers) to delete. Non-integer values are filtered out before the SQL runs; an empty result yields a `400`.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request DELETE \
       --url https://yoursite.com/wp-json/getmcp/v1/analytics/calls \
       --header 'Authorization: Bearer gmcp_your_api_key' \
       --header 'content-type: application/json' \
       --data '{
         "ids": [1042, 1041, 1037]
       }'
  ```

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

  response = requests.delete(
      "https://yoursite.com/wp-json/getmcp/v1/analytics/calls",
      headers={
          "Authorization": "Bearer gmcp_your_api_key",
          "Content-Type": "application/json",
      },
      json={"ids": [1042, 1041, 1037]},
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://yoursite.com/wp-json/getmcp/v1/analytics/calls",
    {
      method: "DELETE",
      headers: {
        "Authorization": "Bearer gmcp_your_api_key",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ ids: [1042, 1041, 1037] }),
    }
  );
  const data = await response.json();
  ```

  ```php PHP theme={null}
  $response = wp_remote_request(
      "https://yoursite.com/wp-json/getmcp/v1/analytics/calls",
      [
          "method"  => "DELETE",
          "headers" => [
              "Authorization" => "Bearer gmcp_your_api_key",
              "Content-Type"  => "application/json",
          ],
          "body" => wp_json_encode([ "ids" => [1042, 1041, 1037] ]),
      ]
  );
  $data = json_decode( wp_remote_retrieve_body( $response ), true );
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "deleted": 3
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "code": "rest_invalid_param",
    "message": "No valid IDs provided.",
    "data": { "status": 400 }
  }
  ```

  ```json 403 Forbidden theme={null}
  {
    "code": "rest_forbidden",
    "message": "Permission denied.",
    "data": { "status": 403 }
  }
  ```
</ResponseExample>

## Response Fields

<ResponseField name="deleted" type="integer">
  Number of rows actually removed by the `DELETE` query. IDs that didn't exist are simply ignored — they do not raise an error.
</ResponseField>
