---
title: "Endpoint"
description: "Endpoint"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/dot-net/reference/endpoint"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-11-22"
---

# Endpoint

## Endpoint

Endpoint looks up the host of each Contentstack service for a region, in the Contentstack.Management.Core.Endpoints namespace.

**When to Use This Class:** Use this class to find the Content Management API (CMA) host of a region by its name, such as eu or azure-na. Pass the host to the Host option of the client.

**Conceptual Role:** Acts as a static lookup helper. It is not connected to ContentstackClient: the client never calls it and has no region option, so you pass the host yourself.

**Returns:** Endpoint. A static class with no instances.

## Class-Level Notes

**Where the region list comes from.**

*   The first lookup in a process reads Assets/regions.json from the folder of the SDK assembly. The SDK package does not include this file, so the first lookup downloads it from https://artifacts.contentstack.com/regions.json and tries to save it to that folder.
*   Later lookups in the same process read the list from memory. Call [ResetCache](/docs/developers/sdks/content-management-sdk/dot-net/reference/endpoint#endpoint-resetcache) to read it again.
*   The download blocks the calling thread for up to 30 seconds. Without network access and without a saved file, every lookup throws InvalidOperationException.

**Region names.**

A region matches its ID or one of its aliases, without regard to case or surrounding spaces, for example na, us, eu, aws-na, azure-na, azure\_eu, and gcp-na. An ID match wins over an alias match. Service keys include contentManagement, contentDelivery, auth, graphqlDelivery, preview, images, assets, automate, launch, developerHub, brandKit, genAI, personalizeManagement, personalizeEdge, composableStudio, and assetManagement. The region list decides which keys each region has.

## Method Index

Method Name

Returns

Description

[GetContentstackEndpoint](/docs/developers/sdks/content-management-sdk/dot-net/reference/endpoint#endpoint-getcontentstackendpoint)

The service URL, or every service URL of the region.

Looks up the hosts of a region.

[ResetCache](/docs/developers/sdks/content-management-sdk/dot-net/reference/endpoint#endpoint-resetcache)

This method returns nothing.

Clears the region list held in memory.

## Class-Level Snippet

This snippet looks up the CMA host of the EU region and creates a client for it.

```
using System;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Endpoints;
using Contentstack.Management.Core.Exceptions;

string host = Endpoint.GetContentstackEndpoint("eu", "contentManagement", omitHttps: true);

ContentstackClient client = new ContentstackClient(new ContentstackClientOptions() { Authtoken = "<AUTHTOKEN>", Host = host });

try
{
    ContentstackResponse response = client.GetUser();
    Console.WriteLine(response.OpenJsonObjectResponse().ToJsonString());
}
catch (ContentstackErrorException e)
{
    Console.WriteLine($"Request failed: {(int)e.StatusCode} {e.ErrorCode} {e.ErrorMessage}");
}
```

## Methods

Each method of the Endpoint class has its own section below, with its parameters, validation rules, behavior, and examples.

## GetContentstackEndpoint

GetContentstackEndpoint returns the URL of one Contentstack service in a region, or the URLs of every service in the region.

```
Returns: string. The service URL, or every service URL of the region.
OverloadsGetContentstackEndpoint(string region, string service, bool omitHttps = false)GetContentstackEndpoint(string region, bool omitHttps = false)ValidationThrows ArgumentException (parameter region) if region is null, empty, or blank.Throws KeyNotFoundException if no region has that ID or alias, or if the region has no service key.Throws InvalidOperationException if the SDK cannot read or download the region list, or the list is not valid JSON.BehaviorStatic and client-side apart from the one-time download of the region list. See the Endpoint class page.Matches region without regard to case. Matches service exactly, so ContentManagement finds nothing.The overload with service returns one string. The overload without it returns a Dictionary<string, string> of every service URL, keyed by service key.Use omitHttps: true for a value to put in ContentstackClientOptions.Host.ExampleBasic usage: the Content Management API (CMA) host of a regionusing System;
using System.Collections.Generic;
using Contentstack.Management.Core.Endpoints;

try
{
    string url = Endpoint.GetContentstackEndpoint("eu", "contentManagement");
    Console.WriteLine(url);
}
catch (KeyNotFoundException e)
{
    // Thrown when the region or the service key is unknown
    Console.WriteLine(e.Message);
}
catch (InvalidOperationException e)
{
    // Thrown when the region list cannot be read or downloaded
    Console.WriteLine(e.Message);
}All parameters: every host of a region, without the schemeusing System;
using System.Collections.Generic;
using Contentstack.Management.Core.Endpoints;

Dictionary<string, string> hosts = Endpoint.GetContentstackEndpoint("azure-na", omitHttps: true);

foreach (KeyValuePair<string, string> host in hosts)
{
    Console.WriteLine($"{host.Key}: {host.Value}");
}

string cmaHost = Endpoint.GetContentstackEndpoint("azure-na", "contentManagement", omitHttps: true);
Console.WriteLine(cmaHost);
```

Region ID or alias, such as eu.

Service key, such as contentManagement. Case-sensitive.

Removes the https:// prefix from the result.

Removes the https:// prefix from every URL.

## ResetCache

ResetCache clears the region list that Endpoint holds in memory, so the next lookup reads it again.

This method takes no parameters.

```
Returns: void. This method returns nothing.
ValidationThere is no client-side validation, and ResetCache never throws.BehaviorClient-side only. ResetCache sends no request.The next GetContentstackEndpoint call reads Assets/regions.json from disk, or downloads the list when the file is missing.ResetCache does not delete the saved file. Delete it yourself to force a fresh download.ExampleBasic usage: read the region list againusing System;
using Contentstack.Management.Core.Endpoints;

Endpoint.ResetCache();
Console.WriteLine(Endpoint.GetContentstackEndpoint("na", "contentManagement"));
```

## Endpoint | .NET Management SDK | Contentstack

The Endpoint class in the .NET Management SDK looks up the Contentstack service hosts of a region, such as the Content Management API host for the EU region.