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

# Get apiuserprofile

> Get the authenticated user's profile, including remaining credits, subscription plan, and billing period dates.

**Prerequisites:** Authenticated with a valid JWT.



## OpenAPI

````yaml /api-reference/openapi.json get /api/user/profile/
openapi: 3.0.3
info:
  title: SphereScout API
  version: 1.0.0
  description: >

    # SphereScout API


    SphereScout provides B2B lead data — business contacts with emails,

    phone numbers, and location metadata — across multiple countries.


    ## Authentication


    All endpoints (except `/api/auth/` and `/api/plans`) require a **JWT Bearer
    token**.


    1. **Register** — `POST /api/auth/sign-up/`

    2. **Login** — `POST /api/auth/login/` → returns `access` and `refresh`
    tokens

    3. **Attach header** — `Authorization: Bearer <access_token>`

    4. **Refresh** — `POST /api/token/refresh/` with `{ "refresh": "<token>" }`


    Access tokens expire after 60 minutes. Refresh tokens are long-lived.


    ## Credits


    Every account has a credit balance. Exporting leads costs **1 credit per
    lead**.

    Check your balance via `GET /api/user/profile/`. Credits reset each billing
    cycle

    for subscribed users.


    ## Async Download Workflow


    Exporting leads is asynchronous:


    1. **Search** — `GET /api/companies/` to preview results and get
    `totalCount`

    2. **Export** — `POST /api/download-csv/` to start generation (credits
    deducted immediately)

    3. **Poll** — `GET /api/download-status/{search_id}/` until `status =
    COMPLETED`

    4. **Download** — `GET /api/download-completed-csv/{search_id}/` to get a
    signed URL


    ## API Keys (recommended for integrations)


    Generate a persistent API key from your dashboard under **API Keys**.


    Attach it to every request:

    ```
      Authorization: Token <your-api-key>
    ```


    Keys can be given an expiry date and revoked at any time.

    JWT Bearer tokens (`Authorization: Bearer <jwt>`) continue to work for
    browser sessions and Swagger UI testing.


    ## Rate Limiting


    API requests are rate-limited. If you receive a `429` response, back off and
    retry.


    ## Versioning


    This is **v1** of the API. Breaking changes will be communicated in advance.
servers:
  - url: https://www.spherescout.io
security: []
tags:
  - name: Authentication
    description: Register, login, refresh tokens, and reset passwords.
  - name: Search
    description: Search and preview business leads by country, category, and location.
  - name: Download
    description: 'Export leads to CSV/Excel. Async workflow: initiate → poll → download.'
  - name: History
    description: View past searches and their download status.
  - name: Credits & Profile
    description: Check credit balance, subscription plan, and user profile.
  - name: Geography
    description: Countries, states/regions, counties, and cities for search filters.
  - name: API Keys
    description: Create, list, and revoke persistent API keys for integrations.
paths:
  /api/user/profile/:
    get:
      tags:
        - Credits & Profile
      description: >-
        Get the authenticated user's profile, including remaining credits,
        subscription plan, and billing period dates.


        **Prerequisites:** Authenticated with a valid JWT.
      operationId: user_profile_retrieve
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomUser'
          description: ''
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: cURL
          source: |-
            curl -X GET 'https://www.spherescout.io/api/user/profile/' \
              -H 'Authorization: Token YOUR_API_KEY' \
              -H 'User-Agent: SphereScout/1.0'
        - lang: Python
          source: |-
            import requests

            response = requests.get(
                "https://www.spherescout.io/api/user/profile/",
                headers={
                    "Authorization": "Token YOUR_API_KEY",
                    "User-Agent": "SphereScout/1.0",
                },
            )
            print(response.json())
        - lang: JavaScript
          source: >-
            const response = await
            fetch("https://www.spherescout.io/api/user/profile/", {
              headers: {
                "Authorization": "Token YOUR_API_KEY",
                "User-Agent": "SphereScout/1.0",
              },
            });

            const data = await response.json();
components:
  schemas:
    CustomUser:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        email:
          type: string
          format: email
          title: Email address
          maxLength: 254
        first_name:
          type: string
          maxLength: 150
        last_name:
          type: string
          maxLength: 150
        subscription_plan:
          allOf:
            - $ref: '#/components/schemas/SubscriptionPlan'
          readOnly: true
          description: Current subscription plan details, or null.
        total_credits:
          type: integer
          readOnly: true
          description: >-
            Total credits per billing cycle (from subscription plan). 0 if no
            plan.
        remaining_credits:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
          description: Subscription credits available right now.
        purchased_credits_available:
          type: integer
          readOnly: true
          description: Purchased credits currently available and not expired.
        purchased_credits_expiring_soon:
          type: integer
          readOnly: true
          description: Purchased credits expiring in the next 7 days.
        current_period_start:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
          description: Start of the current billing period (ISO 8601).
        current_period_end:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
          description: End of the current billing period (ISO 8601).
        can_download_fresh_exports:
          type: boolean
          readOnly: true
        preferred_language:
          allOf:
            - $ref: '#/components/schemas/CustomUserPreferredLanguageEnum'
          description: |-
            Two-letter UI language preference.

            * `bg` - Bulgarian
            * `cs` - Czech
            * `da` - Danish
            * `de` - German
            * `el` - Greek
            * `fr` - French
            * `en` - English
            * `es` - Spanish
            * `et` - Estonian
            * `fi` - Finnish
            * `he` - Hebrew
            * `hr` - Croatian
            * `hu` - Hungarian
            * `it` - Italian
            * `lt` - Lithuanian
            * `lv` - Latvian
            * `nb` - Norwegian
            * `nl` - Dutch
            * `pl` - Polish
            * `pt` - Portuguese
            * `ro` - Romanian
            * `sk` - Slovak
            * `sl` - Slovenian
            * `sr` - Serbian
            * `sv` - Swedish
            * `th` - Thai
            * `tr` - Turkish
      required:
        - can_download_fresh_exports
        - id
        - purchased_credits_available
        - purchased_credits_expiring_soon
        - subscription_plan
        - total_credits
    SubscriptionPlan:
      type: object
      properties:
        plan_type:
          type: string
          description: Plan tier name (e.g. 'starter', 'pro', 'enterprise').
          maxLength: 20
        monthly_credits:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          description: Number of credits allocated per billing cycle.
        price_per_month:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          description: Monthly price in USD.
        link_expiration_days:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          description: How many days download links remain valid.
        product_id:
          type: string
          maxLength: 100
        price_id:
          type: string
          maxLength: 100
        is_active:
          type: boolean
          description: Whether this plan is currently available for purchase.
        is_sellable:
          type: boolean
        allows_fresh_exports:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - link_expiration_days
        - monthly_credits
        - plan_type
        - price_id
        - price_per_month
        - product_id
        - updated_at
    CustomUserPreferredLanguageEnum:
      enum:
        - bg
        - cs
        - da
        - de
        - el
        - fr
        - en
        - es
        - et
        - fi
        - he
        - hr
        - hu
        - it
        - lt
        - lv
        - nb
        - nl
        - pl
        - pt
        - ro
        - sk
        - sl
        - sr
        - sv
        - th
        - tr
      type: string
      description: |-
        * `bg` - Bulgarian
        * `cs` - Czech
        * `da` - Danish
        * `de` - German
        * `el` - Greek
        * `fr` - French
        * `en` - English
        * `es` - Spanish
        * `et` - Estonian
        * `fi` - Finnish
        * `he` - Hebrew
        * `hr` - Croatian
        * `hu` - Hungarian
        * `it` - Italian
        * `lt` - Lithuanian
        * `lv` - Latvian
        * `nb` - Norwegian
        * `nl` - Dutch
        * `pl` - Polish
        * `pt` - Portuguese
        * `ro` - Romanian
        * `sk` - Slovak
        * `sl` - Slovenian
        * `sr` - Serbian
        * `sv` - Swedish
        * `th` - Thai
        * `tr` - Turkish
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key. Format: Token <your-api-key>'

````