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

# Create or update a class archetype

> Create or update a class archetype



## OpenAPI

````yaml POST /create-class-archetype
openapi: 3.1.0
info:
  title: Wanderer's Guide API
  description: >-
    Public HTTP API for Wanderer's Guide, the Pathfinder 2e character builder.
    Every endpoint is a Supabase Edge Function reached via `POST
    /functions/v1/<name>`. All responses follow the
    [JSend](https://github.com/omniti-labs/jsend) convention: `{ status:
    'success' | 'fail' | 'error', data?, message? }`.
  version: 1.0.0
  contact:
    name: Wanderer's Guide Discord
    url: https://discord.com/invite/FxsFZVvedr
  license:
    name: MIT
    url: https://github.com/wanderers-guide/wanderers-guide/blob/main/LICENSE
servers:
  - url: https://api.wanderersguide.app/functions/v1
    description: Production
  - url: '{supabaseUrl}/functions/v1'
    description: Self-hosted Supabase
    variables:
      supabaseUrl:
        default: http://127.0.0.1:54321
        description: Base URL of your Supabase instance, including scheme and port.
security:
  - apiKeyAuth: []
tags:
  - name: Content
    description: 'Pathfinder 2e content: spells, items, feats, ancestries, classes, etc.'
  - name: Characters
    description: Player characters.
  - name: Campaigns
    description: Campaigns and encounters.
  - name: GM
    description: 'Game-master tools: group management, access codes.'
  - name: Users
    description: Public user profiles, account management, Patreon integration.
  - name: Search
    description: Full-text and advanced search across content.
  - name: Files
    description: User-uploaded portrait and background images.
  - name: Integrations
    description: Vector DB and Discord webhooks.
paths:
  /create-class-archetype:
    post:
      tags:
        - Content
      summary: Create or update a class archetype
      operationId: createClassArchetype
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClassArchetype'
      responses:
        '200':
          description: JSend success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  data:
                    oneOf:
                      - $ref: '#/components/schemas/ClassArchetype'
                      - type: boolean
components:
  schemas:
    ClassArchetype:
      type: object
      required:
        - name
        - rarity
        - description
        - class_id
        - content_source_id
        - version
      properties:
        id:
          type: integer
        created_at:
          type: string
          format: date-time
        class_id:
          type: integer
        archetype_id:
          type: integer
        name:
          type: string
        rarity:
          $ref: '#/components/schemas/Rarity'
        description:
          type: string
        artwork_url:
          type: string
        operations:
          type: array
          items:
            $ref: '#/components/schemas/Operation'
        feature_adjustments:
          type: array
          items:
            type: object
            properties:
              fa_id:
                type: string
              type:
                type: string
                enum:
                  - ADD
                  - REPLACE
                  - REMOVE
              prev_id:
                type: integer
              data:
                $ref: '#/components/schemas/AbilityBlock'
        override_skill_training_base:
          type:
            - integer
            - 'null'
        override_class_operations:
          type: boolean
        content_source_id:
          type: integer
        deprecated:
          type: boolean
        version:
          type: string
    Rarity:
      type: string
      enum:
        - COMMON
        - UNCOMMON
        - RARE
        - UNIQUE
    Operation:
      description: >-
        An entry in the operations engine. See the Content Model guide. Shape
        varies by `type`; treated as opaque JSON by the API.
      type: object
      additionalProperties: true
    AbilityBlock:
      type: object
      required:
        - name
        - rarity
        - description
        - type
        - content_source_id
      properties:
        id:
          type: integer
        created_at:
          type: string
          format: date-time
        operations:
          type: array
          items:
            $ref: '#/components/schemas/Operation'
        name:
          type: string
        actions:
          $ref: '#/components/schemas/ActionCost'
        level:
          type: integer
        rarity:
          $ref: '#/components/schemas/Rarity'
        availability:
          $ref: '#/components/schemas/Availability'
        prerequisites:
          type: array
          items:
            type: string
        frequency:
          type: string
        cost:
          type: string
        trigger:
          type: string
        requirements:
          type: string
        access:
          type: string
        description:
          type: string
        special:
          type: string
        type:
          $ref: '#/components/schemas/AbilityBlockType'
        meta_data:
          type: object
          additionalProperties: true
        traits:
          type: array
          items:
            type: integer
        content_source_id:
          type: integer
        version:
          type: string
    ActionCost:
      type:
        - string
        - 'null'
      enum:
        - ONE-ACTION
        - TWO-ACTIONS
        - THREE-ACTIONS
        - REACTION
        - FREE-ACTION
        - ONE-TO-TWO-ACTIONS
        - ONE-TO-THREE-ACTIONS
        - TWO-TO-THREE-ACTIONS
        - null
    Availability:
      type: string
      enum:
        - STANDARD
        - LIMITED
        - RESTRICTED
    AbilityBlockType:
      type: string
      enum:
        - action
        - feat
        - physical-feature
        - sense
        - class-feature
        - heritage
        - mode
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key (UUID, 36 chars)
      description: >-
        API key created in your Wanderer's Guide account settings. Send as
        `Authorization: Bearer <key>`. Used for direct API access from external
        tools and scripts.

````