> ## 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.

# List Webhooks

> Lists webhooks with optional filtering.

`Unary` · [`Webhooks`](https://ona.com/docs/api-reference/generated/webhook/overview)

Lists webhooks with optional filtering.

Use this method to:

* View all webhooks in an organization
* Filter webhooks by type or provider

### Examples

* List all webhooks:

  Shows all webhooks with pagination.

  ```yaml theme={null}
  pagination:
    pageSize: 20
  ```

## Endpoint

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

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

## Request example

```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/ListWebhooks" \
  --header "Authorization: Bearer $ONA_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "pagination": {
    "pageSize": 1
  }
}'
```

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

ona = create_client_from_env()
request = webhook_pb2.ListWebhooksRequest(
    pagination=pagination_pb2.PaginationRequest(
        page_size=1,
    ),
)
response = ona.services.webhook.list_webhooks(request)
print(response)
```

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

async function main() {
  const ona = createClientFromEnv();
  const request = create(ListWebhooksRequestSchema, {
    pagination: {
      pageSize: 1,
    },
  });
  const response = await ona.services.webhook.listWebhooks(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.ListWebhooksRequest{
		Pagination: &gitpodpb.PaginationRequest{
			PageSize: 1,
		},
	})
	response, err := ona.Services.Webhook.ListWebhooks(context.Background(), request)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(response.Msg)
}
```

```json Request body theme={null}
{
  "pagination": {
    "pageSize": 1
  }
}
```

## Request

`gitpod.v1.ListWebhooksRequest`

ListWebhooksRequest lists webhooks with optional filtering.

| Field | Type | Required | Description |
| - | - | - | - |
| `pagination` | [PaginationRequest](#type-gitpod-v1-pagination-request) | No | |
| `filter` | [Filter](#type-gitpod-v1-list-webhooks-request-filter) | No | |

## Response

`gitpod.v1.ListWebhooksResponse`

| Field | Type | Required | Description |
| - | - | - | - |
| `pagination` | [PaginationResponse](#type-gitpod-v1-pagination-response) | No | |
| `webhooks` | array of [Webhook](#type-gitpod-v1-webhook) | No | |

## Related types

> [accordion] Filter
>
> `gitpod.v1.ListWebhooksRequest.Filter`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `webhookIds` | array of string | No | webhook\_ids filters by specific webhook IDs Constraints: `repeated.items.string.uuid=true, repeated.max_items=25`. |
> | `types` | array of [WebhookType](#enum-gitpod-v1-webhook-type) | No | types filters by webhook type Constraints: `repeated.max_items=5`. |
> | `providers` | array of [WebhookProvider](#enum-gitpod-v1-webhook-provider) | No | providers filters by webhook provider Constraints: `repeated.max_items=5`. |

> [accordion] PaginationRequest
>
> `gitpod.v1.PaginationRequest`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `pageSize` | integer | No | Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. Constraints: `int32.gte=0, int32.lte=100`. |
> | `token` | string | No | Token for the next set of results that was returned as next\_token of a PaginationResponse |

> [accordion] PaginationResponse
>
> `gitpod.v1.PaginationResponse`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `nextToken` | string | No | Token passed for retrieving the next set of results. Empty if there are no more results |

> [accordion] 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] 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] 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] 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] 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) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.