Skip to content
Get an API key

Create a syntax-highlighted code block from a snippet of source code.

Updated 16 Sep 20261 min read

Send "type": "code_block".

Create a syntax-highlighted code block from a snippet of source code.

Also available as the MCP tool render_codeblock. The same payload works through either surface.

Fields

data
codestringrequired

Raw source code. Preserve newlines and indentation exactly.

languagestring

Programming language, lowercase (e.g. "javascript", "python", "sql", "bash")

titlestring

Short title for the code block title bar (e.g. "Bubble Sort")

Example

{
  "type": "code_block",
  "data": {
    "code": "string",
    "language": "string",
    "title": "Q4 Launch Planning"
  }
}
Was this page helpful?

Sign in to MockFlow

The same account you use in the app and on the API.

Forgot your password?
or
Continue with GoogleContinue with Microsoft