Open Context Protocol is live! 🚀 Read the launch post
reposListWebhooks

reposListWebhooks

List repository webhooks

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/hooks
  • Operation ID: repos/list-webhooks

Parameters

{
  "owner": {
    "description": "The account owner of the repository. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "repo": {
    "description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "per_page": {
    "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "page": {
    "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
    "required": false,
    "location": "query",
    "type": "integer"
  }
}

Response Schema

{
  "type": "array",
  "items": {
    "title": "Webhook",
    "description": "Webhooks for repositories.",
    "type": "object",
    "properties": {
      "type": {
        "type": "string"
      },
      "id": {
        "description": "Unique identifier of the webhook.",
        "example": 42,
        "type": "integer"
      },
      "name": {
        "description": "The name of a valid service, use 'web' for a webhook.",
        "example": "web",
        "type": "string"
      },
      "active": {
        "description": "Determines whether the hook is actually triggered on pushes.",
        "type": "boolean",
        "example": true
      },
      "events": {
        "description": "Determines what events the hook is triggered for. Default: ['push'].",
        "type": "array",
        "items": {
          "type": "string"
        },
        "example": [
          "push",
          "pull_request"
        ]
      },
      "config": {
        "title": "Webhook Configuration",
        "description": "Configuration object of the webhook",
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "The URL to which the payloads will be delivered.",
            "example": "https://example.com/webhook",
            "format": "uri"
          },
          "content_type": {
            "type": "string",
            "description": "The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`.",
            "example": "\"json\""
          },
          "secret": {
            "type": "string",
            "description": "If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers).",
            "example": "\"********\""
          },
          "insecure_ssl": {
            "oneOf": [
              {
                "type": "string",
                "description": "Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.**",
                "example": "\"0\""
              },
              {
                "type": "number"
              }
            ]
          }
        }
      },
      "updated_at": {
        "type": "string",
        "format": "date-time",
        "example": "2011-09-06T20:39:23Z"
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "example": "2011-09-06T17:26:27Z"
      },
      "url": {
        "type": "string",
        "format": "uri",
        "example": "https://api.github.com/repos/octocat/Hello-World/hooks/1"
      },
      "test_url": {
        "type": "string",
        "format": "uri",
        "example": "https://api.github.com/repos/octocat/Hello-World/hooks/1/test"
      },
      "ping_url": {
        "type": "string",
        "format": "uri",
        "example": "https://api.github.com/repos/octocat/Hello-World/hooks/1/pings"
      },
      "deliveries_url": {
        "type": "string",
        "format": "uri",
        "example": "https://api.github.com/repos/octocat/Hello-World/hooks/1/deliveries"
      },
      "last_response": {
        "title": "Hook Response",
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "code",
          "status",
          "message"
        ]
      }
    },
    "required": [
      "id",
      "url",
      "type",
      "name",
      "active",
      "events",
      "config",
      "ping_url",
      "created_at",
      "updated_at",
      "last_response",
      "test_url"
    ]
  }
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('github')

# Call this tool
result = await agent.call_tool('reposListWebhooks', {
    # Add required parameters here
})