> ## 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.

# Verify Subscription

> Verify and sync subscription status from Polar API.

**Required Role:** VIEWER or higher

This endpoint fetches the current customer state directly from Polar's API
and syncs it to the local database. Use this after checkout to ensure the
subscription status is up-to-date (in case webhooks are delayed).

Returns the fresh subscription status after syncing.



## OpenAPI

````yaml POST /v1/teams/{team_id}/subscription/verify
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}/subscription/verify:
    post:
      tags:
        - Subscriptions
      summary: Verify Subscription
      description: >-
        Verify and sync subscription status from Polar API.


        **Required Role:** VIEWER or higher


        This endpoint fetches the current customer state directly from Polar's
        API

        and syncs it to the local database. Use this after checkout to ensure
        the

        subscription status is up-to-date (in case webhooks are delayed).


        Returns the fresh subscription status after syncing.
      operationId: verify_subscription_v1_teams__team_id__subscription_verify_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/SubscriptionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '502':
          description: Failed to fetch subscription state from Polar
      security:
        - HTTPBearer: []
components:
  schemas:
    SubscriptionResponse:
      properties:
        has_subscription:
          type: boolean
          title: Has Subscription
          description: True if team has a subscription record
        subscription_tier:
          type: string
          title: Subscription Tier
          description: Subscription tier (free or pro)
        is_active:
          type: boolean
          title: Is Active
          description: True if PRO tier is currently active
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Subscription UUID
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
          description: Team UUID
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Polar subscription status (active, canceled, unpaid, etc.)
        current_period_start:
          anyOf:
            - type: string
            - type: 'null'
          title: Current Period Start
          description: Billing period start (ISO format)
        current_period_end:
          anyOf:
            - type: string
            - type: 'null'
          title: Current Period End
          description: Billing period end (ISO format)
        cancel_at_period_end:
          type: boolean
          title: Cancel At Period End
          description: If true, subscription will end at current_period_end
          default: false
        canceled_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Canceled At
          description: Cancellation timestamp (ISO format)
        amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Amount
          description: Subscription amount in dollars (e.g., 20.00)
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
          description: Currency code (usd)
        polar_sub_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Polar Sub Id
          description: Polar subscription ID
        polar_cust_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Polar Cust Id
          description: Polar customer ID
      type: object
      required:
        - has_subscription
        - subscription_tier
        - is_active
      title: SubscriptionResponse
      description: |-
        Unified subscription response for both FREE and PRO tiers.

        This schema handles both FREE tier teams (no subscription record) and
        PRO tier teams (with full subscription details).

        For FREE tier:
        - has_subscription: False
        - subscription_tier: "free"
        - All subscription-specific fields will be None

        For PRO tier:
        - has_subscription: True
        - subscription_tier: "pro"
        - All subscription fields populated
    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

````