> ## 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.

# Decompose an ISO 8601 duration

> Parses an ISO 8601 duration into numeric days/hours/minutes/seconds. **Pro license required.**



## OpenAPI

````yaml /api-reference/utilities/openapi.json post /iso8601/components
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/components:
    post:
      tags:
        - ISO 8601
      summary: Decompose an ISO 8601 duration
      description: >-
        Parses an ISO 8601 duration into numeric days/hours/minutes/seconds.
        **Pro license required.**
      operationId: componentsISO8601
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ISO8601ComponentsRequest'
            example:
              duration: P1DT2H30M
      responses:
        '200':
          description: Duration components
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ISO8601ComponentsResponse'
              example:
                original: P1DT2H30M
                days: 1
                hours: 2
                minutes: 30
                seconds: 0
                is_valid: true
        '400':
          description: Invalid request or non-Pro license
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusErrorResponse'
components:
  schemas:
    ISO8601ComponentsRequest:
      type: object
      required:
        - duration
      properties:
        duration:
          type: string
          description: ISO 8601 duration, e.g. `P1DT2H30M`.
    ISO8601ComponentsResponse:
      type: object
      properties:
        original:
          type: string
        days:
          type: integer
        hours:
          type: integer
        minutes:
          type: integer
        seconds:
          type: integer
        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>`.

````