umbraco-openapi-client

Generate an authenticated TypeScript OpenAPI client for Umbraco backoffice APIs.

4|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/albanistrefi/umbraco_CLI --skill umbraco-openapi-client-albanistrefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: umbraco-openapi-client
Source: https://github.com/albanistrefi/umbraco_CLI/tree/main/skills/backend/umbraco-openapi-client
Command: npx skills add https://github.com/albanistrefi/umbraco_CLI --skill umbraco-openapi-client-albanistrefi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents 401 Unauthorized failures and brittle integrations by guiding you to call Umbraco backoffice APIs using a generated OpenAPI client that carries the proper bearer token authentication.

Core Features & Use Cases

  • Auth-safe backoffice communication: Avoids raw fetch calls and instead uses a generated client configured with Umbraco’s auth context.
  • Type-safe API calls: Generates TypeScript types and service methods from your Swagger/OpenAPI spec.
  • Repeatable generation workflow: Provides a Node generation script that fetches swagger.json and outputs a ready-to-use client.
  • Use Case: When building custom backoffice UI features like trees, workspaces, or screens that must load and mutate data from your own C# [BackOfficeRoute] endpoints.

Quick Start

Configure your entry point to consume UMB_AUTH_CONTEXT and set the generated client with baseUrl, credentials, and the token from getOpenApiConfiguration().

Frequently Asked Questions about umbraco-openapi-client

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent 401 Unauthorized errors when calling Umbraco backoffice APIs?

To prevent 401 Unauthorized errors when calling Umbraco backoffice APIs, generate a TypeScript OpenAPI client configured with Umbraco's UMB_AUTH_CONTEXT token-based authentication. This ensures your backoffice frontend code carries the proper bearer token for custom C# controller requests.

How do I generate a TypeScript client from swagger.json for Umbraco?

To generate a TypeScript client from swagger.json for Umbraco, use a Node generation script that fetches the Swagger specification and outputs type-safe service methods. You then configure this generated client with baseUrl, credentials, and the token from getOpenApiConfiguration().

Why do I need an OpenAPI client for custom Umbraco backoffice UI features?

You need an OpenAPI client for custom Umbraco backoffice UI features to achieve type-safe API calls when loading and mutating data. It replaces brittle raw fetch calls with generated TypeScript types and service methods for your custom C# [BackOfficeRoute] endpoints.

Can I use raw fetch calls instead of a generated OpenAPI client in Umbraco?

Using raw fetch calls instead of a generated OpenAPI client in Umbraco leads to brittle integrations and potential authentication failures. Generating an auth-safe OpenAPI TS client ensures proper bearer token configuration via UMB_AUTH_CONTEXT and provides type-safe access to your endpoints.

Does the generated Umbraco OpenAPI client support token-based authentication?

Yes, the generated Umbraco OpenAPI client supports token-based authentication by consuming the UMB_AUTH_CONTEXT. You configure the client entry point with baseUrl, credentials, and the authentication token obtained through Umbraco's getOpenApiConfiguration() settings.