---
updatedAt: 2025-06-16T23:09:29.000Z
agentTools:
  projectIndex: https://developers.directscale.com/llms.txt
---

# Hosting with the C# Client Library

When the [Directscale Middleware is added](https://developers.directscale.com/docs/getting-started-with-the-c-sharp-library#add-directscale-middleware) to an ASP.NET Core web app project 4 endpoints are added to help with the operations of [Hosting A Client Web Application](https://developers.directscale.com/docs/writing-and-hosting-client-code).

<br />

# Middleware Endpoints

***

### `/hooks/GetRoutes`

> HTTP Verb: **Get**
>
> This will return a JSON body of all the endpoints that are configured in the setup options [configured in the Directscale middleware](https://developers.directscale.com/docs/getting-started-with-the-c-sharp-library#configuring-directscale-middleware).

<br />

### `/api/extension/services/RegistrationService/RemoveDeletedRegistrations`

> HTTP Verb: **Post**
>
> * This **deletes** any current configurations in Corp Admin that are not configured in the middleware.
> * This endpoint is secured. See [Authorizing Client Web Application APIs](https://developers.directscale.com/docs/authorizing-client-web-application-apis#extensionauthorize-attribute) for more information.

> 👍 This endpoint should be called during the process of deploying a new version. Call this endpoint on a new version of code before traffic is sent to the new version. This avoids errors by making sure any endpoints that no longer exist are not configured to be called.

<br />

### `/api/extension/services/RegistrationService/UpdateAllRegistrations`

> HTTP Verb: **Post**
>
> * This **adds** or **updates** configurations in Corp Admin that are new or updated configurations in the middleware.
> * This endpoint is secured. See [Authorizing Client Web Application APIs](https://developers.directscale.com/docs/authorizing-client-web-application-apis#extensionauthorize-attribute) for more information.

> 👍 This endpoint should be called during the process of deploying a new version. Call this endpoint on a new version of code after traffic is sent to the new version. This avoids errors by making sure any endpoints that did not exist until the new version was deployed were not configured to be called until it was deployed.

> ❗️ The endpoint UpdatesAllRegistrations by removing all configurations and registering only the endpoints [configured in the Directscale middleware](https://developers.directscale.com/docs/getting-started-with-the-c-sharp-library#configuring-directscale-middleware). Any manual changes to configurations will be reversed unless the configuration of the Directscale middleware is updated.

<br />

### `/api/extension/version`

> HTTP Verb: **Get**
>
> Returns the current version of the Extension

> 👍 This endpoint returns the Assembly Version of the ASP.NET Core web application. See how to set the Assembly Version with the [AssemblyVersionAttribute Class](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assemblyversionattribute)

<br />

# Auto-Configuration

***

Using the endpoints listed above makes updating the configurations in Corp Admin during a deployment easy. It can even be scripted as part of a deployment process.

> 👍 Using the Client Extension?
>
> The [Client Extension](https://developers.directscale.com/docs/what-is-the-client-extension) uses the */api/extension/services/RegistrationService/RemoveDeletedRegistrations* and */api/extension/services/RegistrationService/UpdateAllRegistrations* endpoints to automatically update configurations during a deployment. Learn more about [Deploying The Client Extension](https://developers.directscale.com/docs/deploying-a-build-version#deployment-steps)