For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Book a demoLog inStart for free
  • Getting started
    • Overview
    • How it works
    • Quickstart
    • Project structure
    • Customer showcase
    • Changelog
  • Configuration
    • Overview
    • Site-level settings
    • Page-level settings
  • Writing content
    • Markdown basics
    • Rich media in Markdown
    • Fern Editor
    • Reusable snippets
  • AI features
    • Overview
    • Fern Writer
    • AI-generated examples
    • Markdown access
      • Overview
      • Customize LLM output
      • Agent directives
      • Analytics and integration
    • MCP server
    • API catalog discovery
      • Overview
        • Overview
          • POSTCreate Code Record
          • POSTBatch Create Code Records
          • GETGet Code Record By Id
          • GETGet Code Records
          • DELDelete Code Record By Id
          • DELDelete All Code Records
  • Public API
    • GETJWT from Fern API key
    • GETAlgolia search credentials
    • GETCurrent user information
  • Fern Writer API
    • GETGet Fern Writer Install Link
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
Book a demoLog inStart for free
AI featuresAsk FernAPI referenceCode

Create Code Record

||View as Markdown|
POST
/code/:domain/create
POST
/code/:domain/create
$curl -X POST https://fai.buildwithfern.com/code/domain/create \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "document": "def add(a, b):\n \"\"\"Return the sum of a and b.\"\"\"\n return a + b",
> "chunk": "def add(a, b):\n return a + b",
> "title": "Addition Function",
> "url": "https://github.com/example/repo/blob/main/utils/math.py",
> "version": "v1.2.3",
> "product": "CalculatorApp",
> "keywords": [
> "addition",
> "math",
> "utility"
> ],
> "authed": false
>}'
1{
2 "code_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
3}
Was this page helpful?
Previous

Post Chat Completion

Next

Batch Create Code Records

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

domainstringRequired

Request

This endpoint expects any.

Response

Successful Response
code_idstring
The unique identifier of the created code entry

Errors

422
Unprocessable Entity Error