With the Create Note API, you can create formatted notes with full control over organization, collections, and formatting. This API gives you the power to build your knowledge base with structured content exactly the way you want it.

Here’s a simple example using the Create Note API:

curl "https://api.mem.ai/v1/notes" \
     --header "Content-Type: application/json" \
     --header "Authorization: Bearer $MEM_API_KEY" \
     --data '{
        "content": "# Project Idea\n\nBuild a mobile app that helps track daily water intake."
    }'

The response includes your newly created note:

{
  "id": "d4e78650-b159-47f2-a634-2c92f980c88d",
  "title": "Project Idea",
  "url": "https://mem.ai/notes/d4e78650-b159-47f2-a634-2c92f980c88d",
  "content": "# Project Idea\n\nBuild a mobile app that helps track daily water intake.",
  "operations": [
    {
      "type": "created-note",
      // ...
    }
    {
      "type": "added-note-to-collection",
      "collection_id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
      "collection_title": "Project Ideas",
      // ...
    }
  ],
  "created_at": "2025-04-09T14:30:45Z",
  "updated_at": "2025-04-09T14:30:45Z",
}

Creating note content

The Create Note API uses Markdown to format your notes, giving you control over headings, lists, formatting, and structure.

Using Markdown for content

The required content parameter accepts a Markdown-formatted string. The first line of your content is automatically treated as the note title.

curl "https://api.mem.ai/v1/notes" \
     --header "Content-Type: application/json" \
     --header "Authorization: Bearer $MEM_API_KEY" \
     --data '{
        "content": "# Customer Interview Notes\n\n## Background\nSarah, marketing director at Acme Corp\n\n## Key Points\n- Needs analytics dashboard\n- Prefers mobile access\n- Budget approved for Q3"
    }'

Some formatting options you can use:

  • Headings: Use # for main title, ## for sections
  • Lists: Create ordered or unordered lists
  • Formatting: Apply italic, bold, or code formatting
  • Links: Add hyperlinks
  • Tables: Create structured data tables

Organizing your notes

Mem provides several ways to organize your notes into collections, either manually or automatically.

Adding to collections

The add_to_collections parameter lets you specify which collections to add your note to:

curl "https://api.mem.ai/v1/notes" \
     --header "Content-Type: application/json" \
     --header "Authorization: Bearer $MEM_API_KEY" \
     --data '{
        "content": "# Weekly Team Sync\n\nDiscussed roadmap priorities and resource allocation.",
        "add_to_collections": ["Meetings", "Team Management", "Q2 Planning"]
    }'

You can use collection titles or IDs:

  • Using titles: "add_to_collections": ["Research", "AI"]
  • Using IDs: "add_to_collections": ["8a7b6c5d-4e3f-2a1b-0c9d"]
  • Or mix both: "add_to_collections": ["Research", "8a7b6c5d-4e3f-2a1b-0c9d"]

If a collection doesn’t exist yet, it will be created automatically.

Automatic organization

The auto_organize parameter gives you two options:

  1. Boolean value: Set to true to let Mem intelligently organize your note
"auto_organize": true
  1. String instructions: Provide specific organization guidance
"auto_organize": "Add this to my Work collection and create a new Project Alpha subcollection"

Enhancing notes with templates and formatting

Templates and auto-formatting help maintain consistency across your notes.

Applying templates

Use the apply_template parameter to structure your note according to a predefined template:

curl "https://api.mem.ai/v1/notes" \
     --header "Content-Type: application/json" \
     --header "Authorization: Bearer $MEM_API_KEY" \
     --data '{
        "content": "# Call with Investor\n\nSpoke with Alex about funding round.",
        "apply_template": "Meeting Notes"
    }'

You can reference templates by title or ID.

Automatic formatting

The auto_format parameter helps structure your content:

  1. Boolean value: Set to true to let Mem apply smart formatting
"auto_format": true
  1. String instructions: Provide specific formatting guidance
"auto_format": "Format as a research summary with bullet points for key findings"

Setting note metadata

Control when your notes were created or updated with timestamp parameters.

Timestamps

Set custom creation and update times with created_at and updated_at:

curl "https://api.mem.ai/v1/notes" \
     --header "Content-Type: application/json" \
     --header "Authorization: Bearer $MEM_API_KEY" \
     --data '{
        "content": "# Historical Project Notes\n\nInitial planning for Project Phoenix.",
        "created_at": "2025-01-15T10:30:00Z",
        "updated_at": "2025-01-16T14:45:00Z"
    }'

Both parameters accept ISO 8601 datetime strings. If not specified, the current time is used.

Real-world examples

Quick capture note

curl "https://api.mem.ai/v1/notes" \
     --header "Content-Type: application/json" \
     --header "Authorization: Bearer $MEM_API_KEY" \
     --data '{
        "content": "# Book Recommendation\n\nThe Psychology of Money by Morgan Housel - recommended by Jamie."
    }'

Detailed meeting notes with organization

curl "https://api.mem.ai/v1/notes" \
     --header "Content-Type: application/json" \
     --header "Authorization: Bearer $MEM_API_KEY" \
     --data '{
        "content": "# Quarterly Planning Session\n\n## Attendees\n- Marketing: Sarah, Alex\n- Product: Jamie, Taylor\n- Engineering: Morgan, Casey\n\n## Key Decisions\n1. Launch v2.0 in August\n2. Increase marketing budget by 15%\n3. Hire two new frontend developers\n\n## Action Items\n- Sarah: Draft marketing plan by Friday\n- Jamie: Update roadmap document\n- Morgan: Estimate engineering resources",
        "add_to_collections": ["Meetings", "Quarterly Planning"],
        "auto_format": "Highlight action items and decisions"
    }'

Project documentation with custom organization

curl "https://api.mem.ai/v1/notes" \
     --header "Content-Type: application/json" \
     --header "Authorization: Bearer $MEM_API_KEY" \
     --data '{
        "content": "# Project Horizon: Architecture Overview\n\n## System Components\n- Frontend: React with TypeScript\n- Backend: Node.js microservices\n- Database: PostgreSQL with Redis cache\n\n## Security Considerations\n- All endpoints require JWT authentication\n- Database encryption at rest\n- Regular security audits scheduled",
        "auto_organize": "Add this to my Technical Documentation collection and also create a Project Horizon collection if it doesn't exist"
    }'

Next steps

Check out the full API reference for additional options and capabilities.