# org.tangled.webhook.defs

- Kind: defs
- Authority: webhook.tangled.org
- Lexicon: 1
- Published by [tangled.org](https://lexicon.garden/identity/did:plc:wshs7t2adsemcrrd4snkeqli), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:wshs7t2adsemcrrd4snkeqli/org.tangled.webhook.defs)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:wshs7t2adsemcrrd4snkeqli/org.tangled.webhook.defs/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:wshs7t2adsemcrrd4snkeqli/org.tangled.webhook.defs/analytics)

## #delivery (`org.tangled.webhook.defs#delivery`)

Type: object

### Properties

- `createdAt` (string · datetime, required)
- `event` (ref, required): Event type that triggered the delivery.
  - Reference: `#eventType`
- `id` (string, required): Unique ID for tracking this delivery attempt.
- `requestBody` (bytes)
- `responseBody` (bytes)
- `responseCode` (integer)
- `success` (boolean, required)
- `url` (string · uri, required)
- `webhook` (string, required): ID of the webhook this delivery belongs to.

## #eventType (`org.tangled.webhook.defs#eventType`)

Type: string

Constraints: knownValues: push | repository:renamed | pull_request:created | pull_request:resubmitted | pull_request:merged | pull_request:closed | pull_request:reopened | org.tangled.event.pullRequest

## #webhook (`org.tangled.webhook.defs#webhook`)

Type: object

### Properties

- `active` (boolean, required): Whether the webhook is currently enabled.
- `createdAt` (string · datetime, required)
- `events` (array, required): Event types this webhook is subscribed to.
  - `items` (ref)
    - Reference: `#eventType`
- `id` (string, required): Webhook identifier.
- `updatedAt` (string · datetime)
- `url` (string · uri, required): Endpoint URL that receives webhook payloads.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "delivery": {
      "properties": {
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "event": {
          "description": "Event type that triggered the delivery.",
          "ref": "#eventType",
          "type": "ref"
        },
        "id": {
          "description": "Unique ID for tracking this delivery attempt.",
          "type": "string"
        },
        "requestBody": {
          "type": "bytes"
        },
        "responseBody": {
          "type": "bytes"
        },
        "responseCode": {
          "type": "integer"
        },
        "success": {
          "type": "boolean"
        },
        "url": {
          "format": "uri",
          "type": "string"
        },
        "webhook": {
          "description": "ID of the webhook this delivery belongs to.",
          "type": "string"
        }
      },
      "required": [
        "id",
        "webhook",
        "event",
        "url",
        "success",
        "createdAt"
      ],
      "type": "object"
    },
    "eventType": {
      "knownValues": [
        "push",
        "repository:renamed",
        "pull_request:created",
        "pull_request:resubmitted",
        "pull_request:merged",
        "pull_request:closed",
        "pull_request:reopened",
        "org.tangled.event.pullRequest"
      ],
      "type": "string"
    },
    "webhook": {
      "properties": {
        "active": {
          "description": "Whether the webhook is currently enabled.",
          "type": "boolean"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "events": {
          "description": "Event types this webhook is subscribed to.",
          "items": {
            "ref": "#eventType",
            "type": "ref"
          },
          "type": "array"
        },
        "id": {
          "description": "Webhook identifier.",
          "type": "string"
        },
        "updatedAt": {
          "format": "datetime",
          "type": "string"
        },
        "url": {
          "description": "Endpoint URL that receives webhook payloads.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "id",
        "url",
        "active",
        "events",
        "createdAt"
      ],
      "type": "object"
    }
  },
  "id": "org.tangled.webhook.defs",
  "lexicon": 1
}
```
