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

# JsonField

## JsonField

JsonField describes a field with data\_type set to json, such as a JSON Rich Text Editor (JSON RTE). It derives from [TextboxField](/docs/developers/sdks/content-management-sdk/dot-net/reference/textboxfield) and adds the content types that the editor can embed entries from.

**When to Use This Class:** Use this class to add a JSON RTE field to a content type, or to read one from a fetched schema.

**Conceptual Role:** Acts as the Field subclass that the SDK creates for a field with data\_type set to json.

**Returns:** JsonField. A JSON field of a schema.

## Properties

JsonField inherits every property of [TextboxField](/docs/developers/sdks/content-management-sdk/dot-net/reference/textboxfield) and [Field](/docs/developers/sdks/content-management-sdk/dot-net/reference/field), and adds the property below.

Name

Type

Required

Default

Description

ReferenceTo

JsonElement?

No

null

UIDs of the content types whose entries the editor can embed. Serialized as reference\_to.

## Class-Level Notes

**JSON RTE settings.**

*   Set FieldMetadata.AllowJsonRte to true and FieldMetadata.RichTextType to an editor type such as advanced. The [Create content type with JSON RTE](/docs/developers/apis/content-management-api/content-types#create-content-type-with-json-rte) request of the Content Management API reference shows these settings. Set FieldMetadata.EmbedEntry to true to allow embedded entries.
*   ReferenceTo is a JsonElement. Create it with JsonSerializer.SerializeToElement(new\[\] { "author" }).

## Method Index

JsonField has no methods. Set its properties and add it to ContentModelling.Schema.

## Class-Level Snippet

The snippet below creates a content type with a JSON RTE field that can embed author entries.

```
using System;
using System.Collections.Generic;
using System.Text.Json;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Exceptions;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Fields;

ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");

ContentModelling model = new ContentModelling
{
    Title = "Blog Post",
    Uid = "blog_post",
    Schema = new List<Field>
    {
        new TextboxField { DisplayName = "Title", Uid = "title", DataType = "text", Mandatory = true, Unique = true },
        new JsonField
        {
            DisplayName = "Body",
            Uid = "body",
            DataType = "json",
            ReferenceTo = JsonSerializer.SerializeToElement(new[] { "author" }),
            FieldMetadata = new FieldMetadata { AllowJsonRte = true, RichTextType = "advanced", EmbedEntry = true }
        }
    }
};

try
{
    ContentstackResponse response = client.Stack("<API_KEY>").ContentType().Create(model);
    Console.WriteLine(response.OpenJsonObjectResponse()["notice"]);
}
catch (ContentstackErrorException e)
{
    // Thrown when the API rejects the request
    Console.WriteLine($"Request failed: {(int)e.StatusCode} {e.ErrorCode} {e.ErrorMessage}");
}
```

## JsonField | .NET Management SDK | Contentstack

JsonField in the .NET Management SDK describes a JSON field, such as a JSON Rich Text Editor, in a content type schema.