## Create

`teams.webhook_endpoints.create(strteam_id, WebhookEndpointCreateParams**kwargs)  -> WebhookEndpointCreateResponse`

**post** `/teams/{teamId}/webhook-endpoints`

Register a new webhook endpoint for the team, at most 10 of them. The response carries the secret, which is never returned again

### Parameters

- `team_id: str`

- `enabled_events: List[Literal["*", "asset.download.completed", "asset.download.created", 16 more]]`

  The events that trigger the webhook. ['*'] indicates that all events are enabled

  - `"*"`

  - `"asset.download.completed"`

  - `"asset.download.created"`

  - `"asset.download.failed"`

  - `"generation.completed"`

  - `"generation.created"`

  - `"generation.failed"`

  - `"inference.cancelled"`

  - `"inference.completed"`

  - `"inference.created"`

  - `"inference.failed"`

  - `"model.download.completed"`

  - `"model.download.created"`

  - `"model.download.failed"`

  - `"model.training.cancelled"`

  - `"model.training.completed"`

  - `"model.training.failed"`

  - `"model.training.started"`

  - `"team.credit.threshold.crossed"`

- `url: str`

  The URL of the webhook endpoint. Must be an absolute http(s) URL

- `description: Optional[str]`

  A description of the webhook endpoint

### Returns

- `class WebhookEndpointCreateResponse: …`

  - `webhook_endpoint: WebhookEndpoint`

    The creation response, and the only one that carries the secret: it is
    generated once and never returned again, so a client that loses it has to
    recreate the endpoint.

    - `id: str`

      The ID of the webhook endpoint

    - `created_at: str`

      The date and time the webhook endpoint was created

    - `enabled: bool`

      Whether the webhook is enabled

    - `enabled_events: List[Literal["*", "asset.download.completed", "asset.download.created", 16 more]]`

      The events that trigger the webhook. ['*'] indicates that all events are enabled

      - `"*"`

      - `"asset.download.completed"`

      - `"asset.download.created"`

      - `"asset.download.failed"`

      - `"generation.completed"`

      - `"generation.created"`

      - `"generation.failed"`

      - `"inference.cancelled"`

      - `"inference.completed"`

      - `"inference.created"`

      - `"inference.failed"`

      - `"model.download.completed"`

      - `"model.download.created"`

      - `"model.download.failed"`

      - `"model.training.cancelled"`

      - `"model.training.completed"`

      - `"model.training.failed"`

      - `"model.training.started"`

      - `"team.credit.threshold.crossed"`

    - `nb_failed_calls: float`

      The number of calls to the webhook endpoint that have failed

    - `nb_total_calls: float`

      The number of calls to the webhook endpoint

    - `owner_id: str`

      The ID of the owner of the webhook endpoint: a project id for job
      lifecycle events, a team id for alert events

    - `owner_type: Literal["project", "team"]`

      Whether the owner is a project or a team. Required to tell them apart: a
      project created before the team/project split shares its team's id

      - `"project"`

      - `"team"`

    - `secret: str`

      The endpoint's secret, used to generate webhook signatures

    - `updated_at: str`

      The date and time the webhook endpoint was updated

    - `url: str`

      The URL of the webhook endpoint

    - `description: Optional[str]`

      A description of the webhook endpoint

### Example

```python
import os
from scenario_sdk import Scenario

client = Scenario(
    api_key=os.environ.get("SCENARIO_SDK_API_KEY"),  # This is the default and can be omitted
    api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"),  # This is the default and can be omitted
)
webhook_endpoint = client.teams.webhook_endpoints.create(
    team_id="teamId",
    enabled_events=["*"],
    url="url",
)
print(webhook_endpoint.webhook_endpoint)
```

#### Response

```json
{
  "webhookEndpoint": {
    "id": "id",
    "createdAt": "createdAt",
    "enabled": true,
    "enabledEvents": [
      "*"
    ],
    "nbFailedCalls": 0,
    "nbTotalCalls": 0,
    "ownerId": "ownerId",
    "ownerType": "project",
    "secret": "secret",
    "updatedAt": "updatedAt",
    "url": "url",
    "description": "description"
  }
}
```
