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

# Get Subscription

> Get team's subscription details for both FREE and PRO tiers.

**Required Role:** VIEWER or higher

Returns comprehensive subscription information for any tier:
- FREE tier: Basic status with null subscription fields
- PRO tier: Full subscription details from local cache (updated via Polar webhooks)

Use this for displaying subscription status in settings/billing pages and dashboard widgets.



## OpenAPI

````yaml GET /v1/teams/{team_id}/subscription
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:
    get:
      tags:
        - Subscriptions
      summary: Get Subscription
      description: >-
        Get team's subscription details for both FREE and PRO tiers.


        **Required Role:** VIEWER or higher


        Returns comprehensive subscription information for any tier:

        - FREE tier: Basic status with null subscription fields

        - PRO tier: Full subscription details from local cache (updated via
        Polar webhooks)


        Use this for displaying subscription status in settings/billing pages
        and dashboard widgets.
      operationId: get_subscription_v1_teams__team_id__subscription_get
      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'
      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

````