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

# Create Promo Code



## OpenAPI

````yaml /openapi.json post /promo-codes
openapi: 3.1.0
info:
  title: Slate API
  version: 1.0.0
  description: Trading infrastructure API.
servers:
  - url: https://api.{your-broker}.slate-labs.com
    variables:
      your-broker:
        default: broker
security: []
tags:
  - name: Authentication
  - name: API Tokens
  - name: Customers
  - name: Accounts
  - name: Orders
  - name: Instruments & Groups
  - name: Transactions
  - name: Payments
  - name: Transfers
  - name: Risk
  - name: Workflow & CRM
  - name: Messaging
  - name: Integrations
  - name: Webhooks
  - name: Compliance
  - name: Promo codes
  - name: Reporting
  - name: Audit
  - name: Fraud & moderation
  - name: Broker settings
  - name: Users
  - name: Roles & Teams
  - name: Streams (SSE)
  - name: Simulator
  - name: Observability
  - name: Prop trading
paths:
  /promo-codes:
    post:
      tags:
        - Promo codes
      summary: Create Promo Code
      operationId: create_promo_code_promo_codes_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromoCodeCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromoCodeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    PromoCodeCreate:
      properties:
        code:
          type: string
          maxLength: 50
          minLength: 1
          title: Code
        group_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Group Id
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        max_uses:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Uses
        account_type:
          type: string
          enum:
            - real
            - demo
            - prop
          title: Account Type
          default: real
        challenge_template_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Challenge Template Id
      type: object
      required:
        - code
      title: PromoCodeCreate
    PromoCodeResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        code:
          type: string
          title: Code
        group_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Group Id
        is_active:
          type: boolean
          title: Is Active
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        max_uses:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Uses
        current_uses:
          type: integer
          title: Current Uses
        account_type:
          type: string
          title: Account Type
        challenge_template_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Challenge Template Id
        created_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Created By
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - code
        - group_id
        - is_active
        - expires_at
        - max_uses
        - current_uses
        - account_type
        - challenge_template_id
        - created_by
        - created_at
        - updated_at
      title: PromoCodeResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````