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

# Get a webhook endpoint

GET https://api.pensar.dev/webhook-endpoints/{endpointId}

Requires the `settings:read` API key scope.

Reference: https://docs.pensar.dev/console/api/api-reference/webhook-endpoints/get-webhook-endpoint

## Authentication

- `Authorization` header (bearer token, required) — A workspace API key, sent as `Authorization: Bearer`.
- `x-api-key` header (required) — A workspace API key, sent as `x-api-key`.

## Request

### Path parameters

- `endpointId` (string, required) — Webhook endpoint UUID.

## Response

### 200

The endpoint and its recent deliveries.

- `endpoint` (WebhookEndpoint, required)
- `recentDeliveries` (list of WebhookDelivery, required) — The 20 most recent attempts.

## Errors

### 401 Unauthorized Error

The API key is missing or invalid.

- `error` (string, required) — What went wrong, naming the offending value when useful.

### 403 Forbidden Error

The credential lacks the required scope or is not allowed this action.

- `error` (string, required) — What went wrong, naming the offending value when useful.

### 404 Not Found Error

The resource does not exist in this workspace.

- `error` (string, required) — What went wrong, naming the offending value when useful.

## Types

### WebhookEndpoint

- `id` (string, required)
- `url` (string, required)
- `events` (list of enum, required)
  - Allowed values: `issue.created`, `issue.updated`, `issue.status_changed`, `retest.completed`, `pentest.completed`
- `enabled` (boolean, required)
- `description` (string, required, nullable)
- `health` (WebhookEndpointHealth, required) — Updated on every delivery attempt.
- `createdAt` (datetime, required)
- `updatedAt` (datetime, required)

### WebhookDelivery

- `id` (string, required) — Sent as the `X-Pensar-Delivery` header.
- `event` (enum, required)
  - Allowed values: `issue.created`, `issue.updated`, `issue.status_changed`, `retest.completed`, `pentest.completed`
- `status` (enum, required)
  - Allowed values: `pending`, `success`, `failed`
- `attempt` (integer, required)
- `responseCode` (integer, required, nullable)
- `responseBody` (string, required, nullable) — Truncated to 2 KB.
- `error` (string, required, nullable)
- `durationMs` (integer, required, nullable)
- `createdAt` (datetime, required)
- `deliveredAt` (datetime, required, nullable)

### WebhookEndpointHealth

Updated on every delivery attempt.

- `lastAttemptAt` (datetime, required, nullable)
- `lastStatus` (enum, required, nullable)
  - Allowed values: `success`, `failed`
- `lastResponseCode` (integer, required, nullable)
- `consecutiveFailures` (integer, required) — Reset on success. At 20 the endpoint is disabled.

## Examples

**Response**

```json
{
  "endpoint": {
    "id": "string",
    "url": "https://hooks.acme.example/pensar",
    "events": [
      "issue.created"
    ],
    "enabled": true,
    "description": "string",
    "health": {
      "lastAttemptAt": "2024-01-15T09:30:00Z",
      "lastStatus": "success",
      "lastResponseCode": 1,
      "consecutiveFailures": 1
    },
    "createdAt": "2024-01-15T09:30:00Z",
    "updatedAt": "2024-01-15T09:30:00Z"
  },
  "recentDeliveries": [
    {
      "id": "string",
      "event": "issue.created",
      "status": "pending",
      "attempt": 1,
      "responseCode": 1,
      "responseBody": "string",
      "error": "string",
      "durationMs": 1,
      "createdAt": "2024-01-15T09:30:00Z",
      "deliveredAt": "2024-01-15T09:30:00Z"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.pensar.dev/webhook-endpoints/endpointId"

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

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

print(response.json())
```

```javascript
const url = 'https://api.pensar.dev/webhook-endpoints/endpointId';
const options = {method: 'GET', 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
package main

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

func main() {

	url := "https://api.pensar.dev/webhook-endpoints/endpointId"

	req, _ := http.NewRequest("GET", 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
require 'uri'
require 'net/http'

url = URI("https://api.pensar.dev/webhook-endpoints/endpointId")

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

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

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.get("https://api.pensar.dev/webhook-endpoints/endpointId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.pensar.dev/webhook-endpoints/endpointId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.pensar.dev/webhook-endpoints/endpointId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.pensar.dev/webhook-endpoints/endpointId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```