---
title: "API Reference: REST and MCP Endpoints | MagicSync"
description: "Build on MagicSync with API keys, scoped REST endpoints for posts, businesses, media and analytics, plus an MCP server for AI assistants."
canonical_url: "https://magicsync.dev/api-reference"
---

> Index of every page on this site: [llms.txt](https://magicsync.dev/llms.txt)

<base-hero :actions="[{"label":"Create an API Key","href":"/app/keys","icon":"lucide:arrow-right"},{"label":"Read the Docs","href":"/documentation","variant":"secondary"}]" :badge="{"label":"Developer API","content":"REST, CLI and MCP"}" :heroImage="{"light":"/img/home-light.png","dark":"/img/home-dark.png","alt":"MagicSync API keys and endpoint documentation"}">
<template v-slot:title="">

Build on the <span className="gradient-text">

MagicSync API

</span>
</template>

<template v-slot:description="">

Everything the interface can do is available to scripts and AI assistants: create posts, queue them, inspect results and read analytics with scoped keys and audit logging.

</template>
</base-hero>

<base-features :list="[{"title":"Scoped API Keys","description":"Create read-only or full-access keys per workspace. Revoke a key instantly without touching the rest of your automation.","icon":"lucide:key-round"},{"title":"REST Resource Groups","description":"Predictable JSON endpoints for posts, businesses, accounts, media, analytics, templates and the agent runtime.","icon":"lucide:braces"},{"title":"MCP Server","description":"Connect Claude or any MCP client to discover tools and resources, then draft and schedule posts through natural language.","icon":"lucide:bot"},{"title":"Audit Every Call","description":"Each request is attributed to a key and recorded, so you can see which automation created or changed a post.","icon":"lucide:scroll-text"}]">
<template v-slot:title="">

Designed for Automation

</template>

<template v-slot:subtitle="">

What you can do with MagicSync

</template>

<template v-slot:description="">

Stable shapes, explicit scopes and logs that answer "who changed this?".

</template>
</base-features>

<section className="mx-auto,prose,dark:prose-invert,pt-6,text-sm,md:text-xl">

## Authentication

Create a key at [API keys](https://magicsync.dev/app/keys) and send it as a bearer token:

```bash
curl https://magicsync.dev/api/v1/posts \
  -H "Authorization: Bearer $MAGICSYNC_API_KEY"
```

Keys belong to a user and are limited to that user's businesses. Read-only keys can list and fetch; full-access keys can create, update, schedule and publish.

## Endpoint groups

<table>
<thead>
  <tr>
    <th>
      Group
    </th>
    
    <th>
      Base path
    </th>
    
    <th>
      Typical use
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Posts
    </td>
    
    <td>
      <code>
        /api/v1/posts
      </code>
    </td>
    
    <td>
      Create, update, schedule and inspect posts
    </td>
  </tr>
  
  <tr>
    <td>
      Businesses
    </td>
    
    <td>
      <code>
        /api/v1/business
      </code>
    </td>
    
    <td>
      Workspaces, profiles and brand context
    </td>
  </tr>
  
  <tr>
    <td>
      Accounts
    </td>
    
    <td>
      <code>
        /api/v1/accounts
      </code>
    </td>
    
    <td>
      Connected social accounts and status
    </td>
  </tr>
  
  <tr>
    <td>
      Media
    </td>
    
    <td>
      <code>
        /api/v1/media
      </code>
    </td>
    
    <td>
      Upload and reference images and video
    </td>
  </tr>
  
  <tr>
    <td>
      Analytics
    </td>
    
    <td>
      <code>
        /api/v1/stats
      </code>
    </td>
    
    <td>
      Reach, engagement and post performance
    </td>
  </tr>
  
  <tr>
    <td>
      Templates
    </td>
    
    <td>
      <code>
        /api/v1/templates
      </code>
    </td>
    
    <td>
      Reusable post and variable templates
    </td>
  </tr>
  
  <tr>
    <td>
      Bulk scheduler
    </td>
    
    <td>
      <code>
        /api/v1/bulk-scheduler
      </code>
    </td>
    
    <td>
      CSV imports and batch creation
    </td>
  </tr>
  
  <tr>
    <td>
      Agent
    </td>
    
    <td>
      <code>
        /api/v1/agent
      </code>
    </td>
    
    <td>
      Chat sessions, capabilities and runs
    </td>
  </tr>
  
  <tr>
    <td>
      API keys
    </td>
    
    <td>
      <code>
        /api/v1/api-keys
      </code>
    </td>
    
    <td>
      Create, list and revoke keys
    </td>
  </tr>
  
  <tr>
    <td>
      MCP
    </td>
    
    <td>
      <code>
        /mcp
      </code>
    </td>
    
    <td>
      Tool and resource discovery for AI clients
    </td>
  </tr>
</tbody>
</table>

Exact request bodies, query parameters and response schemas are documented per endpoint in the OpenAPI description exposed by the running instance.

## MCP in one minute

Point an MCP client at `https://magicsync.dev/mcp`, authenticate with a key or OAuth, and the assistant can list tools and resources. Approval-gated actions stay gated: the assistant can draft and queue, but publishing follows the permissions on the key.

## CLI

The companion CLI wraps the same API for terminal workflows such as bulk text imports and scheduled checks. See the [CLI guide](https://magicsync.dev/blogs/magicsync-cli-social-media-automation) for a walkthrough.

</section>

<base-faq :list="[{"label":"Is there a rate limit?","content":"Yes. Requests are limited per key and per IP, with higher limits for authenticated workspace keys. Responses include retry guidance when a limit is hit.","value":"1"},{"label":"Can a key publish without approval?","content":"Only a full-access key can publish directly. Read-only keys cannot create or modify posts, and approval-gated workflows still require a human decision.","value":"2"},{"label":"Do you provide an OpenAPI schema?","content":"Yes. The running instance exposes an OpenAPI description of the API, which you can import into Postman, Insomnia or a client generator.","value":"3"},{"label":"Is the API available on self-hosted installs?","content":"Yes. The same routes ship with the Docker edition. Point your base URL at your own domain.","value":"4"},{"label":"How do I rotate a leaked key?","content":"Revoke it immediately from the API keys screen, then create a replacement. Revocation takes effect on the next request.","value":"5"}]">
<template v-slot:title="">

API FAQ

</template>

<template v-slot:subtitle="">

Authentication, limits and safety for programmatic access.

</template>
</base-faq>

<base-call-to-action :primaryAction="{"label":"Open API Keys","href":"/app/keys"}" :secondaryAction="{"label":"Read the Docs","href":"/documentation"}" description="Generate a scoped key and make your first request in a couple of minutes." title="Create Your First API Key">



</base-call-to-action>

## Sitemap

See the full [sitemap](https://magicsync.dev/sitemap.md) for all pages.
