# Retrieve a webhook

Source: https://developers.swell.is/backend-api/webhooks/retrieve-a-webhook

Retrieve an existing webhook using the id that was returned during creation.

## Arguments

- `id` (objectId, auto): The unique identifier for the webhook.
- `alias` (string): Alias used to refer to the webhook configuration.
- `api` (string, required): API the webhook subscribes to—`com` for the store API.
- `url` (string, required): URL endpoint for the webhook.
- `events` (array of string, required): Array of trigger events for the webhook.
- `enabled` (boolean): Determines whether the webhook is enabled. Defaults to `false`. Default: `false`.
- `auto_disabled` (boolean, auto): Indicates whether the webhook was automatically disabled. This occurs when the webhook has failed for 4 days with no successful delivery in that time.
- `retry_disabled_events` (boolean): Determines whether the webhook retries disabled events.
- `attempts_failed` (int): The number of failed webhook attempts.
- `date_first_failed` (date, auto): The date of the webhook's first failed attempt.
- `date_last_success` (date): Date of the last successful webhook delivery.
- `date_last_warned` (date, auto): The date of the last warning for a failed attempt.
- `date_final_attempt` (date): The final attempt for a webhook after continuous failed attempts. Webhooks are disabled after failing for 4 days with no successful delivery.

## Example request

`GET /:webhooks/:id`

**cURL**

```bash
$ curl https://api.swell.store/:webhooks/662ba123becf7601325cefa3 \
  -u store-id:secret-key
```

**Node**

```javascript
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');

await swell.get('/:webhooks/{id}', {
  id: '662ba123becf7601325cefa3'
});
```

**PHP**

```php
<?php $swell = new \Swell\Client('store-id', 'secret-key');

$swell->get('/:webhooks/{id}', [
  'id' => '662ba123becf7601325cefa3'
]);
```

## Example response

```json
{
  "url": "http://localhost:5000",
  "enabled": false,
  "alias": "webhook",
  "description": null,
  "events": [
    "order.created",
    "order.submitted",
    "order.updated"
  ],
  "api": "com",
  "date_final_attempt": null,
  "date_scheduled": null,
  "date_created": "2021-09-27T16:30:11.837Z",
  "date_updated": "2021-10-28T16:04:21.648Z",
  "id": "6151f193ae97e82ccbf6f0a7"
}
```
