Skip to content
Margin

Configure your site with docs.json

Look up configuration fields, their Margin compatibility status, and Margin-specific extensions.

Place docs.json at the root of your documentation folder to override Margin’s derived configuration. The file is optional, and every top-level field is optional. Margin also accepts legacy mint.json; when both files exist, docs.json wins.

Read field definitions and compatibility status

Compatibility describes the field’s effect, not just whether the JSON parses.

StatusMeaning
SupportedMargin implements the setting’s documented behavior.
AdaptedMargin maps the setting to its own renderer or layout. The definition names differences.
IgnoredMargin accepts the setting but does not apply it. Unsupported settings produce diagnostics rather than failing publication.

Types below describe authored JSON. A default is the behavior when a field is omitted, not a value you must copy into the file. Nested fields are optional unless marked required. string[] means an array of strings; a light/dark pair means an object with both light and dark strings.

Omitting colors, logo, or favicon permits derivation or detection. Setting those fields to null explicitly disables that behavior. x-margin.css: null disables stylesheet injection. Do not assume other fields accept null.

This valid configuration sets only a site name; Margin derives the remaining settings from your documentation folder:

docs.json
{
  "name": "Acme Docs"
}

Unknown top-level fields and unknown direct children of x-margin produce unknown_field diagnostics. Malformed known fields produce field_invalid diagnostics and fall back to defaults; recovery may discard the containing top-level field. Invalid JSON fails the build.

To check JSON syntax locally, run this command from the documentation folder. No output and exit status 0 mean the file parses; this does not validate Margin compatibility:

Check JSON syntax
python3 -m json.tool "docs.json" > /dev/null

Set site identity

$schemastring

Ignored at runtime. Supplies an editor schema URL, for example "https://mintlify.com/docs.json". Configuring the URL does not change Margin’s accepted fields. The markdown.schema setting can expose this URL to agents.

namestring

Supported. Must be non-empty. Sets the site title used by documentation chrome and metadata. Example: "Acme Docs". Without an override, Margin derives a site name; a self-hosted SITE_NAME overrides the configured name.

descriptionstring

Supported. Site-level fallback for page descriptions and social metadata. Defaults to a derived page description or excerpt. Example: "Build applications with Acme.".

logostring | object | null

Supported. A string supplies the image for both modes. The object requires light and dark asset paths and accepts an optional absolute URL in href for the click target. Example: {"light":"/logo-light.svg","dark":"/logo-dark.svg","href":"https://example.com"}. Omission permits logo detection; null selects a text-only navbar.

faviconstring | object | null

Supported. A string supplies one icon, or use {"light":"/favicon-light.svg","dark":"/favicon-dark.svg"}. Defaults to a detected or generated favicon. null suppresses the favicon link.

Configure appearance and layout

themestring

Adapted. Selects a Margin-owned layout and palette that approximate the Mintlify theme rather than reproduce its layout exactly. Without a theme, Margin uses its neutral layout.

ValueMargin layoutPalette
mintneutralneutral
lindenneutralneutral
maplewarmruby
almondwarmsolar
palmverdantemerald
willowverdantocean
aspenaspenaspen
sequoiaduskdusk
lumacontrastblack
colorsobject | null

Supported. primary, light, and dark are hex color strings. Example: {"primary":"#2563EB","light":"#60A5FA","dark":"#1D4ED8"}. Defaults to derived theme tokens, with an optional detected logo accent. null forces neutral colors and disables logo-accent derivation.

appearanceobject

Adapted. default accepts system, light, or dark and defaults to system. strict: true disables the reader’s theme switch and pins an explicit light or dark default; system continues to follow the system theme. Example: {"default":"dark","strict":true}.

backgroundobject

Adapted. No background override by default. color accepts a hex string or a light/dark pair of hex strings. image accepts an asset path or a light/dark pair of paths. decoration accepts gradient, grid, or windows, rendered with Margin-owned styling. Example: {"decoration":"grid"}.

fontsobject

Adapted. Configure one face using family (string), weight (number), source (font asset path), and format (woff or woff2). Alternatively, set heading, body, or mono objects with those same fields. Self-hosted sources produce font-face declarations; supported Google Fonts families use the font service. The bundled text defaults are Inter and Geist Mono. Example: {"body":{"family":"Acme Sans","source":"/fonts/acme.woff2","format":"woff2","weight":400}}.

icons.librarystring

Adapted. Accepts lucide, fontawesome, or tabler; the configuration default is lucide. Alternate libraries use best-effort name matching, and missing icons fall back with a diagnostic. Example: "tabler".

stylingobject

Set individual rendering controls:

FieldTypeStatusDefault and effect
eyebrowsstringAdaptedsection; use breadcrumbs for the full trail.
latexbooleanSupportedfalse; true compiles math with KaTeX.
codeblocksstring or objectSupportedFramework highlighting defaults; a mode string such as system follows the display mode.
codeblocks.themestring or light/dark pairSupportedShiki theme selection, for example {"light":"github-light","dark":"github-dark"}.
codeblocks.languagesstring[] or objectSupportedCustom TextMate grammar paths; object form is {"custom":["/grammars/acme.json"]}.
navbarobject

Supported. links is an array of link objects with required href and optional label or name. primary requires href and accepts optional type and label strings; use type: "button" for a labeled action or type: "github" for a GitHub target. Example: {"links":[{"label":"Support","href":"mailto:[email protected]"}]}. With no authored links, Margin can derive a GitHub link from the repository. Placement follows the selected chrome layout; sidebar layouts place links above the page tree. Invalid links are dropped independently.

footerobject

Supported. socials maps platform names to URLs. links is an array of columns, each with required header and items; each item requires label and href. Example: {"socials":{"github":"https://github.com/acme"},"links":[{"header":"Company","items":[{"label":"Home","href":"https://example.com"}]}]}. No footer links by default. Invalid items are dropped without discarding valid siblings.

bannerobject

Supported. Requires a non-empty content string with basic inline MDX. Optional fields are type (info, warning, or critical), dismissible (boolean), and color (hex string or light/dark pair). Example: {"content":"Version 2 is available.","type":"info","dismissible":true}. No banner by default. contentHast is generated by Margin and cannot be authored.

Configure navigation

A non-empty navigation object replaces filesystem and meta.json navigation structure. Pages omitted from navigation remain reachable by URL. A page’s hidden: true frontmatter still hides it even when listed. Navigation settings do not provide access control.

navigationobject

Supported. Accepts the container fields below. Omission uses filesystem-derived navigation. Example: {"groups":[{"group":"Start","pages":["index","quickstart"]}]}. Page strings name documentation paths without .md or .mdx extensions.

FieldEntry shape and status
pagesSupported. Array of page strings, {href} link objects, or nested group objects.
groupsSupported. Array of objects with required group string; pages defaults to [].
tabsSupported. Array of objects with required tab string. External href produces a link.
anchorsAdapted. Array of objects with required anchor string; grouped anchors become root folders, and link-only anchors become links.
dropdownsSupported. Array of objects with required dropdown string; nested content forms a menu, while href alone forms a link.
versionsSupported. Array of objects with required version string; controls product-version navigation.
languagesSupported. Array of objects with required language string; the default language uses unprefixed paths, and others use locale prefixes.
productsAdapted. Array of objects with required product string; optional name, description, and content. Link products remain links; container products become menus.
menuSupported. Array of objects with required item string; each item can contain navigation children.
globalSupported. Object containing languages, versions, tabs, dropdowns, anchors, or products shown across sections.

Container children are recursive, but the accepted child set depends on the node type:

NodeChild fields
Grouppages
Tablanguages, versions, tabs, dropdowns, menu, groups, pages, global
Anchorlanguages, versions, tabs, dropdowns, groups, pages
Dropdownlanguages, versions, tabs, anchors, products, groups, pages
Versionlanguages, tabs, groups, pages, global
Languageversions, tabs, groups, pages, global
Productlanguages, versions, tabs, anchors, groups, pages, menu, global
Menu itemgroups, pages, tabs, dropdowns, anchors, products, versions, languages, global
navigation node modifiersobject

Modifiers belong on a node, not beside navigation. Use only modifiers appropriate to that node:

ModifierType and placementStatus and effect
hrefstring; link-capable containersSupported. Link destination.
iconstring; groups, tabs, anchors, dropdowns, products, menu itemsSupported. Icon name.
hiddenboolean; containersSupported. Hides the node from navigation without removing its URL.
searchableboolean; groups and tabsSupported. Controls search inclusion.
rootstring; groupsSupported. Root-folder target.
expandedboolean; groupsSupported. Initial folder expansion.
tagstring; groups and versionsSupported. Group label or version badge.
defaultboolean; versions and languagesSupported. Marks the default selection.
directorystring; containersAdapted. Directory presentation or placement; group presentation accepts accordion or card.
colorhex string or light/dark pair; anchors, dropdowns, productsAdapted. Element color.
descriptionstring; dropdowns, products, menu itemsSupported. Menu description.
boostnumber; groupsIgnored. Margin’s search backend controls ranking.
publicboolean; groupsIgnored for access control. All documentation remains public.
alignstart or end; tabsAdapted. Per-tab end alignment is ignored.
navigation source fieldsobject

openapi is supported on groups, tabs, anchors, versions, languages, products, and menu items. Supply a source string, or {"source":"openapi.yaml","directory":"reference"}. Under an OpenAPI-bearing node, a page string such as "GET /users" resolves to the generated operation page. Generated API pages not referenced by explicit navigation remain URL-reachable but hidden, with an openapi_orphaned diagnostic.

asyncapi and graphql navigation sources are ignored and diagnosed. sdk is adapted for local TypeDoc JSON artifacts using {"format":"typedoc","source":"reference.json","directory":"sdk"}. TypeDoc generation accepts at most 500 pages and a 30 MB artifact. Formats docfx, javadoc, sphinx, and phpdoc, and remote SDK artifact sources, do not generate pages.

navigation.$refstring

Supported when the entire referenced node is {"$ref":"./navigation.json"}. References resolve JSON files inside the documentation snapshot, including nested references. The same form works for redirects. Circular, missing, invalid, or out-of-root references are dropped with a diagnostic. Expansion limits are 8 nesting levels, 32 expansions, and a 2 MiB total reference budget.

Configure API documentation

API settings configure generated OpenAPI documentation. They do not turn a manual MDX page into an API console.

api.openapistring | object | array

Supported. Registers OpenAPI sources instead of relying on convention discovery. Example: "openapi.yaml", an array of source strings, or {"source":"openapi.yaml","directory":"reference"}. Navigation source fields determine placement when explicit navigation is present.

openapiarray

Supported legacy registration form. Each entry is a source string or an object with required id and spec, plus optional label and path. Example: [{"id":"public","spec":"openapi.yaml","label":"Public API","path":"reference"}]. label defaults to API Reference; path defaults to api-reference. IDs contain lowercase letters, digits, and hyphens, start with a letter or digit, and are at most 64 characters. Do not register the same specification twice.

api.playgroundobject

Adapted. Controls the request playground:

FieldTypeDefaultBehavior
displayinteractive, simple, none, or authinteractiveauth behaves as none; documentation visitors have no authentication state.
proxybooleantrueRoutes requests through /api/proxy, restricted to specification servers.
credentialsbooleanfalseSends browser credentials only with proxy: false; has no effect through the proxy.
api.paramsobject

Adapted. expanded accepts all or closed to control parameter section expansion. Example: {"expanded":"all"}. post accepts a string array but is ignored with an unsupported_field diagnostic; parameter pills are not implemented.

api.examplesobject

Adapted. languages is an array of sample-language identifiers. defaults accepts required or all (default all); autogenerate is boolean (default true). Example: {"defaults":"required","autogenerate":true}. The playground always prefills from the selected example. Authored prefill: false is unsupported and produces a diagnostic.

api.urlstring

Adapted. "full" shows the request URL using OpenAPI server precedence: operation, then path item, then root. Server variables use declared defaults. Relative servers remain relative; Margin does not invent an origin.

api.asyncapi / api.mdxobject or source value

Ignored with unsupported_field diagnostics. AsyncAPI does not generate reference pages. api.mdx server and authentication settings do not create consoles for manual API pages.

Configure metadata and integrations

seoobject

Supported, except the authored organization ID described below.

FieldTypeDefault and behavior
indexingnavigable or allnavigable; controls sitemap inclusion and page indexing directives.
trailingSlashbooleanfalse; true adds a trailing slash to canonical URLs.
metatagsstring-to-string mapNo additional tags. Example: {"robots":"noarchive"}. Executable markup is rejected; canonical is ignored because each page emits its own canonical URL.
organizationobjectStructured publisher identity. Optional name and legalName are non-empty strings up to 255 characters; url is a public HTTP(S) URL; logo is a safe relative asset or public HTTP(S) URL; sameAs is an array of public HTTP(S) URLs.
organization.idstringIgnored. Margin creates its own origin-bound structured-data ID.

An authored seo.organization identity takes precedence over x-margin.seo.publisher.

thumbnailsobject

Adapted. Site-wide social-card defaults. appearance selects the card appearance, with a fallback derived from the background or site appearance. image is an image-asset string; invalid image URLs fall back to generated cards. background is a background-image path string, and fonts.family is a font-family string for generated card assets; font families resolve at ingest, and failed asset resolution falls back with a diagnostic. The default generated-card font is Geist Sans.

integrationsobject

Supported for the providers below. Omission loads no provider. Each entry supplies data to a Margin-owned loader, not arbitrary JavaScript.

ProviderFieldsRestrictions or defaults
ga4measurementId: stringStarts with G.
posthogapiKey: string; optional apiHost: stringKey starts with phc_. Only official cloud origins are accepted: https://us.i.posthog.com, https://eu.i.posthog.com, https://us.posthog.com, https://eu.posthog.com. Paths, queries, and fragments are not accepted.
plausibledomain: stringserver is ignored; custom script origins are not permitted.
fathomsiteId: stringExample shape: {"siteId":"SITE_ID"}.
clarityprojectId: stringExample shape: {"projectId":"PROJECT_ID"}.
amplitudeapiKey: non-empty stringProvider key only.
mixpanelprojectToken: non-empty string; optional regionRegion accepts us, eu, or in; default us.
segmentkey: non-empty stringProvider key only.
hotjarhjid: string or number; optional hjsv: string or numberSite ID must be numeric; script version defaults to 6.
intercomappId: non-empty stringProvider ID only.

gtm accepts a tagId string but is ignored because containers can execute custom scripts. Unknown providers, arbitrary script loaders, Plausible custom servers, and non-official PostHog hosts are ignored with integration_unsupported diagnostics. A deployment can suppress configured analytics.

Configure site behavior

publicboolean

Ignored with an unsupported_field diagnostic. All served documentation is public; false does not protect a page or site.

search.promptstring

Supported. Changes search placeholder text, for example "Search Acme docs". Select the search backend separately with x-margin.search.mode.

redirectsarray | reference object

Supported. Each rule requires source and destination strings; optional permanent defaults to true (HTTP 308). false selects HTTP 307. Example: [{"source":"/old-guide","destination":"/quickstart"}]. A standalone {"$ref":"./redirects.json"} can load the array.

Sources support exact paths, :param, :param*, *, and prefix-*. Sources cannot include queries or fragments. Destinations can include queries or fragments and substitute only captured tokens. HTTP(S) external destinations are supported. Invalid rules, loops, missing internal destinations, and rules that shadow published pages are dropped with diagnostics. Exact matches take precedence over patterns; patterns use declaration order.

contextualobject

Adapted. Configures the page action menu. display accepts header (default) or toc. options is an ordered array of option IDs or custom objects. Default IDs are copy, view, chatgpt, claude, cursor, and t3. Other IDs are perplexity, grok, aistudio, devin, windsurf, devin-desktop, devin-mcp, download-spec, download-pdf, github, mcp, add-mcp, and vscode. Downloads and GitHub actions require the corresponding page resource. An empty array removes the menu; unknown IDs are not rendered.

Custom objects require a non-empty title and href; optional string fields are description, icon, and src (image icon). href is a URL-template string or {base,query:[{key,value}]}. Templates substitute $page with encoded page Markdown, $path with the page path, and $mcp with the MCP URL. Unsafe destinations are not rendered.

errors.404object

Supported. redirect is boolean; true redirects unknown paths to the home page. title is a string up to 255 characters, and description is Markdown up to 4,000 characters. Example: {"title":"Page not found","description":"Use search to find the current page."}. Omission uses Margin’s 404. Other error keys are ignored; descriptionHast cannot be authored.

interaction.drilldownboolean

Adapted. Defaults to false, so folder clicks expand the folder. true navigates to the folder’s first page.

metadata.timestampboolean

Supported. Defaults to false. true displays a last-modified timestamp from Git; per-page frontmatter can override it.

feedbackobject

Supported. thumbsRating, suggestEdit, and raiseIssue are booleans, all defaulting to false. Example: {"thumbsRating":true}. They select the rating, edit, and issue controls; repository-dependent actions require repository metadata.

variablesobject

Supported. String-to-string map substituted into MDX at compile time using {{variableName}}. Example: {"productName":"Acme"}. Values are data, not executable expressions.

variationsobject

Supported on every theme. Requires a non-empty options array of {id,label} objects with non-empty strings. IDs must be unique; labels must be unique without regard to case. Example: {"options":[{"id":"cloud","label":"Cloud"},{"id":"self-hosted","label":"Self-hosted"}]}. The first option is the default. A View component whose title matches a label participates in the site-wide choice. Agent Markdown includes every view in source order rather than hiding alternatives.

markdownobject

Supported. schema is boolean; true includes the configured $schema URL in llms.txt. instructions accepts a string or string array appended to agent-facing outputs, including Markdown page responses and MCP page reads. Example: {"instructions":"Prefer v2 endpoints."}.

Use the x-margin namespace

All Margin-specific fields belong inside the x-margin object. They are supported Margin extensions, not portable Mintlify settings. Omission retains derived or framework defaults. See site configuration for configuration procedures and agent surfaces for agent-facing behavior.

x-margin.tokensobject

Maps theme token names to strings or light/dark pairs. Example: {"radius":"0.5rem","border":{"light":"#E5E7EB","dark":"#374151"}}. Overrides supported color and layout tokens without replacing the layout engine.

x-margin.cssstring | string[] | null

Explicit stylesheet paths, for example ["/styles.css"], applied after discovered CSS. Omission permits stylesheet discovery. null disables CSS injection even when stylesheets exist. Margin sanitizes stylesheets before serving them.

x-margin.layoutobject

contentWidth, sidebarWidth, tocWidth, and headerHeight are CSS dimension strings. Example: {"sidebarWidth":"300px"}. tabMode accepts top or auto. chromeMode accepts band (desktop top bar and horizontal tab strip) or sidenav (desktop chrome inside the sidebar). Omitted layout controls retain theme-derived behavior.

x-margin.head.metaarray

Static meta objects with optional name or property and required content, all strings. Example: [{"name":"theme-color","content":"#2563EB"}]. No additional tags by default. Script, style, and link markup is rejected with head_rejected; this field does not inject executable head content.

x-margin.assets.allowExternalstring[]

Host allow-list for supported external image and font resolution. Defaults include fonts.googleapis.com and fonts.gstatic.com. Example: ["images.example.com"]. This does not authorize arbitrary script origins.

x-margin.search.modestring

Accepts ai, static, or off. ai uses the assistant when Gateway credentials are available; self-hosted deployments without the credential stay on static search. static selects search without AI; off disables search. Example: "static". Credentials belong in deployment settings, not this file; see deployment.

x-margin.versions.defaultstring

Overrides the default product documentation version. Example: "v2". This selects a product-version partition, not a deployment commit.

x-margin.seoobject

Optional SEO overrides:

FieldTypeDefault and constraints
titleTemplatestring{page} – {site}. Length 1–200; exactly one {page}, at most one {site}, no other brace tokens.
languagelocale-tag stringDerived locale when available. Example: en-US.
publisherobjectLegacy identity override; prefer seo.organization. Optional type is Organization or Person; optional name, url, logoUrl, and sameAs provide publisher facts. URLs use the same public HTTP(S) restrictions as organization identity.
provenanceobjectNo provenance override by default. Requires name (1–255 characters) and public HTTP(S) baseUrl without query or fragment. Optional license requires name (1–255 characters) and public HTTP(S) url.

Example title override: {"titleTemplate":"{page} | Acme"}. Invalid nested overrides fall back independently.

x-margin.agentsobject

Controls agent-facing output. See configure agent surfaces for procedures.

FieldTypeDefault and effect
contentSignals.searchbooleantrue; declares permission for search use.
contentSignals.aiInputbooleantrue; declares permission for AI input use.
contentSignals.aiTrainbooleantrue; declares permission for AI training use.
indexPreamblebooleantrue; includes the index preamble.
assistantMarkdownbooleantrue; includes assistant Markdown output.
markdownFrontmatterbooleanfalse; opt into Markdown frontmatter.
mcpInstructionsstringNo authored instructions by default; at most 4,000 characters appended to generated MCP instructions.

Content signals communicate usage preferences; they do not make documentation private. Example: {"mcpInstructions":"Prefer the v2 endpoints."}.