npm · Schema

Hook

A webhook subscription object that defines what registry events trigger notifications and where those notifications are sent.

PackagesJavaScriptNode.jsPackage ManagementRegistrySecurity

Properties

Name Type Description
id string The unique identifier for this hook subscription.
username string The npm username of the hook owner.
name string The name of the entity being watched. For packages, this is the package name. For scopes, this is the scope name. For owners, this is the npm username.
type string The type of entity being watched.
endpoint string The URI where webhook payloads will be sent via HTTP POST.
last_delivery object Information about the last delivery attempt.
response_code integer The HTTP response code from the last delivery attempt.
status string The current status of the hook subscription.
created string When the hook was created.
updated string When the hook was last updated.
View JSON Schema on GitHub

JSON Schema

npm-hook-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/Hook",
  "title": "Hook",
  "type": "object",
  "description": "A webhook subscription object that defines what registry events trigger notifications and where those notifications are sent.",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique identifier for this hook subscription."
    },
    "username": {
      "type": "string",
      "description": "The npm username of the hook owner."
    },
    "name": {
      "type": "string",
      "description": "The name of the entity being watched. For packages, this is the package name. For scopes, this is the scope name. For owners, this is the npm username."
    },
    "type": {
      "type": "string",
      "description": "The type of entity being watched.",
      "enum": [
        "package",
        "scope",
        "owner"
      ]
    },
    "endpoint": {
      "type": "string",
      "format": "uri",
      "description": "The URI where webhook payloads will be sent via HTTP POST."
    },
    "last_delivery": {
      "type": "object",
      "description": "Information about the last delivery attempt.",
      "properties": {
        "id": {
          "type": "string",
          "description": "The identifier of the last delivery."
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "When the last delivery was attempted."
        },
        "status": {
          "type": "integer",
          "description": "The HTTP status code received from the endpoint."
        }
      }
    },
    "response_code": {
      "type": "integer",
      "description": "The HTTP response code from the last delivery attempt."
    },
    "status": {
      "type": "string",
      "description": "The current status of the hook subscription."
    },
    "created": {
      "type": "string",
      "format": "date-time",
      "description": "When the hook was created."
    },
    "updated": {
      "type": "string",
      "format": "date-time",
      "description": "When the hook was last updated."
    }
  }
}