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

# Account usage analytics

> Job counts for your organization, grouped by channel (`app` = platform UI, `api` = Public API). Actor Swap counts are completed/failed Insta Swap render jobs. Media Variations counts are seed analyze and variation propose jobs. Operational telemetry (tokens, Cloud Run) is not exposed here.



## OpenAPI

````yaml /openapi.yaml get /account/analytics
openapi: 3.1.0
info:
  title: YPH Public API
  version: 1.0.0
  description: |
    Programmatic access to Digital Samples, Actors, Insta Swaps, and webhooks.

    Authenticate with `Authorization: Bearer yph_sk_live_…`.
servers:
  - url: https://api.yourproducthere.ai/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: System
  - name: Account
  - name: Actors
  - name: Digital Samples
  - name: Insta Swaps
  - name: Webhooks
paths:
  /account/analytics:
    get:
      tags:
        - Account
      summary: Account usage analytics
      description: >-
        Job counts for your organization, grouped by channel (`app` = platform
        UI, `api` = Public API). Actor Swap counts are completed/failed Insta
        Swap render jobs. Media Variations counts are seed analyze and variation
        propose jobs. Operational telemetry (tokens, Cloud Run) is not exposed
        here.
      parameters:
        - name: period
          in: query
          required: false
          description: '`all` (default) for all-time, or `YYYY-MM` for a UTC calendar month.'
          schema:
            type: string
            example: 2026-07
      responses:
        '200':
          description: Aggregated org analytics
          content:
            application/json:
              schema:
                type: object
                properties:
                  orgId:
                    type: string
                  period:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - all
                          - month
                      month:
                        type: string
                        description: Present when type is month (YYYY-MM).
                  analytics:
                    type: object
                    description: Usage grouped by trigger channel.
                    properties:
                      api:
                        $ref: '#/components/schemas/SourceAnalyticsPublic'
                      app:
                        $ref: '#/components/schemas/SourceAnalyticsPublic'
        '400':
          description: Invalid period query
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    SourceAnalyticsPublic:
      type: object
      properties:
        actorSwap:
          $ref: '#/components/schemas/ActorSwapJobCounts'
        mediaVariations:
          $ref: '#/components/schemas/MediaVariationJobCounts'
    Error:
      type: object
      properties:
        code:
          type: string
          description: >-
            A machine-readable, uppercase error code (e.g.
            `REQUIRED_FIELD_MISSING`, `INVALID_PARAMETER`, `RESOURCE_NOT_FOUND`,
            `UNAUTHORIZED`, `CONFLICT`).
        error:
          type: string
          description: A human-readable error message explaining why the request failed.
        parameter:
          type: string
          nullable: true
          description: >-
            The name of the specific input parameter or body field that caused
            the error (e.g. `seedVideoUrl`, `title`, etc.).
        details:
          type: object
          nullable: true
          description: >-
            Additional key-value pairs providing context or structured details
            about the failure.
      example:
        code: REQUIRED_FIELD_MISSING
        error: title is required
        parameter: title
        details: null
    ActorSwapJobCounts:
      type: object
      properties:
        completedJobs:
          type: integer
          description: Completed Insta Swap (actor replacement) render jobs.
        failedJobs:
          type: integer
          description: Failed Insta Swap render jobs.
    MediaVariationJobCounts:
      type: object
      properties:
        analyzeJobs:
          type: integer
          description: Seed video analyze jobs (metadata extraction).
        proposeJobs:
          type: integer
          description: Variation propose jobs (initial batch or recommend-another).
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthorized:
              summary: Invalid API Key
              value:
                code: UNAUTHORIZED
                error: Unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your organization API key starting with yph_sk_live_…

````