---
title: "ContentstackClient"
description: "ContentstackClient"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/dot-net/reference/contentstackclient"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-23"
---

# ContentstackClient

## ContentstackClient

Contentstack Client for interacting with Contentstack Management API.

## ContentstackClient

Initializes new instance of the Contentstack.Management.Core.ContentstackClient class.

```
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;

var options = new ContentstackClientOptions()
{
      Host = "<API_HOST>",
      Authtoken = "<AUTHTOKEN>"
}
ContentstackClient client = new ContentstackClient(options);
```

Contentstack configuration options.

```
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;

var options = new ContentstackClientOptions()
{
      Host = "<API_HOST>",
      Authtoken = "<AUTHTOKEN>"
}
ContentstackClient client = new ContentstackClient(new OptionsWrapper<ContentstackClientOptions>
(options));
```

Contentstack configuration options.

```
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;

ContentstackClient client = new ContentstackClient("AUTHTOKEN");
```

The optional Authtoken for making CMA call

The optional host name for the API.

The optional port for the API

The optional version for the API

The optional to disable or enable logs.

The optional maximum number of bytes to buffer when reading the response content

The optional timespan to wait before the request times out.

The optional retry condition for retrying on error.

Host to use with a proxy.

Port to use with a proxy.

Credentials to use with a proxy.

Optional array of header strings for early access features.

## GetUser

The Get user call returns comprehensive information of an existing user account.

```
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;

ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.GetUser();
```

Query parameter collection.

## GetUserAsync

The Get user call returns comprehensive information of an existing user account.

```
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;

ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.GetUserAsync();
```

Query parameter collection.

## Login

The Log in to your account request is used to sign in to your Contentstack account and obtain the authtoken. Refer to the [TOTP Support for .NET Management SDK](https://www.contentstack.com/docs/developers/sdks/content-management-sdk/dot-net/implement-totp-with-dot-net-management-sdk#login) for more information.

```
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient();

NetworkCredential credentials = new NetworkCredential("<EMAIL>", "<PASSWORD>");

// Login when MFA is not enabled for the user 
ContentstackResponse contentstackResponse = client.Login(credentials);

// Login when MFA is enabled: use a valid TOTP token generated from an authenticator app
string tfa_token = "<my_tfa_token>";
contentstackResponse = client.Login(credentials, token = tfa_token);

// Login using the MFA secret: SDK will generate the TOTP token dynamically
string mfa_secret = "<my_mfa_secret>";
contentstackResponse = client.Login(credentials, mfaSecret = mfa_secret);
```

User credentials used to authenticate the login request.

TOTP token generated from an authenticator app. Required for MFA-enabled users.

Secret key generated when the user enables MFA in Contentstack. Used to dynamically create a TOTP token.

## LoginAsync

The Log in to your account request is used to sign in to your Contentstack account and obtain the authtoken. Refer to the [TOTP Support for .NET Management SDK](https://www.contentstack.com/docs/developers/sdks/content-management-sdk/dot-net/implement-totp-with-dot-net-management-sdk#loginasync) for more information.

```
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient();

NetworkCredential credentials = new NetworkCredential("<EMAIL>", "<PASSWORD>");

// Login when MFA is not enabled for the user
ContentstackResponse contentstackResponse = await client.Login(credentials);

// Login when MFA is enabled: use a valid TOTP token generated from an authenticator app
string tfa_token = "<my_tfa_token>";
contentstackResponse = await client.Login(credentials, token = tfa_token);

// Login using the MFA secret: SDK will generate the TOTP token dynamically
string mfa_secret = "<my_mfa_secret>";
contentstackResponse = await client.Login(credentials, mfaSecret = mfa_secret);
```

User credentials used to authenticate the login request.

TOTP token generated from an authenticator app. Required for MFA-enabled users.

Secret key generated when the user enables MFA in Contentstack. Used to dynamically create a TOTP token.

## Logout

The Log out of your account call is used to sign out the user of Contentstack account

```
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;

ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Logout();
```

The optional auth token in case the user wants to logout.

## LogoutAsync

The Log out of your account call is used to sign out the user of Contentstack account

```
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;

ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.LogoutAsync();
```

The optional authroken in case user want to logout.

## Organization

Organization the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources, and users. Organization allows easy management of projects as well as users within the Organization.

```
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;

ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Organization organization = client.Organization();
```

Organization uid for specific org.

## Stack

Stack is a space that stores the content of a project (a web or mobile property). Within a stack, you can create content structures, content entries, users, etc. related to the project.

```
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;

ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack Stack = client.Stack("<API_KEY>");
```

Stack API Key.

Stack Management token

Branch uid for querying specific branch of stack.

## User

User session consists of calls that will help you to update user of your Contentstack account.

```
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;

ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
User user = client.User();
```

Get and Set method for de-serialization.

## ContentstackClient | .NET Management SDK | Contentstack

ContentstackClient is the client used for interacting with the Contentstack Management API.