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

# Create campaign

> Creates a new fundraiser campaign. Requires Supabase authentication.



## OpenAPI

````yaml POST /api/campaigns
openapi: 3.1.0
info:
  title: x402 Singularity Layer API
  description: >-
    OpenAPI-backed reference for marketplace discovery, payment routes,
    webhooks, wallet-first auth, agent endpoints, and ERC-8004 flows.
  version: 1.0.0
servers:
  - url: https://api.x402layer.cc
security: []
tags:
  - name: Marketplace
    description: Public discovery and listing lookup
  - name: Public Endpoints
    description: Public endpoint metadata and hosted checkout context
  - name: Public Payment Links
    description: Hosted public payment-link lookup
  - name: Payments
    description: Hosted x402 payment challenge routes
  - name: Receipts
    description: Signed receipt lookup and verification helpers
  - name: Ratings
    description: Public listing ratings and authenticated rating actions
  - name: Webhooks
    description: Seller webhook management API
  - name: Agent Auth
    description: Wallet-first challenge and verification routes
  - name: Agent Endpoints
    description: Create, read, top up, and delete agent endpoints
  - name: ERC-8004
    description: Agent registry and registration lifecycle routes
  - name: Marketplace Agents
    description: Public ERC-8004 marketplace discovery routes
  - name: Compute Catalog
    description: Compute plans, regions, and OS catalog
  - name: Compute Instances
    description: Provision, inspect, extend, and destroy compute instances
  - name: Compute API Keys
    description: API keys for compute agent access
  - name: Fundraiser Campaigns
    description: List, view, create, and edit fundraiser campaigns
  - name: Fundraiser Contributions
    description: Record and list campaign contributions
  - name: Fundraiser Comments
    description: Campaign comment threads
  - name: Fundraiser Media
    description: Campaign image uploads and OG images
  - name: Enterprise
    description: >-
      Enterprise partner configuration, endpoint listing, revenue stats, and
      transaction ledger
  - name: Staking
    description: Agentic $SGL staking
  - name: SGL Grid
    description: >-
      Decentralized, confidential, OpenAI-compatible inference served by
      attested TEE nodes.
  - name: Compute Credits
    description: Prepaid USDC credit balance shared across Machines and Grid.
paths:
  /api/campaigns:
    servers:
      - url: https://studio.x402layer.cc
    post:
      tags:
        - Fundraiser Campaigns
      summary: Create campaign
      description: Creates a new fundraiser campaign. Requires Supabase authentication.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCampaignRequest'
      responses:
        '200':
          description: Campaign created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  campaign:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      slug:
                        type: string
                      title:
                        type: string
                      url:
                        type: string
                        format: uri
                      endpoint_slug:
                        type: string
        '400':
          description: Validation error
        '401':
          description: Not authenticated
      security:
        - supabaseAuth: []
components:
  schemas:
    CreateCampaignRequest:
      type: object
      required:
        - title
        - wallet_address
        - target_amount
      properties:
        title:
          type: string
          minLength: 3
        description:
          type: string
        wallet_address:
          type: string
          description: Creator's Solana wallet for payouts
        target_amount:
          type: number
          minimum: 1000
          description: Funding target in USDC
        token_ticker:
          type: string
          pattern: ^[A-Z0-9]{2,10}$
          description: 2–10 uppercase alphanumeric characters
        fee_option:
          type: string
          enum:
            - supporters
            - creator
            - split
          default: supporters
        fee_split_pct:
          type: number
          minimum: 0
          maximum: 100
          description: Creator's percentage when using split
        images:
          type: array
          items:
            type: string
            format: uri
          maxItems: 5
          description: First image = token logo
        x_handle:
          type: string
          description: X/Twitter handle without @
        deadline:
          type: string
          format: date-time
        category:
          type: string
          enum:
            - medical
            - emergency
            - education
            - community
            - creative
            - tech
            - business
            - personal
            - other
        bags_config_type:
          type: string
          format: uuid
          description: Fee tier UUID
  securitySchemes:
    supabaseAuth:
      type: http
      scheme: bearer
      description: Supabase session JWT

````