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

# Format an ISO 8601 duration

> Formats an ISO 8601 duration string (e.g. `PT1H30M`) into one or more human-readable formats. **Pro license required.**



## OpenAPI

````yaml /api-reference/utilities/openapi.json post /iso8601/format
openapi: 3.1.0
info:
  title: Magic Meal Kits — Utilities API
  version: 1.0.0
  description: >-
    Single-purpose helper endpoints: sandboxed JavaScript execution, JSON
    extraction from mixed text, ISO 8601 duration formatting, and Markdown →
    Slack Block Kit conversion.
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://{deployment}/api/v1
    description: Your Magic Meal Kits deployment
    variables:
      deployment:
        default: magic-meal-kits-xxxxx.run.app
        description: Your Cloud Run host (without protocol)
security:
  - ApiKeyAuth: []
tags:
  - name: JavaScript
    description: Execute JavaScript in a sandbox.
  - name: JSON
    description: Extract JSON from mixed text content.
  - name: ISO 8601
    description: Format and decompose ISO 8601 durations.
  - name: Slack
    description: Convert Markdown to Slack Block Kit.
paths:
  /iso8601/format:
    post:
      tags:
        - ISO 8601
      summary: Format an ISO 8601 duration
      description: >-
        Formats an ISO 8601 duration string (e.g. `PT1H30M`) into one or more
        human-readable formats. **Pro license required.**
      operationId: formatISO8601
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ISO8601FormatRequest'
            example:
              duration: PT1H30M15S
              formats:
                - hh:mm:ss
                - long
      responses:
        '200':
          description: Formatted duration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ISO8601FormatResponse'
              example:
                original: PT1H30M15S
                standard_time: '01:30:15'
                formats:
                  hh:mm:ss: '01:30:15'
                  long: 1 hour 30 minutes 15 seconds
                is_valid: true
        '400':
          description: Invalid request or non-Pro license
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusErrorResponse'
components:
  schemas:
    ISO8601FormatRequest:
      type: object
      required:
        - duration
      properties:
        duration:
          type: string
          description: ISO 8601 duration, e.g. `PT1H30M15S`.
        formats:
          type: array
          items:
            type: string
            enum:
              - long
              - short
              - mm:ss
              - hh:mm:ss
              - dd:hh:mm:ss
              - seconds
              - minutes
              - hours
          description: Which formats to return. Omit for defaults.
    ISO8601FormatResponse:
      type: object
      properties:
        original:
          type: string
        standard_time:
          type: string
          description: HH:MM:SS form.
        formats:
          type: object
          additionalProperties:
            type: string
        is_valid:
          type: boolean
        error:
          type: string
    StatusErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: error
        error:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Your deployment's API key (MMK_API_KEY). Routes that accept OAuth2 also
        allow `Authorization: Bearer <token>`.

````