gitpod.v1.WebhookService

CreateWebhook

Creates a new webhook for receiving SCM events.

Use this method to:

  • Set up webhooks for repository or organization events
  • Configure webhook scopes and provider

Examples

  • Create repository webhook with multiple scopes:

    Creates a webhook scoped to specific repositories.

    name: "My Repo Webhook"
    type: WEBHOOK_TYPE_SCM_REPOSITORY
    scopes:
      - host: "github.com"
        owner: "gitpod-io"
        name: "gitpod"
      - host: "github.com"
        owner: "gitpod-io"
        name: "gitpod-next"
    provider: WEBHOOK_PROVIDER_GITHUB
    
  • Create organization webhook:

    Creates a webhook scoped to all repositories in an organization.

    name: "Org Webhook"
    type: WEBHOOK_TYPE_SCM_ORGANIZATION
    organizationScope:
      host: "github.com"
      name: "gitpod-io"
    provider: WEBHOOK_PROVIDER_GITHUB
    
post/gitpod.v1.WebhookService/CreateWebhook

Request body

descriptionstring

description is an optional description of the webhook's purpose

namestring

name is the display name of the webhook

provider'WEBHOOK_PROVIDER_UNSPECIFIED' | 'WEBHOOK_PROVIDER_GITHUB' | 'WEBHOOK_PROVIDER_GITLAB' | 'WEBHOOK_PROVIDER_BITBUCKET'

WebhookProvider identifies the Git provider.

scopestring

Deprecated: Use scopes instead. 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")
  • Empty string is allowed for webhooks that don't require scope filtering
type'WEBHOOK_TYPE_UNSPECIFIED' | 'WEBHOOK_TYPE_SCM_REPOSITORY' | 'WEBHOOK_TYPE_SCM_ORGANIZATION'

WebhookType determines the scope level of the webhook.

Response

Success

Changes

Changed in 5 of the 18 revisions of this API.111

  • 44d50c2ac28411See the full diff
    • added the new WEBHOOK_PROVIDER_BITBUCKET enum value to the webhook/spec/provider response property for the response status 200

      response-property-enum-value-added

    • added the new WEBHOOK_PROVIDER_BITBUCKET enum value to the request property provider

      request-property-enum-value-added

    This revision also has 24 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • removed the PRINCIPAL_AGENT_EXECUTION enum value from the webhook/metadata/creator/principal response property for the response status 200

      response-property-enum-value-removed

    • added the new optional request property organizationScope

      new-optional-request-property

    • added the new optional request property scopes

      new-optional-request-property

    • request property scope deprecated

      request-property-deprecated

    • added the optional property webhook/spec/organizationScope to the response with the 200 status

      response-optional-property-added

    • added the optional property webhook/spec/scopes to the response with the 200 status

      response-optional-property-added

    • response property webhook/spec/scope deprecated

      response-property-deprecated

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the scope request property's minLength was decreased from 1 to 0

      request-property-min-length-decreased

    • added the optional property webhook/lastTriggeredAt to the response with the 200 status

      response-optional-property-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added