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

# Upgrade

> Create a Polar checkout session for PRO tier upgrade.

**Required Role:** ADMIN or higher

Creates a unique checkout session URL on Polar for the team to upgrade
to PRO tier. The frontend should open this URL in a new tab/window.

Returns 409 Conflict if team already has an active subscription.

Note: The checkout URL is unique per request and can only be used once.



## OpenAPI

````yaml POST /v1/teams/{team_id}/billing/upgrade
openapi: 3.1.0
info:
  title: Data Raven API
  description: Cloud-to-cloud data transfer platform powered by RClone
  version: 0.5.0
servers: []
security: []
paths:
  /v1/teams/{team_id}/billing/upgrade:
    post:
      tags:
        - Subscriptions
      summary: Create Checkout Session
      description: |-
        Create a Polar checkout session for PRO tier upgrade.

        **Required Role:** ADMIN or higher

        Creates a unique checkout session URL on Polar for the team to upgrade
        to PRO tier. The frontend should open this URL in a new tab/window.

        Returns 409 Conflict if team already has an active subscription.

        Note: The checkout URL is unique per request and can only be used once.
      operationId: create_checkout_session_v1_teams__team_id__billing_upgrade_post
      parameters:
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Team Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSessionResponse'
        '404':
          description: Team not found
        '409':
          description: Team already has an active PRO subscription
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Checkout not configured or failed to retrieve owner email
        '502':
          description: Failed to create checkout session
      security:
        - HTTPBearer: []
components:
  schemas:
    CheckoutSessionResponse:
      properties:
        checkout_url:
          type: string
          title: Checkout Url
          description: URL to Polar checkout session
        team_id:
          type: string
          title: Team Id
          description: Team UUID being upgraded
      type: object
      required:
        - checkout_url
        - team_id
      title: CheckoutSessionResponse
      description: |-
        Response containing Polar checkout session URL.

        The frontend should open this URL in a new tab/window to redirect
        the user to Polar's checkout page for PRO tier upgrade.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````