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

# Create schedule

> Create a schedule. Pass `teamId` in the body (not the path).

**WARNING:** Send at least one of `teamTwoId` or `teamTwoName` (400 if both are omitted). When only `teamTwoId` is sent, we set `teamTwoName` from that team's name.

**WARNING:** If you do not provide a value for a format field, we set a default on our side (eventType=`game`, duration=`30`, matchupFormat=`halves`, teamFormat=`7v7`, booleans=`false`, overtimeType=`unlimited`, endDate=`startDate`+duration). You must still send `teamId` and `startDate`. If you send a value, we use yours. PATCH does not apply these create defaults.

Pass **`teamId` in the body** (not the path). The team must belong to the API key organization.

<Warning>
  **Opponent required:** send at least one of `teamTwoId` or `teamTwoName`.

  * `teamTwoName` — guest / external opponent display name
  * `teamTwoId` — linked team in the same API key organization (when only `teamTwoId` is sent, we set `teamTwoName` from that team's name)
  * You may send both

  If you omit both, the API returns `400` with: `Either teamTwoId or teamTwoName must be provided`.
</Warning>

<Warning>
  **If you do not provide a value for a format field, we set a default on our side** (create only).

  You must still send `teamId`, `startDate`, and at least one of `teamTwoName` or `teamTwoId`. For everything else below, skipping the field means **we fill it** — the field is not left empty.

  | Field                | Value we set if you do not send it                                                     |
  | -------------------- | -------------------------------------------------------------------------------------- |
  | `eventType`          | `game`                                                                                 |
  | `duration`           | `30`                                                                                   |
  | `matchupFormat`      | `halves`                                                                               |
  | `teamFormat`         | `7v7`                                                                                  |
  | `isTestGame`         | `false`                                                                                |
  | `isScrimmage`        | `false`                                                                                |
  | `enableYardage`      | `false`                                                                                |
  | `allowZeroYardStart` | `false`                                                                                |
  | `overtimeType`       | `unlimited`                                                                            |
  | `endDate`            | `startDate` + `duration` minutes                                                       |
  | `fieldSizeInYard`    | `50` if `enableYardage` is `true`; otherwise we do not set it                          |
  | `overtimeDuration`   | only needed if you send `overtimeType: limited` (we do not invent a limited OT length) |

  If you send a value, we use yours. Send format fields yourself when you need exact game settings.
</Warning>

You must send: `teamId`, `startDate`, and at least one of `teamTwoName` or `teamTwoId`.

Other body fields you may send: `teamTwoId`, `teamTwoName`, `eventType`, `endDate`, `duration`, `matchupFormat`, `teamFormat`, `isTestGame`, `isScrimmage`, `enableYardage`, `allowZeroYardStart`, `fieldSizeInYard`, `overtimeType`, `overtimeDuration`, `locationName`, `placeId`, `location`, `practiceNote`.

Do not send `startTime`, `endTime`, or `isRecurring` — those are UI-only and are not accepted by this API.

### Minimal example (guest opponent name)

```json theme={null}
{
  "teamId": "6917707a0e8f6ee5171235c2",
  "startDate": "2026-09-26T22:00:00.000Z",
  "teamTwoName": "Long Island University"
}
```

### Minimal example (linked opponent team)

```json theme={null}
{
  "teamId": "6917707a0e8f6ee5171235c2",
  "startDate": "2026-09-26T22:00:00.000Z",
  "teamTwoId": "6917707a0e8f6ee5171235c3"
}
```

### Full payload (same values we set as defaults)

Sending this body is equivalent to the minimal example above — these are the format values we fill on our side when you omit them:

```json theme={null}
{
  "teamId": "6917707a0e8f6ee5171235c2",
  "startDate": "2026-09-26T22:00:00.000Z",
  "endDate": "2026-09-26T22:30:00.000Z",
  "teamTwoName": "Long Island University",
  "eventType": "game",
  "duration": 30,
  "matchupFormat": "halves",
  "teamFormat": "7v7",
  "isTestGame": false,
  "isScrimmage": false,
  "enableYardage": false,
  "allowZeroYardStart": false,
  "overtimeType": "unlimited"
}
```

`fieldSizeInYard` is only set when `enableYardage` is `true` (then we default to `50` if you omit it). `overtimeDuration` is only needed when `overtimeType` is `limited`. Location fields (`locationName`, `placeId`, `location`) and `practiceNote` stay unset unless you send them.


## OpenAPI

````yaml openapi.json POST /v1/blitz-api/schedules
openapi: 3.0.3
info:
  title: BlitzBoard Public API
  version: 1.0.0
  description: >-
    Organization-scoped public integration API for seasons, teams, players,
    schedules, and team player statistics.

    Authenticate with `Authorization: Bearer bb_live_...` (API key, not a login
    JWT).

    Generate keys from Organizations → organization detail at
    https://live.blitzboardstats.com/organizations.

    List seasons via GET /v1/blitz-api/seasons and pass `_id` as `season` when
    creating a team.
servers:
  - url: https://sandbox.blitzboardstats.com/api
    description: Sandbox
security:
  - ApiKeyBearer: []
tags:
  - name: Seasons
    description: List seasons to use when creating teams
  - name: Teams
    description: Team CRUD scoped to the API key organization
  - name: Players
    description: Players under a team
  - name: Schedules
    description: Schedule events under a team
paths:
  /v1/blitz-api/schedules:
    post:
      tags:
        - Schedules
      summary: Create schedule
      description: >-
        Create a schedule. Pass `teamId` in the body (not the path).


        **WARNING:** Send at least one of `teamTwoId` or `teamTwoName` (400 if
        both are omitted). When only `teamTwoId` is sent, we set `teamTwoName`
        from that team's name.


        **WARNING:** If you do not provide a value for a format field, we set a
        default on our side (eventType=`game`, duration=`30`,
        matchupFormat=`halves`, teamFormat=`7v7`, booleans=`false`,
        overtimeType=`unlimited`, endDate=`startDate`+duration). You must still
        send `teamId` and `startDate`. If you send a value, we use yours. PATCH
        does not apply these create defaults.
      operationId: createSchedule
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateScheduleRequest'
            examples:
              minimal:
                summary: Minimal create (we fill format fields on our side)
                value:
                  teamId: 6917707a0e8f6ee5171235c2
                  startDate: '2026-09-26T22:00:00.000Z'
                  teamTwoName: Long Island University
              full:
                summary: Full payload (same values we set as defaults)
                value:
                  teamId: 6917707a0e8f6ee5171235c2
                  startDate: '2026-09-26T22:00:00.000Z'
                  endDate: '2026-09-26T22:30:00.000Z'
                  teamTwoName: Long Island University
                  eventType: game
                  duration: 30
                  matchupFormat: halves
                  teamFormat: 7v7
                  isTestGame: false
                  isScrimmage: false
                  enableYardage: false
                  allowZeroYardStart: false
                  overtimeType: unlimited
      responses:
        '201':
          description: Schedule created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduleResponse'
              examples:
                success:
                  summary: Successful response
                  value:
                    _id: 66f0a1b2c3d4e5f678901456
                    eventType: game
                    eventTitle: Falcons vs Guest Team
                    startDate: '2026-10-01'
                    endDate: '2026-10-01'
                    teamOneId: 66f0a1b2c3d4e5f678901234
                    teamTwoName: Guest Team
                    createdAt: '2026-09-13T18:00:00.000Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    CreateScheduleRequest:
      type: object
      description: >-
        WARNING: You must send at least one of teamTwoId or teamTwoName (400 if
        both are omitted). When only teamTwoId is sent, we set teamTwoName from
        that team's name. WARNING: If you do not provide a value for a format
        field on create, we set a default on our side (eventType=game,
        duration=30, matchupFormat=halves, teamFormat=7v7, booleans false,
        overtimeType=unlimited, endDate=startDate+duration). You must still send
        teamId and startDate. If you send a value, we use yours.
      required:
        - teamId
        - startDate
      properties:
        teamId:
          type: string
          description: Team that owns this schedule. You must send this.
          example: 6917707a0e8f6ee5171235c2
        teamTwoId:
          type: string
          description: >-
            Optional on its own, but you must send teamTwoId and/or teamTwoName.
            Opponent team Mongo id in the same API key organization. When only
            teamTwoId is sent, we set teamTwoName from that team's name.
          example: 6917707a0e8f6ee5171235c3
        teamTwoName:
          type: string
          description: >-
            Optional on its own, but you must send teamTwoId and/or teamTwoName.
            Opponent display name for a guest / external opponent.
          example: Long Island University
        startDate:
          type: string
          format: date-time
          description: When the event starts. You must send this.
          example: '2026-09-26T22:00:00.000Z'
        endDate:
          type: string
          format: date-time
          description: >-
            If you do not provide this field, we set startDate + duration
            minutes on our side.
          example: '2026-09-26T22:30:00.000Z'
        eventType:
          type: string
          enum:
            - game
            - practice
          description: If you do not provide this field, we set `game` on our side.
          example: game
        duration:
          type: integer
          enum:
            - 20
            - 24
            - 30
            - 40
            - 48
            - 50
            - 60
          description: If you do not provide this field, we set `30` on our side.
          example: 30
        matchupFormat:
          type: string
          enum:
            - halves
            - quarters
            - runningClock
          description: If you do not provide this field, we set `halves` on our side.
          example: halves
        teamFormat:
          type: string
          enum:
            - 4v4
            - 5v5
            - 6v6
            - 7v7
            - 8v8
            - 9v9
            - 11v11
          description: If you do not provide this field, we set `7v7` on our side.
          example: 7v7
        isTestGame:
          type: boolean
          description: If you do not provide this field, we set `false` on our side.
          example: false
        fieldSizeInYard:
          type: integer
          enum:
            - 30
            - 40
            - 45
            - 50
            - 60
            - 64
            - 70
            - 80
            - 100
          description: >-
            Send when enableYardage is true. If enableYardage is true and you do
            not provide this field, we set `50` on our side.
          example: 50
        enableYardage:
          type: boolean
          description: If you do not provide this field, we set `false` on our side.
          example: false
        isScrimmage:
          type: boolean
          description: If you do not provide this field, we set `false` on our side.
          example: false
        allowZeroYardStart:
          type: boolean
          description: If you do not provide this field, we set `false` on our side.
          example: false
        overtimeType:
          type: string
          enum:
            - limited
            - unlimited
          description: If you do not provide this field, we set `unlimited` on our side.
          example: unlimited
        overtimeDuration:
          type: number
          description: >-
            Send when overtimeType is limited (minutes). We do not invent a
            limited overtime length.
          minimum: 1
          example: 5
        practiceNote:
          type: string
        locationName:
          type: string
        placeId:
          type: string
        tournamentId:
          type: string
      example:
        teamId: 6917707a0e8f6ee5171235c2
        startDate: '2026-09-26T22:00:00.000Z'
        endDate: '2026-09-26T22:30:00.000Z'
        teamTwoName: Long Island University
        eventType: game
        duration: 30
        matchupFormat: halves
        teamFormat: 7v7
        isTestGame: false
        isScrimmage: false
        enableYardage: false
        allowZeroYardStart: false
        overtimeType: unlimited
    ScheduleResponse:
      type: object
      additionalProperties: true
      example:
        _id: 66f0a1b2c3d4e5f678901456
        eventType: GAME
        eventTitle: Falcons vs Guest Team
        startDate: '2026-10-01'
        endDate: '2026-10-01'
        teamId: 66f0a1b2c3d4e5f678901234
        teamTwoName: Guest Team
        createdAt: '2026-09-13T18:00:00.000Z'
    ErrorResponse:
      type: object
      properties:
        error:
          type: number
        message:
          type: string
        timestamp:
          type: string
          format: date-time
        traceId:
          type: string
      example:
        error: 40101
        message: Invalid API key
        timestamp: '2026-09-13T14:45:41.317Z'
        traceId: req_41f0e6c8a5ea232a
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Outside API key organization scope or insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Public integration API key (`bb_live_...`). Not a login JWT.

````