:::open-api-operation
---
operation:
  kind: operation
  method: get
  path: /shipments
  operationId: listShipments
  summary: List shipments
  deprecated: false
  tags:
    - Shipments
  parameters:
    - name: page
      in: query
      description: Which page to return, counting from one.
      required: false
      schema:
        types:
          - integer
        default: 1
        constraints:
          minimum: 1
  responses:
    - status: "200"
      description: A page of shipments.
      content:
        - type: application/json
          schema:
            types:
              - object
            properties:
              - name: items
                required: true
                schema:
                  types:
                    - array
                  items:
                    name: Shipment
                    ref: "#/components/schemas/Shipment"
                    types:
                      - object
                    title: Shipment
                    description: One shipment, as the first API saw it.
                    properties:
                      - name: id
                        required: true
                        schema:
                          types:
                            - string
                          format: uuid
                          readOnly: true
                      - name: label
                        required: true
                        schema:
                          types:
                            - string
                          description: Renamed to `reference` in 2.x.
                          constraints:
                            minLength: 1
                            maxLength: 120
                      - name: state
                        required: true
                        schema:
                          types:
                            - string
                          description: Renamed to `status` in 2.x, and gained `cancelled`.
                          enum:
                            - booked
                            - sailing
                            - landed
                      - name: createdAt
                        required: false
                        schema:
                          types:
                            - string
                          format: date-time
                          readOnly: true
              - name: pages
                required: false
                schema:
                  types:
                    - integer
                  description: How many pages there are in total.
servers:
  - url: https://api.example.org/v1
    description: The invented production host, switched off.
security:
  - - key: apiKey
      scheme:
        key: apiKey
        type: apiKey
        description: A key from the account page.
        name: X-Api-Key
        in: header
securitySchemes:
  - key: apiKey
    type: apiKey
    description: A key from the account page.
    name: X-Api-Key
    in: header
---
Returns a page of shipments, oldest first.
:::