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

# Create a WOD



## OpenAPI

````yaml post /api/public/wods
openapi: 3.0.0
info:
  title: WodUp Public API
  version: '0.1'
servers:
  - description: Development / testing server
    url: https://api.wodup.dev
    variables: {}
security:
  - authorization: []
tags: []
paths:
  /api/public/wods:
    post:
      tags:
        - wods
      summary: Create a WOD
      operationId: WodUpWeb.PublicApi.WodController.create
      parameters:
        - description: |
            **Only used by platform integrations**  
            ID of gym to execute on behalf of
          example: gym_123abc
          in: header
          name: wodup-gym
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWodRequest'
        description: WOD params
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WodResponse'
          description: Create WOD response
      callbacks: {}
components:
  schemas:
    CreateWodRequest:
      description: POST body for creating a wod
      example:
        components:
          - is_alternating: false
            level: Rx
            notes: Aim for an 80% effort today.
            notes_for_coaches: Try to complete this section in 10 minutes.
            order: 0
            partners: 0
            post_instructions: null
            pre_instructions: Make sure to warm up your hips first.
            prefix: A
            results_count: 0
            workout:
              details:
                movements:
                  - id: mv_fT0m3viH
                    load: null
                    reps: '5'
                rest:
                  type: as_needed
                type: Strength
              type: Strength
        name: Morning Workout
        occurs_on: '2020-01-01'
        order: 0
        program_id: p_123abc
        publish_at: '2020-01-01T00:00:00Z'
      properties:
        athlete_id:
          description: ID of athlete to program WOD for
          type: string
        components:
          description: Components in this WOD
          items:
            properties:
              is_alternating:
                description: Whether this component alternates with the next one
                type: boolean
              level:
                description: >-
                  The level this component belongs to, for gyms using the Levels
                  feature. Set this to group the component under one of the
                  parent program's configured levels (e.g. 'Rx', 'Scaled').
                  Leave unset for programs that don't use levels.
                type: string
              name:
                description: Component name
                type: string
              notes:
                description: Component notes
                type: string
              notes_for_coaches:
                description: Component notes for coaches
                type: string
              order:
                default: 0
                description: Component order
                type: integer
              partners:
                description: Number of partners.
                minimum: 0
                type: integer
              post_instructions:
                description: Instructions immediately proceeding the workout
                type: string
              pre_instructions:
                description: Instructions immediately preceeding the workout
                type: string
              prefix:
                description: Prefix for this workout, e.g. 'B1'.
                type: string
              workout:
                description: Workout object
                properties:
                  details:
                    description: |
                      [View details](../workouts/types)
                    format: json
                    type: string
                  type:
                    description: Workout type
                    enum:
                      - Amrap
                      - Cardio
                      - CardioIntervals
                      - DeathBy
                      - Emom
                      - Fgb
                      - ForTime
                      - FranStyle
                      - Generic
                      - MaxReps
                      - RoundsForTime
                      - Strength
                      - Tabata
                      - TwelveDays
                      - WarmUp
                    type: string
                required:
                  - type
                  - details
                type: object
              workout_id:
                description: >-
                  ID of an existing workout. Either this field or `workout` must
                  be provided.
                type: integer
            required:
              - row_order
            type: object
          type: array
        name:
          description: WOD name
          type: string
        occurs_on:
          description: Date WOD is programmed on
          format: date
          type: string
        order:
          default: 0
          description: WOD order if multiple WODs on same day
          type: integer
        program_id:
          description: ID of program to program WOD for
          type: string
        publish_at:
          description: Time when WOD is visible
          format: date-time
          type: string
      required:
        - publish_at
        - occurs_on
        - wod_components
      title: CreateWodRequest
      type: object
    WodResponse:
      description: Response schema for creating a wod
      example:
        components:
          - id: wc_123abc
            is_alternating: false
            level: Rx
            notes: Aim for an 80% effort today.
            notes_for_coaches: Try to complete this section in 10 minutes.
            order: 0
            partners: 0
            post_instructions: null
            pre_instructions: Make sure to warm up your hips first.
            prefix: A
            results_count: 0
            workout:
              description: Back Squat 5 reps
              details:
                movements:
                  - id: mv_fT0m3viH
                    load: null
                    reps: '5'
                rest:
                  type: as_needed
                type: Strength
              movements:
                - complex_details: null
                  description: null
                  has_calories: false
                  has_distance: false
                  has_duration: false
                  has_height: false
                  has_load: true
                  has_power: false
                  has_reps: true
                  id: mv_fT0m3viH
                  name: Back Squat
                  source: wodup
                  video:
                    id: dQw4w9WgXcQ
                    service: youtube
              name: null
              type: Strength
        id: wod_123abc
        name: Morning Workout
        occurs_on: '2020-01-01'
        order: 0
        program:
          access: private
          id: p_123abc
          name: Strength and Conditioning
          period: continuous
          status: active
        publish_at: '2020-01-01T00:00:00Z'
      properties:
        components:
          description: Components in this WOD
          items:
            properties:
              id:
                description: WOD Component ID
                type: string
              is_alternating:
                description: Whether this component alternates with the next one
                type: boolean
              level:
                description: >-
                  The level this component belongs to, for gyms using the Levels
                  feature (e.g. 'Rx', 'Scaled'). Null for programs that don't
                  use levels.
                type: string
              name:
                description: Component name
                type: string
              notes:
                description: Component notes
                type: string
              notes_for_coaches:
                description: Component notes for coaches
                type: string
              order:
                default: 0
                description: Component order
                type: integer
              partners:
                description: Number of partners.
                minimum: 0
                type: integer
              post_instructions:
                description: Instructions immediately proceeding the workout
                type: string
              pre_instructions:
                description: Instructions immediately preceeding the workout
                type: string
              prefix:
                description: Prefix for this workout, e.g. 'B1'.
                type: string
              workout:
                description: Workout object
                properties:
                  description:
                    description: A human readable description of the workout
                    type: string
                  details:
                    description: '[View details](../workouts/types)'
                    format: json
                    type: string
                  movements:
                    description: Movement objects referenced by this workout
                    items:
                      $ref: '#/components/schemas/Movement'
                    type: array
                  name:
                    description: An official name for the workout
                    type: string
                  type:
                    description: Workout type
                    enum:
                      - Amrap
                      - Cardio
                      - CardioIntervals
                      - DeathBy
                      - Emom
                      - Fgb
                      - ForTime
                      - FranStyle
                      - Generic
                      - MaxReps
                      - RoundsForTime
                      - Strength
                      - Tabata
                      - TwelveDays
                      - WarmUp
                    type: string
                required:
                  - type
                  - description
                  - details
                  - movements
                type: object
            required:
              - row_order
              - workout
            type: object
          type: array
        id:
          description: WOD ID
          type: string
        name:
          description: WOD name
          type: string
        occurs_on:
          description: Date WOD is programmed on
          format: date
          type: string
        order:
          default: 0
          description: WOD order if multiple WODs on same day
          type: integer
        publish_at:
          description: Time when WOD is visible
          format: date-time
          type: string
      title: WodResponse
      type: object
    Movement:
      description: Movement object
      properties:
        complex_details:
          description: Movements in this complex
          items:
            properties:
              movement_id:
                description: Movement id
                type: string
              reps:
                description: Number of reps to perform
                type: integer
            required:
              - movement_id
              - reps
            type: object
          type: array
        description:
          description: Movement instructions / description
          type: string
        has_calories:
          description: Does this movement involve calories. E.g. Row
          type: boolean
        has_distance:
          description: Does this movement involve distance. E.g. Row
          type: boolean
        has_duration:
          description: Does this movement involve duration. E.g. Row or Weighted Plank Hold
          type: boolean
        has_height:
          description: Does this movement involve height. E.g. Box Jumps
          type: boolean
        has_load:
          description: >-
            Does this movement involve load. E.g. Back Squat or Weighted Plank
            Hold
          type: boolean
        has_power:
          description: Does this movement involve power. E.g. Row
          type: boolean
        has_reps:
          description: Does this movement involve reps. E.g. Push-Up or Back Squat
          type: boolean
        id:
          description: Movement ID
          type: string
        name:
          description: Movement name
          type: string
        source:
          description: >-
            Whether this movement is from the global WodUp library or a custom
            movement
          enum:
            - wodup
            - custom
          type: string
        video:
          properties:
            id:
              description: Video id
              type: string
            service:
              description: Video service
              enum:
                - vimeo
                - youtube
              type: string
          required:
            - id
            - service
          type: object
      title: Movement
      type: object
  securitySchemes:
    authorization:
      scheme: basic
      type: http

````