
Umbraco Openapi Client
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-codeInstalls 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:
- C# Backend: Controller with Swagger/OpenAPI documentation
- Client Dependencies:
@hey-api/openapi-ts(the@hey-api/client-fetchplugin is bundled with it) - Generation Script: Fetches swagger.json and generates TypeScript client
- 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- Umbraco Property Editor Ui405
- Umbraco Extension Registry403
- Umbraco Notifications403
- Umbraco Add Extension Reference402
- Umbraco Context Api402
- Umbraco Routing401
- Umbraco Entity Create Option Action400
- Umbraco Menu Items400
- Umbraco Mfa Login Provider400
- Umbraco Repository Pattern400
- Umbraco Auth Provider399
- Umbraco Dynamic Root399
- Umbraco Collection View398
- Umbraco Entity Bulk Actions398
- Umbraco Localization398
- Umbraco Modals398
- Umbraco Entry Point397
- Umbraco Granular User Permissions397
- Umbraco Header Apps397
- Umbraco Health Check397
- Umbraco Icons397
- Umbraco Package View397
- Umbraco Property Action397
- Umbraco Property Editor Schema397