This walks you through setting up an OpenAPI client for Umbraco backoffice custom APIs, which is apparently required because raw fetch calls will just get you 401 errors. The setup involves four pieces: a C# composer to expose your API via Swagger, npm dependencies for @hey-api/openapi-ts, a generation script that pulls swagger.json and creates TypeScript types, and critically, configuring the client with Umbraco's auth context in your entry point so it includes the bearer token. The guide is thorough with complete code examples for each step, including the common mistakes section showing why fetch won't work. If you're building custom trees, workspaces, or anything that needs to talk to your own Umbraco backend routes, this is the authentication pattern you need.

skills.sh installs
405
GitHub stars
27
last updated
Aug 21, 2026

Install

$ npx -y skills add umbraco/umbraco-cms-backoffice-skills --skill umbraco-openapi-client --agent claude-code

Installs into .claude/skills of the current project.

Files

Umbraco OpenAPI Client Setup

CRITICAL: Why This Matters

NEVER use raw fetch() calls for Umbraco backoffice API communication. Raw fetch calls will result in 401 Unauthorized errors because they don't include the bearer token authentication that Umbraco requires.

ALWAYS use a generated OpenAPI client configured with Umbraco's auth context. This ensures:

  • Proper bearer token authentication
  • Type-safe API calls
  • Automatic token refresh handling

When to Use This

Use this pattern whenever you:

  • Create custom C# API controllers with [BackOfficeRoute]
  • Need to call your custom APIs from the backoffice frontend
  • Build trees, workspaces, or any UI that loads data from custom endpoints

Setup Overview

The setup has 4 parts:

  1. C# Backend: Controller with Swagger/OpenAPI documentation
  2. Client Dependencies: @hey-api/openapi-ts (the @hey-api/client-fetch plugin is bundled with it)
  3. Generation Script: Fetches swagger.json and generates TypeScript client
  4. Entry Point Configuration: Configures client with Umbraco auth

Step-by-Step Implementation

1. C# Backend Setup (Swagger/OpenAPI)

Sponsors

Details

Repository
github.com/umbraco/umbraco-cms-backoffice-skills
Categories
Backend & APIs, .NET & C#
First seen
Jun 3, 2026

More from umbraco/umbraco-cms-backoffice-skills

All 76
1vercel avatarvercel-microfrontendsvercel/microfrontendsGuide for building, configuring, and deploying microfrontends on Vercel. Use this skill when the user mentions microfrontends, multi-zones, splitting an app acr403skills.sh installs
2codex-data avatarcodex-supergraphcodex-data/skillsUse when the user asks about token prices, charts, holders, trending tokens, pair data, prediction markets, or any on-chain analytics from Codex. Also use when 401skills.sh installs
3secondsky avatarnuxt-coresecondsky/claude-skills| Nuxt 4 core framework fundamentals: project setup, configuration, routing, SEO, error handling, and directory structure. Use when: creating new Nuxt 4 project401skills.sh installs
4merit-systems avatarphone-callsmerit-systems/agentcash-skillsMake AI phone calls, buy phone numbers, and get call transcripts via x402. USE FOR: - Making AI-powered outbound phone calls - Scheduling calls and getting tran400skills.sh installs
5syncfusion avatarsyncfusion-blazor-datamanagersyncfusion/blazor-ui-components-skillsImplements Syncfusion Blazor SfDataManager for data access, data binding, and adaptor configuration in Blazor Server, WebAssembly, and Web App. Used when bindin395skills.sh installs
6denoland avatardeno-deploydenoland/skillsUse when deploying Deno apps to production, asking about Deno Deploy, or working with `deno deploy` CLI commands. Covers deployment workflows, environment varia390skills.sh installs