> ## Documentation Index
> Fetch the complete documentation index at: https://polar.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Client

> Update an OAuth2 client.



## OpenAPI

````yaml /openapi/2027-01.openapi.json put /v1/oauth2/register/{client_id}
openapi: 3.1.0
info:
  title: Polar API
  summary: Polar HTTP and Webhooks API
  description: >-
    Read the docs at https://polar.sh/docs/api-reference. See
    https://polar.sh/docs/api-reference/versioning for the API versioning and
    deprecation policy.
  version: 2027-01
servers:
  - url: https://api.polar.sh
    description: Production environment
    x-speakeasy-server-id: production
    x-polar-environment: production
  - url: https://sandbox-api.polar.sh
    description: Sandbox environment
    x-speakeasy-server-id: sandbox
    x-polar-environment: sandbox
security: []
tags:
  - name: public
    description: >-
      Endpoints shown and documented in the Polar API documentation and
      available in our SDKs.
  - name: private
    description: >-
      Endpoints that should appear in the schema only in development to generate
      our internal JS SDK.
  - name: mcp
    description: Endpoints supported by Polar's MCP server.
  - name: cli
    description: Endpoints exposed as commands by Polar's CLI.
externalDocs:
  description: API versioning and deprecation policy
  url: https://polar.sh/docs/api-reference/versioning
paths:
  /v1/oauth2/register/{client_id}:
    put:
      tags:
        - oauth2
        - clients
        - public
      summary: Update Client
      description: Update an OAuth2 client.
      operationId: oauth2:clients:oauth2:update_client
      parameters:
        - name: client_id
          in: path
          required: true
          schema:
            type: string
            title: Client Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAuth2ClientConfigurationUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - oidc: []
        - pat: []
      x-codeSamples:
        - lang: python
          source: |
            from polar.v2027_01 import Polar

            polar = Polar("polar_oat_xxx")

            response = polar.oauth2.clients.oauth2.update_client(
                'string',
                redirect_uris=['https://example.com'],
                token_endpoint_auth_method='client_secret_post',
                grant_types=['authorization_code', 'refresh_token'],
                response_types=['code'],
                scope=('openid profile email user:read user:write organizations:read '
                 'organizations:write custom_fields:read custom_fields:write '
                 'discounts:read discounts:write checkout_links:read '
                 'checkout_links:write checkouts:read checkouts:write '
                 'transactions:read transactions:write payouts:read payouts:write '
                 'products:read products:write benefits:read benefits:write '
                 'events:read events:write meters:read meters:write files:read '
                 'files:write subscriptions:read subscriptions:write customers:read '
                 'customers:write members:read members:write wallets:read '
                 'wallets:write disputes:read disputes:write customer_meters:read '
                 'customer_sessions:write member_sessions:write customer_seats:read '
                 'customer_seats:write orders:read orders:write refunds:read '
                 'refunds:write payments:read metrics:read metrics:write webhooks:read '
                 'webhooks:write license_keys:read license_keys:write '
                 'customer_portal:read customer_portal:write notifications:read '
                 'notifications:write notification_recipients:read '
                 'notification_recipients:write'),
                client_name='string',
                client_id='string',
            )
            print(response)
        - lang: typescript
          source: |
            import { createPolar } from "@polar-sh/sdk/2027-01";

            const polar = createPolar({
              accessToken: "polar_oat_xxx",
            });

            const response = await polar.oauth2.clients.oauth2.updateClient(
              "string",
              {
                "redirect_uris": [
                  "https://example.com"
                ],
                "token_endpoint_auth_method": "client_secret_post",
                "grant_types": [
                  "authorization_code",
                  "refresh_token"
                ],
                "response_types": [
                  "code"
                ],
                "scope": "openid profile email user:read user:write organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write transactions:read transactions:write payouts:read payouts:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write members:read members:write wallets:read wallets:write disputes:read disputes:write customer_meters:read customer_sessions:write member_sessions:write customer_seats:read customer_seats:write orders:read orders:write refunds:read refunds:write payments:read metrics:read metrics:write webhooks:read webhooks:write license_keys:read license_keys:write customer_portal:read customer_portal:write notifications:read notifications:write notification_recipients:read notification_recipients:write",
                "client_name": "string",
                "client_id": "string"
              },
            );
            console.log(response);
components:
  schemas:
    OAuth2ClientConfigurationUpdate:
      properties:
        redirect_uris:
          items:
            type: string
            minLength: 1
            format: uri
          type: array
          title: Redirect Uris
        token_endpoint_auth_method:
          type: string
          enum:
            - client_secret_basic
            - client_secret_post
            - none
          title: Token Endpoint Auth Method
          default: client_secret_post
        grant_types:
          items:
            type: string
            enum:
              - authorization_code
              - refresh_token
          type: array
          title: Grant Types
          default:
            - authorization_code
            - refresh_token
        response_types:
          items:
            type: string
            const: code
          type: array
          title: Response Types
          default:
            - code
        scope:
          type: string
          title: Scope
          default: >-
            openid profile email user:read user:write organizations:read
            organizations:write custom_fields:read custom_fields:write
            discounts:read discounts:write checkout_links:read
            checkout_links:write checkouts:read checkouts:write
            transactions:read transactions:write payouts:read payouts:write
            products:read products:write benefits:read benefits:write
            events:read events:write meters:read meters:write files:read
            files:write subscriptions:read subscriptions:write customers:read
            customers:write members:read members:write wallets:read
            wallets:write disputes:read disputes:write customer_meters:read
            customer_sessions:write member_sessions:write customer_seats:read
            customer_seats:write orders:read orders:write refunds:read
            refunds:write payments:read metrics:read metrics:write webhooks:read
            webhooks:write license_keys:read license_keys:write
            customer_portal:read customer_portal:write notifications:read
            notifications:write notification_recipients:read
            notification_recipients:write
        client_name:
          type: string
          title: Client Name
        client_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Uri
        logo_uri:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Logo Uri
        tos_uri:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Tos Uri
        policy_uri:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Policy Uri
        default_sub_type:
          $ref: '#/components/schemas/SubType'
          default: user
        client_id:
          type: string
          title: Client Id
      type: object
      required:
        - redirect_uris
        - client_name
        - client_id
      title: OAuth2ClientConfigurationUpdate
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SubType:
      type: string
      enum:
        - user
        - organization
      title: SubType
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    oidc:
      type: openIdConnect
      openIdConnectUrl: /.well-known/openid-configuration
    pat:
      type: http
      description: >-
        You can generate a **Personal Access Token** from your
        [settings](https://polar.sh/settings).
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.