Skip to content

hooks

Accessed as client.orgs.hooks; the async client mirrors it.

OrgsHooks

The orgs.hooks namespace.

create

create(
    org: str,
    *,
    active: bool | None = None,
    authorization_header: str | None = None,
    branch_filter: str | None = None,
    config: CreateHookOptionConfig,
    events: list[str] | None = None,
    type: CreateHookOptionType,
) -> Hook

Create a hook.

Parameters:

Name Type Description Default
org str

name of the organization

required
active bool | None
None
authorization_header str | None
None
branch_filter str | None
None
config CreateHookOptionConfig
required
events list[str] | None
None
type CreateHookOptionType
required

Returns:

Type Description
Hook

Hook.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: orgCreateHook

delete

delete(org: str, id: int) -> None

Delete a hook.

Parameters:

Name Type Description Default
org str

name of the organization

required
id int

id of the hook to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: orgDeleteHook

get

get(org: str, id: int) -> Hook

Get a hook.

Parameters:

Name Type Description Default
org str

name of the organization

required
id int

id of the hook to get

required

Returns:

Type Description
Hook

Hook.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: orgGetHook

list

list(org: str, *, page: int | None = None, limit: int | None = None) -> Paginated[Hook]

List an organization's webhooks.

Parameters:

Name Type Description Default
org str

name of the organization

required
page int | None

1-based page to start iteration at.

None
limit int | None

Page size; the instance caps it server-side.

None

Returns:

Type Description
Paginated[Hook]

HookListWithoutPagination - Hooks without pagination headers.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: orgListHooks

update

update(
    org: str,
    id: int,
    *,
    active: bool | None = None,
    authorization_header: str | None = None,
    branch_filter: str | None = None,
    config: dict[str, str] | None = None,
    events: list[str] | None = None,
) -> Hook

Update a hook.

Parameters:

Name Type Description Default
org str

name of the organization

required
id int

id of the hook to update

required
active bool | None
None
authorization_header str | None
None
branch_filter str | None
None
config dict[str, str] | None
None
events list[str] | None
None

Returns:

Type Description
Hook

Hook.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: orgEditHook

AsyncOrgsHooks

The orgs.hooks namespace.

create

create(
    org: str,
    *,
    active: bool | None = None,
    authorization_header: str | None = None,
    branch_filter: str | None = None,
    config: CreateHookOptionConfig,
    events: list[str] | None = None,
    type: CreateHookOptionType,
) -> Hook

Create a hook.

Parameters:

Name Type Description Default
org str

name of the organization

required
active bool | None
None
authorization_header str | None
None
branch_filter str | None
None
config CreateHookOptionConfig
required
events list[str] | None
None
type CreateHookOptionType
required

Returns:

Type Description
Hook

Hook.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: orgCreateHook

delete

delete(org: str, id: int) -> None

Delete a hook.

Parameters:

Name Type Description Default
org str

name of the organization

required
id int

id of the hook to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: orgDeleteHook

get

get(org: str, id: int) -> Hook

Get a hook.

Parameters:

Name Type Description Default
org str

name of the organization

required
id int

id of the hook to get

required

Returns:

Type Description
Hook

Hook.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: orgGetHook

list

list(org: str, *, page: int | None = None, limit: int | None = None) -> AsyncPaginated[Hook]

List an organization's webhooks.

Parameters:

Name Type Description Default
org str

name of the organization

required
page int | None

1-based page to start iteration at.

None
limit int | None

Page size; the instance caps it server-side.

None

Returns:

Type Description
AsyncPaginated[Hook]

HookListWithoutPagination - Hooks without pagination headers.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: orgListHooks

update

update(
    org: str,
    id: int,
    *,
    active: bool | None = None,
    authorization_header: str | None = None,
    branch_filter: str | None = None,
    config: dict[str, str] | None = None,
    events: list[str] | None = None,
) -> Hook

Update a hook.

Parameters:

Name Type Description Default
org str

name of the organization

required
id int

id of the hook to update

required
active bool | None
None
authorization_header str | None
None
branch_filter str | None
None
config dict[str, str] | None
None
events list[str] | None
None

Returns:

Type Description
Hook

Hook.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.

Operation ID: orgEditHook