Clients

October 16, 2025 ยท View on GitHub

(oauth2.clients)

Overview

Available Operations

create

Create an OAuth2 client.

Example Usage

from polar_sdk import Polar


with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.oauth2.clients.create(request={
        "redirect_uris": [
            "https://impolite-hippodrome.com/",
            "https://acidic-tomography.net/",
        ],
        "client_name": "<value>",
    })

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
requestmodels.OAuth2ClientConfiguration:heavy_check_mark:The request object to use for the request.
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

Any

Errors

Error TypeStatus CodeContent Type
models.HTTPValidationError422application/json
models.SDKError4XX, 5XX*/*

get

Get an OAuth2 client by Client ID.

Example Usage

from polar_sdk import Polar


with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.oauth2.clients.get(client_id="<id>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
client_idstr:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

Any

Errors

Error TypeStatus CodeContent Type
models.HTTPValidationError422application/json
models.SDKError4XX, 5XX*/*

update

Update an OAuth2 client.

Example Usage

from polar_sdk import Polar


with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.oauth2.clients.update(client_id="<id>", o_auth2_client_configuration_update={
        "redirect_uris": [
            "https://classic-cantaloupe.org",
            "https://corrupt-status.biz/",
        ],
        "client_name": "<value>",
        "client_id": "<id>",
    })

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
client_idstr:heavy_check_mark:N/A
o_auth2_client_configuration_updatemodels.OAuth2ClientConfigurationUpdate:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

Any

Errors

Error TypeStatus CodeContent Type
models.HTTPValidationError422application/json
models.SDKError4XX, 5XX*/*

delete

Delete an OAuth2 client.

Example Usage

from polar_sdk import Polar


with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.oauth2.clients.delete(client_id="<id>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
client_idstr:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

Any

Errors

Error TypeStatus CodeContent Type
models.HTTPValidationError422application/json
models.SDKError4XX, 5XX*/*