tca-api-headless

Contract

The contract

TCA API writes an OpenAPI document per site, and tca-api-headless types everything it adds: regions, every content type, links, the navigation tree and the lookup. This is this site's document, read while the page was built:

GET /_api/openapi.json

Download: website.json ยท website.d.ts

Paths

MethodPathDescription
GET/_api/headless_navigation/{uid}Get single HeadlessNavigation
GET/_api/headless_pagesLook up a page by its path
GET/_api/headless_pages/{uid}Get single HeadlessPages

Schemas 34

Pages and navigation
  • HeadlessNavigationRead
    type HeadlessNavigationRead = {
        "@type"?: string;
        "@id"?: string;
        uid: number;
        title?: string;
        nav_title?: string;
        slug?: string | null;
        doktype?: 1 | 3 | 4;
        url: string;
        children: components["schemas"]["HeadlessNavigationRead"][];
    };
  • HeadlessNavigationCollection
    type HeadlessNavigationCollection = {
        "@context"?: string;
        "@type"?: string;
        "@id"?: string;
        "hydra:totalItems"?: number;
        "hydra:member"?: components["schemas"]["HeadlessNavigationRead"][];
        "hydra:view"?: {
            "@type"?: string;
            "hydra:first"?: string;
            "hydra:last"?: string;
            "hydra:previous"?: string | null;
            "hydra:next"?: string | null;
        };
        "hydra:search"?: {
            "@type"?: string;
            "hydra:template"?: string;
            "hydra:variableRepresentation"?: string;
            "hydra:mapping"?: {
                "@type"?: string;
                variable?: string;
                property?: string;
                required?: boolean;
            }[];
        };
    };
  • HeadlessPagesRead
    type HeadlessPagesRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        title?: string;
        slug?: string | null;
        seo_title?: string;
        description?: string | null;
        no_index?: number;
        no_follow?: number;
        canonical_link?: components["schemas"]["HeadlessLink"] | null;
        og_title?: string;
        og_description?: string | null;
        og_image?: components["schemas"]["FileObject"][];
        breadcrumbs: components["schemas"]["HeadlessPagesBreadcrumb"][];
        languages: components["schemas"]["HeadlessPagesLanguage"][];
        meta: components["schemas"]["HeadlessPagesMeta"];
        regions: {
            [key: string]: components["schemas"]["HeadlessContentRead"][];
        };
        shortcut?: components["schemas"]["HeadlessPagesShortcut"] | null;
    };
  • HeadlessPagesCollection
    type HeadlessPagesCollection = {
        "@context"?: string;
        "@type"?: string;
        "@id"?: string;
        "hydra:totalItems"?: number;
        "hydra:member"?: components["schemas"]["HeadlessPagesLookup"][];
        "hydra:view"?: {
            "@type"?: string;
            "hydra:first"?: string;
            "hydra:last"?: string;
            "hydra:previous"?: string | null;
            "hydra:next"?: string | null;
        };
        "hydra:search"?: {
            "@type"?: string;
            "hydra:template"?: string;
            "hydra:variableRepresentation"?: string;
            "hydra:mapping"?: {
                "@type"?: string;
                variable?: string;
                property?: string;
                required?: boolean;
            }[];
        };
        redirect?: components["schemas"]["HeadlessPagesRedirect"];
    };
  • HeadlessPagesBreadcrumb
    type HeadlessPagesBreadcrumb = {
        uid: number;
        title: string;
        nav_title: string;
        url: string;
        doktype: number;
    };
  • HeadlessPagesLanguage
    type HeadlessPagesLanguage = {
        languageId: number;
        locale: string;
        hreflang: string;
        title: string;
        url: string | null;
        available: boolean;
        active: boolean;
    };
  • HeadlessPagesMeta
    type HeadlessPagesMeta = {
        robots: "index,follow" | "index,nofollow" | "noindex,follow" | "noindex,nofollow";
        canonical: string | null;
        schema: {
            "@context": "https://schema.org";
            "@type": "WebPage";
            url: string;
            name: string;
            inLanguage: string;
            description?: string;
        };
        alternates: {
            hreflang: string;
            href: string;
        }[];
    };
  • HeadlessPagesLookup
    type HeadlessPagesLookup = {
        "@type": string;
        "@id": string;
        uid: number;
    };
  • HeadlessPagesRedirect
    type HeadlessPagesRedirect = {
        url: string;
        statusCode: number;
    };
  • HeadlessPagesShortcut
    type HeadlessPagesShortcut = {
        uid: number;
        url: string;
    };
Content elements
  • HeadlessContentTextRead
    type HeadlessContentTextRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "text";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        bodytext?: components["schemas"]["PortableText"];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentTextmediaRead
    type HeadlessContentTextmediaRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "textmedia";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        bodytext?: components["schemas"]["PortableText"];
        assets?: components["schemas"]["FileObject"][];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentTextpicRead
    type HeadlessContentTextpicRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "textpic";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        bodytext?: components["schemas"]["PortableText"];
        image?: components["schemas"]["FileObject"][];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentImageRead
    type HeadlessContentImageRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "image";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        image?: components["schemas"]["FileObject"][];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentHeaderRead
    type HeadlessContentHeaderRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "header";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentBulletsRead
    type HeadlessContentBulletsRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "bullets";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        bullets_type?: number;
        bodytext?: components["schemas"]["HeadlessBulletList"];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentTableRead
    type HeadlessContentTableRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "table";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        bodytext?: components["schemas"]["HeadlessTable"];
        table_caption?: string | null;
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
        table_header_position?: number;
    };
  • HeadlessContentUploadsRead
    type HeadlessContentUploadsRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "uploads";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        media?: components["schemas"]["FileObject"][];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentHtmlRead
    type HeadlessContentHtmlRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "html";
        header?: string;
        bodytext?: components["schemas"]["HeadlessHtml"];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentShortcutRead
    type HeadlessContentShortcutRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "shortcut";
        header?: string;
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
        records: components["schemas"]["HeadlessContentRead"][];
    };
  • HeadlessContentRead
    type HeadlessContentRead = components["schemas"]["HeadlessContentTextRead"] | components["schemas"]["HeadlessContentTextmediaRead"] | components["schemas"]["HeadlessContentTextpicRead"] | components["schemas"]["HeadlessContentImageRead"] | components["schemas"]["HeadlessContentHeaderRead"] | components["schemas"]["HeadlessContentBulletsRead"] | components["schemas"]["HeadlessContentTableRead"] | components["schemas"]["HeadlessContentUploadsRead"] | components["schemas"]["HeadlessContentHtmlRead"] | components["schemas"]["HeadlessContentShortcutRead"];
  • HeadlessContentCollection
    type HeadlessContentCollection = {
        "@context"?: string;
        "@type"?: string;
        "@id"?: string;
        "hydra:totalItems"?: number;
        "hydra:member"?: components["schemas"]["HeadlessContentRead"][];
        "hydra:view"?: {
            "@type"?: string;
            "hydra:first"?: string;
            "hydra:last"?: string;
            "hydra:previous"?: string | null;
            "hydra:next"?: string | null;
        };
        "hydra:search"?: {
            "@type"?: string;
            "hydra:template"?: string;
            "hydra:variableRepresentation"?: string;
            "hydra:mapping"?: {
                "@type"?: string;
                variable?: string;
                property?: string;
                required?: boolean;
            }[];
        };
    };
  • HeadlessBulletList
    type HeadlessBulletList = string[] | {
        term: string;
        definition: string;
    }[];
  • HeadlessTable
    type HeadlessTable = {
        head: string[];
        body: string[][];
        foot: string[];
    };
Rich text
  • PortableText
    type PortableText = components["schemas"]["PortableTextBlock"][];
  • PortableTextBlock
    type PortableTextBlock = {
        _type: "block";
        _key: string;
        style: "normal" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "blockquote";
        markDefs: components["schemas"]["PortableTextLink"][];
        children: components["schemas"]["PortableTextSpan"][];
        listItem?: "bullet" | "number";
        level?: number;
    };
  • PortableTextSpan
    type PortableTextSpan = {
        _type: "span";
        _key: string;
        marks: string[];
        text: string;
    };
  • PortableTextLink
    type PortableTextLink = {
        _type: "link";
        _key: string;
        href: string;
        target: string | null;
        title: string | null;
    };
Links, files and protocol
  • RelationStub
    type RelationStub = {
        "@id": string;
        "@type": string;
        uid: number;
    };
  • FileObject
    type FileObject = {
        uid?: number;
        name?: string;
        extension?: string;
        publicUrl?: string | null;
        mimeType?: string;
        fileSize?: number;
        metadata?: {
            title?: string | null;
            alternative?: string | null;
            description?: string | null;
            copyright?: string | null;
        };
        width?: number;
        height?: number;
        cropVariants?: {
            [key: string]: {
                publicUrl?: string;
                width?: number;
                height?: number;
            };
        };
    };
  • HydraError
    type HydraError = {
        "@context"?: string;
        "@type": string;
        "hydra:title": string;
        "hydra:description": string;
    };
  • ValidationError
    type ValidationError = {
        "@context"?: string;
        "@type"?: string;
        "hydra:title"?: string;
        "hydra:description"?: string;
        violations?: {
            propertyPath?: string;
            message?: string;
            code?: string;
        }[];
    };
  • HeadlessHtml
    type HeadlessHtml = string;
  • HeadlessLink
    type HeadlessLink = {
        href: string;
        target: string | null;
        title: string | null;
    };
Response 200GET /website/_api/openapi.json

Request GET /website/_api/openapi.json Status 200

Recorded at build time from TYPO3 14.3. Host replaced with typo3.example; the data is unchanged. Full JSON response

JSON response

{
  "openapi": "3.1.0",
  "info": {
    "title": "TCA API",
    "version": "1.0.0"
  },
  "paths": {/* 3 paths */},
  "components": {
    "schemas": {/* 34 schemas */},
    "securitySchemes": {
      "FrontendSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "fe_typo_user",
        "description": "TYPO3 frontend user session."
      },
      "BackendSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "be_typo_user",
        "description": "TYPO3 backend user session."
      }
    }
  },
  "tags": [
    {
      "name": "HeadlessContent"
    },
    {
      "name": "HeadlessNavigation"
    },
    {
      "name": "HeadlessPages"
    }
  ]
}
Proofregions.main[0]

Request GET /website/_api/headless_pages/2014 #/regions/main/0 Status 200

Recorded at build time from TYPO3 14.3. Host replaced with typo3.example; the data is unchanged. Full JSON response

JSON response

{
  "uid": 2210,
  "CType": "text",
  "header": "The contract",
  "header_layout": 0,
  "header_position": "",
  "header_link": null,
  "subheader": "",
  "bodytext": [
    {
      "_type": "block",
      "_key": "k0",
      "style": "normal",
      "markDefs": [],
      "children": [
        {
          "_type": "span",
          "_key": "k1",
          "marks": [],
          "text": "TCA API writes an OpenAPI document per site, and tca-api-headless types everything it adds: regions, every content type, links, the navigation tree and the lookup. This is this site's document, read while the page was built:"
        }
      ]
    },
    {
      "_type": "block",
      "_key": "k2",
      "style": "normal",
      "markDefs": [],
      "children": [
        {
          "_type": "span",
          "_key": "k3",
          "marks": [
            "code"
          ],
          "text": "GET /_api/openapi.json"
        }
      ]
    }
  ],
  "layout": 0,
  "frame_class": "default",
  "space_before_class": "",
  "space_after_class": ""
}

Generated TypeScript type

type HeadlessContentTextRead = {
    "@type"?: string;
    "@id"?: string;
    uid?: number;
    CType: "text";
    header?: string;
    header_layout?: number;
    header_position?: string;
    header_link?: components["schemas"]["HeadlessLink"] | null;
    subheader?: string;
    bodytext?: components["schemas"]["PortableText"];
    layout?: number;
    frame_class?: string;
    space_before_class?: string;
    space_after_class?: string;
};

Generated, then compared

This site generates its TypeScript declarations from that document with openapi-typescript, and its CI fails when they drift apart. Every proof on this site shows the type of its element, cut from those declarations.

bunx openapi-typescript openapi.json -o src/api/schema.d.ts

The CLI writes the same document without a web request:

vendor/bin/typo3 tca-api:openapi website --output openapi.json
Proofregions.main[1]

Request GET /website/_api/headless_pages/2014 #/regions/main/1 Status 200

Recorded at build time from TYPO3 14.3. Host replaced with typo3.example; the data is unchanged. Full JSON response

JSON response

{
  "uid": 2211,
  "CType": "text",
  "header": "Generated, then compared",
  "header_layout": 0,
  "header_position": "",
  "header_link": null,
  "subheader": "",
  "bodytext": [
    {
      "_type": "block",
      "_key": "k0",
      "style": "normal",
      "markDefs": [],
      "children": [
        {
          "_type": "span",
          "_key": "k1",
          "marks": [],
          "text": "This site generates its TypeScript declarations from that document with openapi-typescript, and its CI fails when they drift apart. Every proof on this site shows the type of its element, cut from those declarations."
        }
      ]
    },
    {
      "_type": "block",
      "_key": "k2",
      "style": "normal",
      "markDefs": [],
      "children": [
        {
          "_type": "span",
          "_key": "k3",
          "marks": [
            "code"
          ],
          "text": "bunx openapi-typescript openapi.json -o src/api/schema.d.ts"
        }
      ]
    },
    {
      "_type": "block",
      "_key": "k4",
      "style": "normal",
      "markDefs": [],
      "children": [
        {
          "_type": "span",
          "_key": "k5",
          "marks": [],
          "text": "The CLI writes the same document without a web request:"
        }
      ]
    },
    {
      "_type": "block",
      "_key": "k6",
      "style": "normal",
      "markDefs": [],
      "children": [
        {
          "_type": "span",
          "_key": "k7",
          "marks": [
            "code"
          ],
          "text": "vendor/bin/typo3 tca-api:openapi website --output openapi.json"
        }
      ]
    }
  ],
  "layout": 0,
  "frame_class": "default",
  "space_before_class": "",
  "space_after_class": ""
}

Generated TypeScript type

type HeadlessContentTextRead = {
    "@type"?: string;
    "@id"?: string;
    uid?: number;
    CType: "text";
    header?: string;
    header_layout?: number;
    header_position?: string;
    header_link?: components["schemas"]["HeadlessLink"] | null;
    subheader?: string;
    bodytext?: components["schemas"]["PortableText"];
    layout?: number;
    frame_class?: string;
    space_before_class?: string;
    space_after_class?: string;
};

One document per site

The document belongs to its site. Kettenblatt allows the fallback type menu_subpages, so only its document has HeadlessContentFallbackRead, and its frontend needs types of its own:

GET https://kettenblatt.example/_api/openapi.json

Download: kettenblatt.json ยท kettenblatt.d.ts

Paths

MethodPathDescription
GET/_api/headless_navigation/{uid}Get single HeadlessNavigation
GET/_api/headless_pagesLook up a page by its path
GET/_api/headless_pages/{uid}Get single HeadlessPages

Schemas 35

Pages and navigation
  • HeadlessNavigationRead
    type HeadlessNavigationRead = {
        "@type"?: string;
        "@id"?: string;
        uid: number;
        title?: string;
        nav_title?: string;
        slug?: string | null;
        doktype?: 1 | 3 | 4;
        url: string;
        children: components["schemas"]["HeadlessNavigationRead"][];
    };
  • HeadlessNavigationCollection
    type HeadlessNavigationCollection = {
        "@context"?: string;
        "@type"?: string;
        "@id"?: string;
        "hydra:totalItems"?: number;
        "hydra:member"?: components["schemas"]["HeadlessNavigationRead"][];
        "hydra:view"?: {
            "@type"?: string;
            "hydra:first"?: string;
            "hydra:last"?: string;
            "hydra:previous"?: string | null;
            "hydra:next"?: string | null;
        };
        "hydra:search"?: {
            "@type"?: string;
            "hydra:template"?: string;
            "hydra:variableRepresentation"?: string;
            "hydra:mapping"?: {
                "@type"?: string;
                variable?: string;
                property?: string;
                required?: boolean;
            }[];
        };
    };
  • HeadlessPagesRead
    type HeadlessPagesRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        title?: string;
        slug?: string | null;
        seo_title?: string;
        description?: string | null;
        no_index?: number;
        no_follow?: number;
        canonical_link?: components["schemas"]["HeadlessLink"] | null;
        og_title?: string;
        og_description?: string | null;
        og_image?: components["schemas"]["FileObject"][];
        breadcrumbs: components["schemas"]["HeadlessPagesBreadcrumb"][];
        languages: components["schemas"]["HeadlessPagesLanguage"][];
        meta: components["schemas"]["HeadlessPagesMeta"];
        regions: {
            [key: string]: (components["schemas"]["HeadlessContentRead"] | components["schemas"]["HeadlessContentFallbackRead"])[];
        };
        shortcut?: components["schemas"]["HeadlessPagesShortcut"] | null;
    };
  • HeadlessPagesCollection
    type HeadlessPagesCollection = {
        "@context"?: string;
        "@type"?: string;
        "@id"?: string;
        "hydra:totalItems"?: number;
        "hydra:member"?: components["schemas"]["HeadlessPagesLookup"][];
        "hydra:view"?: {
            "@type"?: string;
            "hydra:first"?: string;
            "hydra:last"?: string;
            "hydra:previous"?: string | null;
            "hydra:next"?: string | null;
        };
        "hydra:search"?: {
            "@type"?: string;
            "hydra:template"?: string;
            "hydra:variableRepresentation"?: string;
            "hydra:mapping"?: {
                "@type"?: string;
                variable?: string;
                property?: string;
                required?: boolean;
            }[];
        };
        redirect?: components["schemas"]["HeadlessPagesRedirect"];
    };
  • HeadlessPagesBreadcrumb
    type HeadlessPagesBreadcrumb = {
        uid: number;
        title: string;
        nav_title: string;
        url: string;
        doktype: number;
    };
  • HeadlessPagesLanguage
    type HeadlessPagesLanguage = {
        languageId: number;
        locale: string;
        hreflang: string;
        title: string;
        url: string | null;
        available: boolean;
        active: boolean;
    };
  • HeadlessPagesMeta
    type HeadlessPagesMeta = {
        robots: "index,follow" | "index,nofollow" | "noindex,follow" | "noindex,nofollow";
        canonical: string | null;
        schema: {
            "@context": "https://schema.org";
            "@type": "WebPage";
            url: string;
            name: string;
            inLanguage: string;
            description?: string;
        };
        alternates: {
            hreflang: string;
            href: string;
        }[];
    };
  • HeadlessPagesLookup
    type HeadlessPagesLookup = {
        "@type": string;
        "@id": string;
        uid: number;
    };
  • HeadlessPagesRedirect
    type HeadlessPagesRedirect = {
        url: string;
        statusCode: number;
    };
  • HeadlessPagesShortcut
    type HeadlessPagesShortcut = {
        uid: number;
        url: string;
    };
Content elements
  • HeadlessContentTextRead
    type HeadlessContentTextRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "text";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        bodytext?: components["schemas"]["PortableText"];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentTextmediaRead
    type HeadlessContentTextmediaRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "textmedia";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        bodytext?: components["schemas"]["PortableText"];
        assets?: components["schemas"]["FileObject"][];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentTextpicRead
    type HeadlessContentTextpicRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "textpic";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        bodytext?: components["schemas"]["PortableText"];
        image?: components["schemas"]["FileObject"][];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentImageRead
    type HeadlessContentImageRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "image";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        image?: components["schemas"]["FileObject"][];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentHeaderRead
    type HeadlessContentHeaderRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "header";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentBulletsRead
    type HeadlessContentBulletsRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "bullets";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        bullets_type?: number;
        bodytext?: components["schemas"]["HeadlessBulletList"];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentTableRead
    type HeadlessContentTableRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "table";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        bodytext?: components["schemas"]["HeadlessTable"];
        table_caption?: string | null;
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
        table_header_position?: number;
    };
  • HeadlessContentUploadsRead
    type HeadlessContentUploadsRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "uploads";
        header?: string;
        header_layout?: number;
        header_position?: string;
        header_link?: components["schemas"]["HeadlessLink"] | null;
        subheader?: string;
        media?: components["schemas"]["FileObject"][];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentHtmlRead
    type HeadlessContentHtmlRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "html";
        header?: string;
        bodytext?: components["schemas"]["HeadlessHtml"];
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
    };
  • HeadlessContentShortcutRead
    type HeadlessContentShortcutRead = {
        "@type"?: string;
        "@id"?: string;
        uid?: number;
        CType: "shortcut";
        header?: string;
        layout?: number;
        frame_class?: string;
        space_before_class?: string;
        space_after_class?: string;
        records: (components["schemas"]["HeadlessContentRead"] | components["schemas"]["HeadlessContentFallbackRead"])[];
    };
  • HeadlessContentRead
    type HeadlessContentRead = components["schemas"]["HeadlessContentTextRead"] | components["schemas"]["HeadlessContentTextmediaRead"] | components["schemas"]["HeadlessContentTextpicRead"] | components["schemas"]["HeadlessContentImageRead"] | components["schemas"]["HeadlessContentHeaderRead"] | components["schemas"]["HeadlessContentBulletsRead"] | components["schemas"]["HeadlessContentTableRead"] | components["schemas"]["HeadlessContentUploadsRead"] | components["schemas"]["HeadlessContentHtmlRead"] | components["schemas"]["HeadlessContentShortcutRead"];
  • HeadlessContentCollection
    type HeadlessContentCollection = {
        "@context"?: string;
        "@type"?: string;
        "@id"?: string;
        "hydra:totalItems"?: number;
        "hydra:member"?: components["schemas"]["HeadlessContentRead"][];
        "hydra:view"?: {
            "@type"?: string;
            "hydra:first"?: string;
            "hydra:last"?: string;
            "hydra:previous"?: string | null;
            "hydra:next"?: string | null;
        };
        "hydra:search"?: {
            "@type"?: string;
            "hydra:template"?: string;
            "hydra:variableRepresentation"?: string;
            "hydra:mapping"?: {
                "@type"?: string;
                variable?: string;
                property?: string;
                required?: boolean;
            }[];
        };
    };
  • HeadlessBulletList
    type HeadlessBulletList = string[] | {
        term: string;
        definition: string;
    }[];
  • HeadlessTable
    type HeadlessTable = {
        head: string[];
        body: string[][];
        foot: string[];
    };
  • HeadlessContentFallbackRead
    type HeadlessContentFallbackRead = {
        uid: number;
        CType: "menu_subpages";
        header: string;
    };
Rich text
  • PortableText
    type PortableText = components["schemas"]["PortableTextBlock"][];
  • PortableTextBlock
    type PortableTextBlock = {
        _type: "block";
        _key: string;
        style: "normal" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "blockquote";
        markDefs: components["schemas"]["PortableTextLink"][];
        children: components["schemas"]["PortableTextSpan"][];
        listItem?: "bullet" | "number";
        level?: number;
    };
  • PortableTextSpan
    type PortableTextSpan = {
        _type: "span";
        _key: string;
        marks: string[];
        text: string;
    };
  • PortableTextLink
    type PortableTextLink = {
        _type: "link";
        _key: string;
        href: string;
        target: string | null;
        title: string | null;
    };
Links, files and protocol
  • RelationStub
    type RelationStub = {
        "@id": string;
        "@type": string;
        uid: number;
    };
  • FileObject
    type FileObject = {
        uid?: number;
        name?: string;
        extension?: string;
        publicUrl?: string | null;
        mimeType?: string;
        fileSize?: number;
        metadata?: {
            title?: string | null;
            alternative?: string | null;
            description?: string | null;
            copyright?: string | null;
        };
        width?: number;
        height?: number;
        cropVariants?: {
            [key: string]: {
                publicUrl?: string;
                width?: number;
                height?: number;
            };
        };
    };
  • HydraError
    type HydraError = {
        "@context"?: string;
        "@type": string;
        "hydra:title": string;
        "hydra:description": string;
    };
  • ValidationError
    type ValidationError = {
        "@context"?: string;
        "@type"?: string;
        "hydra:title"?: string;
        "hydra:description"?: string;
        violations?: {
            propertyPath?: string;
            message?: string;
            code?: string;
        }[];
    };
  • HeadlessHtml
    type HeadlessHtml = string;
  • HeadlessLink
    type HeadlessLink = {
        href: string;
        target: string | null;
        title: string | null;
    };
Response 200GET /kettenblatt/_api/openapi.json

Request GET /kettenblatt/_api/openapi.json Status 200

Recorded at build time from TYPO3 14.3. Host replaced with typo3.example; the data is unchanged. Full JSON response

JSON response

{
  "openapi": "3.1.0",
  "info": {
    "title": "TCA API",
    "version": "1.0.0"
  },
  "paths": {/* 3 paths */},
  "components": {
    "schemas": {/* 35 schemas */},
    "securitySchemes": {
      "FrontendSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "fe_typo_user",
        "description": "TYPO3 frontend user session."
      },
      "BackendSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "be_typo_user",
        "description": "TYPO3 backend user session."
      }
    }
  },
  "tags": [
    {
      "name": "HeadlessContent"
    },
    {
      "name": "HeadlessNavigation"
    },
    {
      "name": "HeadlessPages"
    }
  ]
}
Proofregions.main[2]

Request GET /website/_api/headless_pages/2014 #/regions/main/2 Status 200

Recorded at build time from TYPO3 14.3. Host replaced with typo3.example; the data is unchanged. Full JSON response

JSON response

{
  "uid": 2212,
  "CType": "text",
  "header": "One document per site",
  "header_layout": 0,
  "header_position": "",
  "header_link": null,
  "subheader": "",
  "bodytext": [
    {
      "_type": "block",
      "_key": "k0",
      "style": "normal",
      "markDefs": [],
      "children": [
        {
          "_type": "span",
          "_key": "k1",
          "marks": [],
          "text": "The document belongs to its site. Kettenblatt allows the fallback type "
        },
        {
          "_type": "span",
          "_key": "k2",
          "marks": [
            "code"
          ],
          "text": "menu_subpages"
        },
        {
          "_type": "span",
          "_key": "k3",
          "marks": [],
          "text": ", so only its document has "
        },
        {
          "_type": "span",
          "_key": "k4",
          "marks": [
            "code"
          ],
          "text": "HeadlessContentFallbackRead"
        },
        {
          "_type": "span",
          "_key": "k5",
          "marks": [],
          "text": ", and its frontend needs types of its own:"
        }
      ]
    },
    {
      "_type": "block",
      "_key": "k6",
      "style": "normal",
      "markDefs": [],
      "children": [
        {
          "_type": "span",
          "_key": "k7",
          "marks": [
            "code"
          ],
          "text": "GET https://kettenblatt.example/_api/openapi.json"
        }
      ]
    }
  ],
  "layout": 0,
  "frame_class": "default",
  "space_before_class": "",
  "space_after_class": ""
}

Generated TypeScript type

type HeadlessContentTextRead = {
    "@type"?: string;
    "@id"?: string;
    uid?: number;
    CType: "text";
    header?: string;
    header_layout?: number;
    header_position?: string;
    header_link?: components["schemas"]["HeadlessLink"] | null;
    subheader?: string;
    bodytext?: components["schemas"]["PortableText"];
    layout?: number;
    frame_class?: string;
    space_before_class?: string;
    space_after_class?: string;
};