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

# Publish flex card

> Publishes a verified proof (flex) card from a completed backtest that passed the deploy gate. A failed gate returns `403 DEPLOY_GATE_FAILED`.



## OpenAPI

````yaml /openapi.json post /api/v2/social/flex-cards
openapi: 3.1.0
info:
  title: QuantDesk API
  version: 2.0.0
  description: >-
    Public HTTP API for the QuantDesk perpetual DEX gateway. Endpoints are
    grouped by market data, unified portfolio state, oracle pricing, social
    surfaces, backtesting, and reference data. Field-level truth for on-chain
    accounts lives in the SDK; this reference documents the REST gateway
    surface.


    Authenticated routes accept a Bearer JWT obtained from the wallet session
    flow described in the Authentication guide.
  contact:
    name: QuantDesk Support
    url: https://docs.quantdesk.app
    email: support@quantdesk.app
  license:
    name: MIT
servers:
  - url: https://api.quantdesk.app
    description: Production gateway
security: []
tags:
  - name: Markets
    description: Market registry, metadata, and crankless orderbook depth.
  - name: Oracle
    description: Price feeds sourced from the Pyth oracle network.
  - name: Portfolio
    description: Unified portfolio state aggregated from on-chain accounts.
  - name: Data
    description: Authoritative market statistics and historical OHLCV candles.
  - name: Social
    description: Leaderboard and verified proof (flex) cards.
  - name: Backtesting
    description: Strategy simulation lifecycle and dataset catalog.
  - name: Referrals
    description: Referral validation before on-chain assignment.
paths:
  /api/v2/social/flex-cards:
    post:
      tags:
        - Social
      summary: Publish flex card
      description: >-
        Publishes a verified proof (flex) card from a completed backtest that
        passed the deploy gate. A failed gate returns `403 DEPLOY_GATE_FAILED`.
      operationId: publishFlexCard
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - run_id
                - title
              properties:
                run_id:
                  type: string
                  description: Completed backtest run that passed the deploy gate.
                  example: b4f1c2a0-6d3e-4f7a-9c1b-0a2d3e4f5a6b
                title:
                  type: string
                  description: Display title (max 120 characters).
                  maxLength: 120
                  example: BTC MR — verified
                description:
                  type: string
                  description: Optional blurb.
                  example: Mean-reversion strategy, 90-day backtest.
      responses:
        '201':
          description: Flex card created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/FlexCard'
        '401':
          description: Missing or expired auth
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Deploy gate not passed (`DEPLOY_GATE_FAILED`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    FlexCard:
      type: object
      properties:
        flex_card_id:
          type: string
          example: fc_9x2k1
        run_id:
          type: string
          example: b4f1c2a0-6d3e-4f7a-9c1b-0a2d3e4f5a6b
        title:
          type: string
          example: BTC MR — verified
        description:
          type: string
          example: Mean-reversion strategy, 90-day backtest.
        badges:
          type: array
          items:
            type: string
          example:
            - gate-verified
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: PORTFOLIO_NOT_FOUND
        code:
          type: string
          example: PORTFOLIO_NOT_FOUND
        message:
          type: string
          example: Wallet has not initialized a V2 portfolio yet.
        timestamp:
          type: string
          format: date-time
        request_id:
          type: string
          example: req_8f2a1c
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer JWT obtained from the wallet session flow. See the Authentication
        guide.

````