openapi: 3.1.0
info:
  title: Credits Server API
  description: |
    ## Overview
    API for managing Decentraland user credits, tracking user progress through seasons, and handling authentication challenges.

    This service integrates with on-chain data through a Squid indexer to track credit consumption and manages
    credit expiration based on seasonal periods. Users can claim credits by completing goals during active seasons.

    **Authentication**

    The API uses two authentication methods:

    - **Signed Fetch**: For user-facing endpoints, requires @dcl/platform-crypto-middleware authentication (ADR-44l).
      Clients must provide auth chain headers (x-identity, x-signature, x-timestamp) for signature validation.

    - **Bearer Token**: For administrative endpoints, requires API_ADMIN_TOKEN or PROGRAMMATIC_API_ADMIN_TOKEN
      in the Authorization header.
  version: 1.0.0
  contact:
    name: Decentraland
    url: https://decentraland.org
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  x-api-id: credits-server-api
servers:
  - url: https://credits.decentraland.org
    description: Production environment
    variables: {}
  - url: https://credits.decentraland.zone
    description: Development environment
    variables: {}
security: []
tags:
  - name: Status
    description: Service health and status endpoints
  - name: Users
    description: User management and registration
  - name: Credits
    description: Credit management and retrieval
  - name: Progress
    description: User progress tracking and goals
  - name: Authentication
    description: Captcha challenges for spam prevention
  - name: Seasons
    description: Season information and status
  - name: Admin
    description: Administrative endpoints requiring bearer token authentication
paths:
  /status:
    get:
      tags:
        - Status
      summary: Get service health status
      description: Returns the health status of the service including database connectivity, message consumer status, and credit notification listener status
      operationId: getStatus
      security: []
      responses:
        '200':
          description: Service health status
          content:
            application/json:
              schema:
                type: object
                properties: &ref_4
                  status:
                    type: string
                    enum:
                      - ok
                      - error
                    description: Service health status
                  timestamp:
                    type: string
                    format: date-time
                    description: Status check timestamp
                  services:
                    type: object
                    properties:
                      database:
                        type: boolean
                        description: Database connectivity status
                      messageConsumer:
                        type: boolean
                        description: Message consumer status
                      creditNotificationListener:
                        type: boolean
                        description: Credit notification listener status
                required: &ref_5
                  - status
                  - timestamp
              example:
                status: ok
                timestamp: '2025-01-23T12:00:00.000Z'
                services:
                  database: true
                  messageConsumer: true
                  creditNotificationListener: true
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties: &ref_0
                  error:
                    type: string
                    description: Error message
                  code:
                    type: string
                    description: Error code (optional)
                required: &ref_1
                  - error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /users:
    post:
      tags:
        - Users
      summary: Register user
      description: |
        Registers a new user for the credits program. The user must be subscribed to notifications with a valid email.
        Requires signed fetch authentication with the user's wallet signature.
      operationId: registerUser
      security:
        - SignedFetch: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                  description: User's Ethereum address (extracted from signed fetch authentication)
              required: []
            example:
              address: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
      responses:
        '200':
          description: User registered successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    description: Registration success status
                required:
                  - ok
              example:
                ok: true
        '400':
          description: Bad request - User not subscribed to notifications or missing email
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '401':
          description: Unauthorized - invalid signed fetch
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '403':
          description: Forbidden - invalid metadata
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /users/{address}/credits:
    get:
      tags:
        - Credits
      summary: Get user credits
      description: |
        Returns all credits for a specific user with their current status. 
        Returns 401 if the user is flagged for multi-accounting or captcha violations.
      operationId: getCredits
      security: []
      parameters:
        - name: address
          in: path
          required: true
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
          description: User's Ethereum address
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - AVAILABLE
              - PARTIALLY_USED
          description: Filter credits by status. If not provided, returns AVAILABLE and PARTIALLY_USED credits
          example: AVAILABLE
      responses:
        '200':
          description: User credits retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties: &ref_6
                  credits:
                    type: array
                    items:
                      type: object
                      properties: &ref_8
                        id:
                          type: string
                          format: uuid
                          description: Credit ID (UUID)
                        amount:
                          type: number
                          description: Credit amount in MANA
                        status:
                          type: string
                          enum:
                            - AVAILABLE
                            - PARTIALLY_USED
                            - USED
                            - EXPIRED
                          description: Credit status
                        createdAt:
                          type: string
                          format: date-time
                          description: Creation timestamp
                        expiresAt:
                          type: string
                          format: date-time
                          description: Expiration timestamp (based on season end date)
                        signature:
                          type: string
                          description: Credit signature for on-chain verification
                        seasonId:
                          type: number
                          description: Associated season ID
                        goalId:
                          type: string
                          description: Goal ID that granted this credit
                      required: &ref_9
                        - id
                        - amount
                        - status
                    description: List of user credits
                  totalCredits:
                    type: number
                    description: Total available credits amount
                required: &ref_7
                  - credits
                  - totalCredits
        '400':
          description: Bad request - Invalid address format
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '401':
          description: User is flagged - The user has been flagged for multi-accounting or captcha violations
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: User 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb was flagged at 2025-01-23T12:00:00.000Z UTC
                  reason:
                    type: object
                    properties:
                      message:
                        type: string
                      ip:
                        type: string
                      linkedAddresses:
                        type: array
                        items:
                          type: string
                  isBlockedForClaiming:
                    type: boolean
                    example: true
        '404':
          description: User not found
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
    post:
      tags:
        - Admin
      summary: Grant credits to user (Admin)
      description: |
        Grants new credits to a user for completing a specific goal. 
        Requires bearer token authentication with API_ADMIN_TOKEN.
      operationId: grantCredits
      security:
        - BearerToken: []
      parameters:
        - name: address
          in: path
          required: true
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
          description: User's Ethereum address
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                goalId:
                  type: string
                  description: ID of the goal that was completed
              required:
                - goalId
            example:
              goalId: goal-123
      responses:
        '200':
          description: Credits granted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  signature:
                    type: string
                    description: Credit signature for on-chain verification
                  expiresAt:
                    type: number
                    description: Credit expiration timestamp
                  season:
                    type: object
                    properties:
                      name:
                        type: string
                      id:
                        type: number
                  seasonId:
                    type: number
                  creditId:
                    type: string
        '400':
          description: Bad request - Invalid address or missing goalId
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '401':
          description: Unauthorized - Invalid bearer token
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /users/{address}/credits/stream:
    get:
      tags:
        - Credits
      summary: Get credits stream (SSE)
      description: |
        Server-sent events endpoint for real-time credit balance updates. 
        Provides a persistent connection that streams credit updates as they occur.
      operationId: getCreditsStream
      security: []
      parameters:
        - name: address
          in: path
          required: true
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
          description: User's Ethereum address
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
      responses:
        '200':
          description: Server-sent events stream
          content:
            text/event-stream:
              schema:
                type: string
                description: SSE stream with credit updates in event stream format
              examples:
                creditUpdate:
                  summary: Credit update event
                  value: |
                    event: credit_update
                    data: {"credits": [...], "totalCredits": 100}
        '404':
          description: User not found
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /users/{address}/progress:
    get:
      tags:
        - Progress
      summary: Get user progress
      description: |
        Returns comprehensive progress information for a specific user including season status, 
        current week, goals progress, available credits, and enrollment status. 
        Requires signed fetch authentication.
      operationId: getUserProgress
      security:
        - SignedFetch: []
      parameters:
        - name: address
          in: path
          required: true
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
          description: User's Ethereum address
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
      responses:
        '200':
          description: User progress retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties: &ref_10
                  season:
                    type: object
                    properties:
                      timeLeft:
                        type: number
                        description: Time remaining in season (seconds)
                      startDate:
                        type: string
                        format: date-time
                      endDate:
                        type: string
                        format: date-time
                      seasonState:
                        type: string
                        enum:
                          - NOT_STARTED
                          - ACTIVE
                          - ENDED
                          - PAUSED
                    required:
                      - timeLeft
                      - startDate
                      - endDate
                      - seasonState
                  currentWeek:
                    type: object
                    properties:
                      timeLeft:
                        type: number
                        description: Time remaining in current week (seconds)
                    required:
                      - timeLeft
                  user:
                    type: object
                    properties:
                      hasStartedProgram:
                        type: boolean
                        description: Whether user has started the program
                    required:
                      - hasStartedProgram
                  credits:
                    type: object
                    properties:
                      available:
                        type: number
                        description: Available credits in MANA
                      expiresIn:
                        type: number
                        description: Time until credits expire (seconds)
                      isBlockedForClaiming:
                        type: boolean
                        description: Whether user is blocked from claiming credits
                    required:
                      - available
                      - expiresIn
                      - isBlockedForClaiming
                  goals:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        title:
                          type: string
                        description:
                          type: string
                        thumbnail:
                          type: string
                        progress:
                          type: object
                          properties:
                            totalSteps:
                              type: number
                            completedSteps:
                              type: number
                        reward:
                          type: number
                          description: Credit reward amount
                        isClaimed:
                          type: boolean
                required: &ref_11
                  - season
                  - currentWeek
                  - user
                  - credits
                  - goals
        '401':
          description: Unauthorized - invalid signed fetch
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '403':
          description: Forbidden - invalid metadata
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /captcha:
    get:
      tags:
        - Authentication
      summary: Get captcha challenge
      description: |
        Returns a new captcha challenge for spam prevention. 
        Users must solve the captcha before certain actions can be performed.
        Requires signed fetch authentication.
      operationId: getCaptcha
      security:
        - SignedFetch: []
      responses:
        '200':
          description: Captcha challenge generated successfully
          content:
            application/json:
              schema:
                type: object
                properties: &ref_12
                  challenge:
                    type: string
                    description: Captcha challenge identifier
                  imageUrl:
                    type: string
                    format: uri
                    description: Base64 encoded image URL for the captcha
                  expiresAt:
                    type: string
                    format: date-time
                    description: Challenge expiration timestamp
                required: &ref_13
                  - challenge
                  - imageUrl
                  - expiresAt
        '401':
          description: Unauthorized - invalid signed fetch
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '403':
          description: Forbidden - invalid metadata or user is flagged
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
    post:
      tags:
        - Authentication
      summary: Verify captcha
      description: |
        Verifies a captcha solution. Users who fail the captcha multiple times (3 attempts) 
        will be flagged for 24 hours. Requires signed fetch authentication.
      operationId: verifyCaptcha
      security:
        - SignedFetch: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: &ref_14
                challenge:
                  type: string
                  description: Captcha challenge identifier from GET /captcha
                solution:
                  type: number
                  description: User-provided X coordinate solution
              required: &ref_15
                - challenge
                - solution
      responses:
        '200':
          description: Captcha verified successfully
          content:
            application/json:
              schema:
                type: object
                properties: &ref_16
                  success:
                    type: boolean
                    description: Verification success status
                  message:
                    type: string
                    description: Verification message
                  creditsGranted:
                    type: boolean
                    description: Whether credits were granted after successful verification
                required: &ref_17
                  - success
        '400':
          description: Bad request - Invalid captcha solution
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '401':
          description: Unauthorized - invalid signed fetch
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '403':
          description: Forbidden - invalid metadata or user is flagged
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /season:
    get:
      tags:
        - Seasons
      summary: Get season status (DEPRECATED)
      description: |
        Returns current season status information. 
        **DEPRECATED**: Use `/seasons` endpoint instead.
      operationId: getSeasonStatus
      security: []
      deprecated: true
      responses:
        '200':
          description: Season status
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: number
                    description: Season ID
                  week:
                    type: number
                    description: Current week number
                  isPaused:
                    type: boolean
                    description: Whether the season is currently paused
                required:
                  - id
                  - week
                  - isPaused
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /seasons:
    get:
      tags:
        - Seasons
      summary: Get seasons information
      description: Returns information about past, current, and next seasons
      operationId: getSeasons
      security: []
      responses:
        '200':
          description: Seasons information retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties: &ref_18
                  past:
                    type: array
                    items:
                      type: object
                      properties: &ref_2
                        id:
                          type: number
                          description: Season ID
                        name:
                          type: string
                          description: Season name
                        description:
                          type: string
                          description: Season description
                        startDate:
                          type: string
                          format: date-time
                          description: Season start date
                        endDate:
                          type: string
                          format: date-time
                          description: Season end date
                        isActive:
                          type: boolean
                          description: Whether season is currently active
                        maxMana:
                          type: number
                          description: Maximum MANA available for the season
                      required: &ref_3
                        - id
                        - name
                        - isActive
                    description: Past seasons
                  current:
                    description: Current season (if active)
                    type: object
                    properties: *ref_2
                    required: *ref_3
                  next:
                    description: Next season (if scheduled)
                    type: object
                    properties: *ref_2
                    required: *ref_3
                required: &ref_19
                  - past
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /restart-program:
    post:
      tags:
        - Admin
      summary: Restart user program (Admin, Non-Production)
      description: |
        Restarts a user's progress in the current season. 
        Only available in non-production environments.
        Requires bearer token authentication with API_ADMIN_TOKEN.
      operationId: restartProgram
      security:
        - BearerToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                  description: User's Ethereum address
              required:
                - address
            example:
              address: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
      responses:
        '200':
          description: Program restarted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '401':
          description: Unauthorized - Invalid bearer token
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /test-email:
    post:
      tags:
        - Admin
      summary: Test email sending (Admin, Non-Production)
      description: |
        Sends a test email to verify email notification functionality.
        Only available in non-production environments.
        Requires bearer token authentication with API_ADMIN_TOKEN.
      operationId: testEmail
      security:
        - BearerToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                  description: User's Ethereum address to send test email to
              required:
                - address
      responses:
        '200':
          description: Test email sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
        '401':
          description: Unauthorized - Invalid bearer token
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /flag:
    post:
      tags:
        - Admin
      summary: Flag users for multi-accounting (Programmatic Admin)
      description: |
        Flags one or more users for multi-accounting detection or blacklisted addresses.
        This endpoint is designed for programmatic use by external systems.
        Requires bearer token authentication with PROGRAMMATIC_API_ADMIN_TOKEN.
      operationId: flagUsers
      security:
        - BearerToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ip:
                  type: string
                  description: IP address associated with the flagged users
                addressesLinked:
                  type: array
                  items:
                    type: string
                    pattern: ^0x[a-fA-F0-9]{40}$
                  description: List of Ethereum addresses linked to the same IP
                source:
                  type: string
                  enum:
                    - ip_multi_accounting
                    - web_anon_multi_accounting
                    - explorer_anon_multi_accounting
                    - web_anon_blacklisted_address
                    - explorer_anon_blacklisted_address
                  description: Source of the flagging detection
              required:
                - ip
                - addressesLinked
      responses:
        '200':
          description: Users flagged successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
        '400':
          description: Bad request - Invalid addresses or missing required fields
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '401':
          description: Unauthorized - Invalid bearer token
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /unflag:
    post:
      tags:
        - Admin
      summary: Unflag users (Admin)
      description: |
        Removes flags from users for captcha or multi-account violations.
        Requires bearer token authentication with API_ADMIN_TOKEN.
      operationId: unflagUsers
      security:
        - BearerToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                addresses:
                  type: array
                  items:
                    type: string
                    pattern: ^0x[a-fA-F0-9]{40}$
                  description: List of Ethereum addresses to unflag
                cacheType:
                  type: string
                  enum:
                    - captcha
                    - multi-account
                  description: Type of flag to remove
              required:
                - addresses
                - cacheType
            example:
              addresses:
                - '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
              cacheType: multi-account
      responses:
        '200':
          description: Users unflagged successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
        '400':
          description: Bad request - Invalid addresses
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '401':
          description: Unauthorized - Invalid bearer token
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /admin/flagged-wallets:
    get:
      tags:
        - Admin
      summary: Get flagged wallets (Admin)
      description: |
        Retrieves all flagged wallets with their flagging details including timestamps, 
        reasons, and associated IP addresses. Provides summary statistics.
        Requires bearer token authentication with API_ADMIN_TOKEN.
      operationId: getFlaggedWallets
      security:
        - BearerToken: []
      responses:
        '200':
          description: Flagged wallets retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties: &ref_20
                  flaggedWallets:
                    type: array
                    items:
                      type: object
                      properties:
                        address:
                          type: string
                          pattern: ^0x[a-fA-F0-9]{40}$
                          description: Flagged wallet address
                        flagType:
                          type: string
                          enum:
                            - captcha
                            - multi-account
                          description: Type of flag
                        flaggedAt:
                          type: string
                          format: date-time
                          description: When the wallet was flagged
                        reason:
                          type: object
                          properties:
                            message:
                              type: string
                            ip:
                              type: string
                            linkedAddresses:
                              type: array
                              items:
                                type: string
                        attempts:
                          type: number
                          description: Number of failed captcha attempts (for captcha flags)
                    description: List of flagged wallets
                  totalCount:
                    type: number
                    description: Total number of flagged wallets
                  metadata:
                    type: object
                    properties:
                      captchaFlags:
                        type: number
                        description: Number of captcha-related flags
                      multiAccountFlags:
                        type: number
                        description: Number of multi-accounting flags
                      retrievedAt:
                        type: string
                        format: date-time
                        description: When the data was retrieved
                    required:
                      - captchaFlags
                      - multiAccountFlags
                      - retrievedAt
                required: &ref_21
                  - flaggedWallets
                  - totalCount
                  - metadata
        '401':
          description: Unauthorized - Invalid bearer token
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
  /trigger-emails:
    post:
      tags:
        - Admin
      summary: Trigger reminder emails (Admin)
      description: |
        Manually triggers reminder email sending for users based on time window.
        Requires bearer token authentication with API_ADMIN_TOKEN.
      operationId: triggerEmails
      security:
        - BearerToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                day:
                  type: string
                  enum:
                    - thursday
                    - friday
                    - sunday
                  description: Optional day of week filter
                dateTime:
                  type: string
                  enum:
                    - morning
                    - midday
                    - evening
                  description: Time window for sending emails
              required:
                - dateTime
            example:
              day: friday
              dateTime: evening
      responses:
        '200':
          description: Emails triggered successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
        '400':
          description: Bad request - Invalid day or dateTime
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
        '401':
          description: Unauthorized - Invalid bearer token
          content:
            application/json:
              schema:
                type: object
                properties: *ref_0
                required: *ref_1
components:
  securitySchemes:
    SignedFetch:
      type: http
      scheme: bearer
      description: |
        Signed fetch authentication using @dcl/platform-crypto-middleware (ADR-44l). 
        Requires auth chain headers (x-identity, x-signature, x-timestamp) for signature validation. 
        See http://adr.decentraland.org/adr/ADR-44l for details.
    BearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        Bearer token authentication for administrative endpoints. 
        Use API_ADMIN_TOKEN for most admin endpoints or PROGRAMMATIC_API_ADMIN_TOKEN for /flag endpoint.
  schemas:
    StatusResponse:
      type: object
      properties: *ref_4
      required: *ref_5
    CreditsResponse:
      type: object
      properties: *ref_6
      required: *ref_7
    Credit:
      type: object
      properties: *ref_8
      required: *ref_9
    ProgressResponse:
      type: object
      properties: *ref_10
      required: *ref_11
    CaptchaResponse:
      type: object
      properties: *ref_12
      required: *ref_13
    VerifyCaptchaRequest:
      type: object
      properties: *ref_14
      required: *ref_15
    VerifyCaptchaResponse:
      type: object
      properties: *ref_16
      required: *ref_17
    SeasonsResponse:
      type: object
      properties: *ref_18
      required: *ref_19
    Season:
      type: object
      properties: *ref_2
      required: *ref_3
    FlaggedWalletsResponse:
      type: object
      properties: *ref_20
      required: *ref_21
    Error:
      type: object
      properties: *ref_0
      required: *ref_1
