# Webforms

## Overview

### Available Operations

* [list](#list) - Get All Webforms
* [create](#create) - Create Webform
* [update](#update) - Update Webform
* [remove](#remove) - Remove Webform
* [get\_by\_id](#get_by_id) - Get Webform By ID

## list

Returns all webforms of the given `owner_id` (teamId) in the request param. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `read` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.webforms.list(owner_id="<id>")

    while res is not None:
        # Handle items

        res = res.next()

```

### Parameters

| Parameter     | Type                                                                          | Required             | Description                                                         |
| ------------- | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `owner_id`    | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `page_number` | *Optional\[int]*                                                              | :heavy\_minus\_sign: | N/A                                                                 |
| `page_size`   | *Optional\[int]*                                                              | :heavy\_minus\_sign: | N/A                                                                 |
| `retries`     | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.WebformsGetAllWebformsResponse**](/python-sdk/docs/models/webformsgetallwebformsresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## create

Add a webform to the organization. Returns the webform object in response. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.webforms.create(owner_id="<id>", name="<value>", is_cname=False, is_captcha_enabled=False, captcha_secret={
        "site_key": "<value>",
        "secret": "<value>",
    }, form_owner_type="<value>", form_owner_id="<id>", services=[], header="<value>", title="<value>", footer_text="<value>", footer_link="<value>")

    # Handle response
    print(res)

```

### Parameters

| Parameter            | Type                                                                                                                                   | Required             | Description                                                         |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `owner_id`           | *str*                                                                                                                                  | :heavy\_check\_mark: | Unique identifier of the owner (string or UUID)                     |
| `name`               | *str*                                                                                                                                  | :heavy\_check\_mark: | Name of the webform                                                 |
| `is_cname`           | *bool*                                                                                                                                 | :heavy\_check\_mark: | Indicates if a custom domain (CNAME) is used                        |
| `is_captcha_enabled` | *bool*                                                                                                                                 | :heavy\_check\_mark: | Whether CAPTCHA is enabled on the form                              |
| `captcha_secret`     | [models.V3WebformsRecaptchaSecrets](/python-sdk/docs/models/v3webformsrecaptchasecrets.md)                                             | :heavy\_check\_mark: | CAPTCHA credentials to be validated                                 |
| `form_owner_type`    | *str*                                                                                                                                  | :heavy\_check\_mark: | Entity type that owns the form (e.g., team, user)                   |
| `form_owner_id`      | *str*                                                                                                                                  | :heavy\_check\_mark: | Identifier for the owner entity                                     |
| `services`           | List\[[models.V3WebformsWFService](/python-sdk/docs/models/v3webformswfservice.md)]                                                    | :heavy\_check\_mark: | List of services tied to this webform                               |
| `header`             | *str*                                                                                                                                  | :heavy\_check\_mark: | Header text shown on the form                                       |
| `title`              | *str*                                                                                                                                  | :heavy\_check\_mark: | Title of the webform                                                |
| `footer_text`        | *str*                                                                                                                                  | :heavy\_check\_mark: | Text displayed in the footer                                        |
| `footer_link`        | *str*                                                                                                                                  | :heavy\_check\_mark: | Hyperlink in the footer (mailto or https)                           |
| `host_name`          | *Optional\[str]*                                                                                                                       | :heavy\_minus\_sign: | Custom hostname if CNAME is enabled                                 |
| `tags`               | [Optional\[models.V3WebformsCreateOrUpdateWebformRequestTags\]](/python-sdk/docs/models/v3webformscreateorupdatewebformrequesttags.md) | :heavy\_minus\_sign: | Key-value tags for the webform                                      |
| `input_field`        | List\[[models.V3WebformsWFInputField](/python-sdk/docs/models/v3webformswfinputfield.md)]                                              | :heavy\_minus\_sign: | Input fields to be rendered on the form                             |
| `logo_url`           | *Optional\[str]*                                                                                                                       | :heavy\_minus\_sign: | URL to the organization's logo                                      |
| `email_on`           | List\[*str*]                                                                                                                           | :heavy\_minus\_sign: | Emails to notify on submission                                      |
| `description`        | *Optional\[str]*                                                                                                                       | :heavy\_minus\_sign: | Optional description for the webform                                |
| `retries`            | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md)                                                          | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.WebformsCreateWebformResponse**](/python-sdk/docs/models/webformscreatewebformresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## update

Update a webform to the organization. Returns the webform object in response. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.webforms.update(webform_id=926692, owner_id="<id>", name="<value>", is_cname=True, is_captcha_enabled=True, captcha_secret={
        "site_key": "<value>",
        "secret": "<value>",
    }, form_owner_type="<value>", form_owner_id="<id>", services=[
        {
            "service_id": "<id>",
            "name": "<value>",
            "alias": "<value>",
        },
    ], header="<value>", title="<value>", footer_text="<value>", footer_link="<value>")

    # Handle response
    print(res)

```

### Parameters

| Parameter            | Type                                                                                                                                   | Required             | Description                                                         |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `webform_id`         | *int*                                                                                                                                  | :heavy\_check\_mark: | N/A                                                                 |
| `owner_id`           | *str*                                                                                                                                  | :heavy\_check\_mark: | Unique identifier of the owner (string or UUID)                     |
| `name`               | *str*                                                                                                                                  | :heavy\_check\_mark: | Name of the webform                                                 |
| `is_cname`           | *bool*                                                                                                                                 | :heavy\_check\_mark: | Indicates if a custom domain (CNAME) is used                        |
| `is_captcha_enabled` | *bool*                                                                                                                                 | :heavy\_check\_mark: | Whether CAPTCHA is enabled on the form                              |
| `captcha_secret`     | [models.V3WebformsRecaptchaSecrets](/python-sdk/docs/models/v3webformsrecaptchasecrets.md)                                             | :heavy\_check\_mark: | CAPTCHA credentials to be validated                                 |
| `form_owner_type`    | *str*                                                                                                                                  | :heavy\_check\_mark: | Entity type that owns the form (e.g., team, user)                   |
| `form_owner_id`      | *str*                                                                                                                                  | :heavy\_check\_mark: | Identifier for the owner entity                                     |
| `services`           | List\[[models.V3WebformsWFService](/python-sdk/docs/models/v3webformswfservice.md)]                                                    | :heavy\_check\_mark: | List of services tied to this webform                               |
| `header`             | *str*                                                                                                                                  | :heavy\_check\_mark: | Header text shown on the form                                       |
| `title`              | *str*                                                                                                                                  | :heavy\_check\_mark: | Title of the webform                                                |
| `footer_text`        | *str*                                                                                                                                  | :heavy\_check\_mark: | Text displayed in the footer                                        |
| `footer_link`        | *str*                                                                                                                                  | :heavy\_check\_mark: | Hyperlink in the footer (mailto or https)                           |
| `host_name`          | *Optional\[str]*                                                                                                                       | :heavy\_minus\_sign: | Custom hostname if CNAME is enabled                                 |
| `tags`               | [Optional\[models.V3WebformsCreateOrUpdateWebformRequestTags\]](/python-sdk/docs/models/v3webformscreateorupdatewebformrequesttags.md) | :heavy\_minus\_sign: | Key-value tags for the webform                                      |
| `input_field`        | List\[[models.V3WebformsWFInputField](/python-sdk/docs/models/v3webformswfinputfield.md)]                                              | :heavy\_minus\_sign: | Input fields to be rendered on the form                             |
| `logo_url`           | *Optional\[str]*                                                                                                                       | :heavy\_minus\_sign: | URL to the organization's logo                                      |
| `email_on`           | List\[*str*]                                                                                                                           | :heavy\_minus\_sign: | Emails to notify on submission                                      |
| `description`        | *Optional\[str]*                                                                                                                       | :heavy\_minus\_sign: | Optional description for the webform                                |
| `retries`            | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md)                                                          | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.WebformsUpdateWebformResponse**](/python-sdk/docs/models/webformsupdatewebformresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## remove

Remove a webform from the organization. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `user-write` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.webforms.remove(webform_id=842504, owner_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter    | Type                                                                          | Required             | Description                                                         |
| ------------ | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `webform_id` | *int*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `owner_id`   | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `retries`    | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.WebformsRemoveWebformResponse**](/python-sdk/docs/models/webformsremovewebformresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |

## get\_by\_id

Returns a webform details of the given `webformId` in the request param. Requires `access_token` as a `Bearer {{token}}` in the `Authorization` header with `read` scope.

### Example Usage

```python
from squadcast import SquadcastSDK


with SquadcastSDK(
    refresh_token_auth="<YOUR_REFRESH_TOKEN_AUTH_HERE>",
) as squadcast_sdk:

    res = squadcast_sdk.webforms.get_by_id(webform_id=831002, owner_id="<id>")

    # Handle response
    print(res)

```

### Parameters

| Parameter    | Type                                                                          | Required             | Description                                                         |
| ------------ | ----------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
| `webform_id` | *int*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `owner_id`   | *str*                                                                         | :heavy\_check\_mark: | N/A                                                                 |
| `retries`    | [Optional\[utils.RetryConfig\]](/python-sdk/docs/models/utils/retryconfig.md) | :heavy\_minus\_sign: | Configuration to override the default retry behavior of the client. |

### Response

[**models.WebformsGetWebformByIDResponse**](/python-sdk/docs/models/webformsgetwebformbyidresponse.md)

### Errors

| Error Type                      | Status Code | Content Type     |
| ------------------------------- | ----------- | ---------------- |
| errors.BadRequestError          | 400         | application/json |
| errors.UnauthorizedError        | 401         | application/json |
| errors.PaymentRequiredError     | 402         | application/json |
| errors.ForbiddenError           | 403         | application/json |
| errors.NotFoundError            | 404         | application/json |
| errors.ConflictError            | 409         | application/json |
| errors.UnprocessableEntityError | 422         | application/json |
| errors.InternalServerError      | 500         | application/json |
| errors.BadGatewayError          | 502         | application/json |
| errors.ServiceUnavailableError  | 503         | application/json |
| errors.GatewayTimeoutError      | 504         | application/json |
| errors.SDKDefaultError          | 4XX, 5XX    | \*/\*            |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.incidents.cloud.solarwinds.com/python-sdk/docs/sdks/webformssdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
