> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Webhook

> Gets details about a specific webhook.

`Unary` · [`Webhooks`](/docs/api-reference/generated/webhook/overview)

Gets details about a specific webhook.

Use this method to:

* View webhook configuration
* Check webhook URL
* See bound workflow count

### Examples

* Get webhook details:

  Retrieves information about a specific webhook.

  ```yaml theme={null}
  webhookId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
  ```

## Endpoint

```text theme={null}
POST /api/gitpod.v1.WebhookService/GetWebhook
```

Send a Bearer token as described in [Authentication](/docs/api-reference#authenticate-requests). If your organization uses a custom management-plane domain, replace `https://app.ona.com` with that domain.

## Request example

<CodeGroup>
  ```bash cURL theme={null}
  export ONA_HOST=https://app.ona.com
  export ONA_API_KEY=<your-token>

  curl --request POST \
    --url "$ONA_HOST/api/gitpod.v1.WebhookService/GetWebhook" \
    --header "Authorization: Bearer $ONA_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
    "webhookId": "<webhook-id>"
  }'
  ```

  ```python Python theme={null}
  import gitpod.v1.webhook_pb2 as webhook_pb2
  from ona_sdk import create_client_from_env

  ona = create_client_from_env()
  request = webhook_pb2.GetWebhookRequest(
      webhook_id="<webhook-id>",
  )
  response = ona.services.webhook.get_webhook(request)
  print(response)
  ```

  ```typescript TypeScript theme={null}
  import { create } from "@bufbuild/protobuf";
  import { createClientFromEnv } from "@gitpod/sdk";
  import { GetWebhookRequestSchema } from "@gitpod/sdk/gitpod/v1/webhook_pb";

  async function main() {
    const ona = createClientFromEnv();
    const request = create(GetWebhookRequestSchema, {
      webhookId: "<webhook-id>",
    });
    const response = await ona.services.webhook.getWebhook(request);
    console.log(response);
  }

  main().catch(console.error);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"log"

  	"connectrpc.com/connect"
  	"github.com/gitpod-io/gitpod-sdk-go/sdk"
  	gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
  )

  func main() {
  	ona, err := sdk.NewFromEnv()
  	if err != nil {
  		log.Fatal(err)
  	}

  	request := connect.NewRequest(&gitpodpb.GetWebhookRequest{
  		WebhookId: "<webhook-id>",
  	})
  	response, err := ona.Services.Webhook.GetWebhook(context.Background(), request)
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(response.Msg)
  }
  ```

  ```json Request body theme={null}
  {
    "webhookId": "<webhook-id>"
  }
  ```
</CodeGroup>

## Request

`gitpod.v1.GetWebhookRequest`

GetWebhookRequest gets details about a specific webhook.

| Field       | Type   | Required | Description                      |
| ----------- | ------ | -------- | -------------------------------- |
| `webhookId` | string | No       | Constraints: `string.uuid=true`. |

## Response

`gitpod.v1.GetWebhookResponse`

| Field     | Type                               | Required | Description |
| --------- | ---------------------------------- | -------- | ----------- |
| `webhook` | [Webhook](#type-gitpod-v1-webhook) | No       |             |

## Related types

<a id="type-gitpod-v1-webhook" />

<Accordion title="Webhook">
  Webhook represents a webhook endpoint for receiving SCM events.

  `gitpod.v1.Webhook`

  | Field                | Type                                         | Required | Description                                                                                                                                         |
  | -------------------- | -------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `id`                 | string                                       | No       | id is the unique identifier of the webhook Constraints: `string.uuid=true`.                                                                         |
  | `metadata`           | [Metadata](#type-gitpod-v1-webhook-metadata) | No       | metadata contains organizational and ownership information                                                                                          |
  | `spec`               | [Spec](#type-gitpod-v1-webhook-spec)         | No       | spec contains the webhook configuration                                                                                                             |
  | `url`                | string                                       | No       | url is the generated webhook endpoint URL Format: https\://\{domain}/webhooks/\{id} Read-only, computed from id                                     |
  | `boundWorkflowCount` | integer                                      | No       | bound\_workflow\_count is the number of workflows bound to this webhook Read-only, computed from workflow\_webhook\_bindings                        |
  | `lastTriggeredAt`    | RFC 3339 timestamp                           | No       | last\_triggered\_at is when the webhook was last triggered by an incoming event Read-only, updated automatically when the webhook receives an event |
</Accordion>

<a id="type-gitpod-v1-webhook-metadata" />

<Accordion title="Metadata">
  Metadata contains organizational and ownership information.

  `gitpod.v1.Webhook.Metadata`

  | Field            | Type               | Required | Description                                                                                            |
  | ---------------- | ------------------ | -------- | ------------------------------------------------------------------------------------------------------ |
  | `organizationId` | string             | No       | organization\_id is the ID of the organization that owns this webhook Constraints: `string.uuid=true`. |
  | `name`           | string             | No       | name is the display name of the webhook                                                                |
  | `description`    | string             | No       | description is an optional description of the webhook's purpose                                        |
  | `creator`        | Subject            | No       | creator is the identity of who created the webhook                                                     |
  | `createdAt`      | RFC 3339 timestamp | No       | created\_at is when the webhook was created                                                            |
  | `updatedAt`      | RFC 3339 timestamp | No       | updated\_at is when the webhook was last updated                                                       |
</Accordion>

<a id="type-gitpod-v1-webhook-spec" />

<Accordion title="Spec">
  Spec contains the webhook configuration.

  `gitpod.v1.Webhook.Spec`

  | Field               | Type                                                | Required | Description                                                                                                                                                                                                                                       |
  | ------------------- | --------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `type`              | [WebhookType](#enum-gitpod-v1-webhook-type)         | No       | type determines the scope level of the webhook Constraints: `enum.defined_only=true`.                                                                                                                                                             |
  | `scope`             | string                                              | No       | **Deprecated.** Deprecated: Use scopes instead. Kept for backward compatibility. scope is the target of the webhook: - For REPOSITORY type: "owner/repo" (e.g., "gitpod-io/gitpod") - For ORGANIZATION type: "owner" (e.g., "gitpod-io")          |
  | `provider`          | [WebhookProvider](#enum-gitpod-v1-webhook-provider) | No       | provider is the Git provider (github, gitlab) Constraints: `enum.defined_only=true`.                                                                                                                                                              |
  | `scopes`            | array of WebhookRepositoryScope                     | No       | scopes is the list of repository scopes for this webhook. For REPOSITORY type: each entry represents a specific repository. When scopes is non-empty, it takes precedence over the deprecated scope field. Constraints: `repeated.max_items=100`. |
  | `organizationScope` | WebhookOrganizationScope                            | No       | organization\_scope is the SCM organization scope for this webhook. For ORGANIZATION type: identifies the organization and its SCM host. When set, takes precedence over the deprecated scope field.                                              |
</Accordion>

<a id="enum-gitpod-v1-webhook-provider" />

<Accordion title="WebhookProvider">
  WebhookProvider identifies the Git provider.

  | Value                          | Number | Description                                                   |
  | ------------------------------ | -----: | ------------------------------------------------------------- |
  | `WEBHOOK_PROVIDER_UNSPECIFIED` |      0 |                                                               |
  | `WEBHOOK_PROVIDER_GITHUB`      |      1 |                                                               |
  | `WEBHOOK_PROVIDER_GITLAB`      |      2 |                                                               |
  | `WEBHOOK_PROVIDER_BITBUCKET`   |      3 | WEBHOOK\_PROVIDER\_BITBUCKET is the bitbucket cloud provider. |
</Accordion>

<a id="enum-gitpod-v1-webhook-type" />

<Accordion title="WebhookType">
  WebhookType determines the scope level of the webhook.

  | Value                           | Number | Description                                           |
  | ------------------------------- | -----: | ----------------------------------------------------- |
  | `WEBHOOK_TYPE_UNSPECIFIED`      |      0 |                                                       |
  | `WEBHOOK_TYPE_SCM_REPOSITORY`   |      1 | Scoped to a specific repository (e.g., "owner/repo")  |
  | `WEBHOOK_TYPE_SCM_ORGANIZATION` |      2 | Scoped to an organization (e.g., "owner" - all repos) |
</Accordion>
