# Developer API

> Use the same live data your AI sees in your own website, dashboard or system, over plain HTTPS and JSON. Pro and Agency plans.

The developer API lets your own code use the accounts you've connected to Plugsight: Google Analytics, Google Ads, Search Console, Zendesk, your mailbox, your store, your calendar and the rest. You connect each account once in the app. You never build OAuth apps, store tokens or learn each provider's API.

It runs the **same tools** your AI app uses, with the same rules. Your code sends an HTTPS request with a key, Plugsight reads the data live from the provider, and you get JSON back.

> [!NOTE]
> The developer API is on the **Pro** and **Agency** plans. On Free, every request is refused with `403 plan_required`.

## How it works

1. **Connect your accounts** under **Connections** in the app.
2. **Choose what the key can reach.** An MCP server is your API project: it groups the accounts one key may use.
3. **Create the API key** on the MCP server's page.
4. **Call a tool** by name, such as `get_marketing_data`, and get its data back.

There's nothing to install and no SDK. Any language that can send an HTTPS request works.

## Words used in these articles

| Word            | What it means                                                                                                                                                                                                                                                  |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Connection      | An account you've linked, such as a Google Ads account or a Zendesk helpdesk. You add them under **Connections**.                                                                                                                                              |
| MCP server      | A named group of connections with its own key. AI apps like Claude and ChatGPT use the same thing, which is why the app calls it an MCP server. For the API, think of it as a project. Make one per website or system, so each key reaches only what it needs. |
| API key         | The secret that identifies your MCP server. It starts with `mcpk_`. Each MCP server has at most one key.                                                                                                                                                       |
| Tool            | One thing the API can do, like "search Zendesk tickets" or "get Google Ads spend by campaign". Each has a name, arguments and an answer.                                                                                                                       |
| Read and Change | Read tools only fetch data. Change tools do something, such as send an email or update a ticket, and need extra permission.                                                                                                                                    |

## Quick start

About five minutes.

1. Open **Connections** and connect an account, for example Google Analytics.
2. Open **MCP servers** and click **Create MCP server**. Name it after where you'll use it, for example "Company website".
3. Under **Account access**, choose **Selected accounts** and tick only the accounts this key should reach.
4. Untick **Allow changes** if the key only needs to read.
5. On the MCP server's page, find **API key** and click **Create API key**.
6. Copy the key straight away. It's shown only once.
7. Save it as an environment variable on your server:

```bash
export PLUGSIGHT_API_KEY="mcpk_…"
```

8. List the tools the key can use:

```bash
curl https://app.plugsight.app/v1/tools \
  -H "Authorization: Bearer $PLUGSIGHT_API_KEY"
```

9. Find your account ids:

```bash
curl -X POST https://app.plugsight.app/v1/tools/list_accounts \
  -H "Authorization: Bearer $PLUGSIGHT_API_KEY" \
  -H "Content-Type: application/json" -d '{}'
```

10. Get real data, for example the last 30 days of website sessions by day:

```bash
curl -X POST https://app.plugsight.app/v1/tools/get_marketing_data \
  -H "Authorization: Bearer $PLUGSIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"connector": "analytics", "fields": ["date", "sessions", "users"], "date_preset": "last_30d"}'
```

## Same rules as your AI app

The API uses the MCP server's tools exactly as an AI app does, so everything you've set in the app applies:

- **Which accounts:** only the MCP server's accounts, minus any sites, properties or ad accounts you've hidden.
- **Which tools:** the tools follow the connections. Add Zendesk to the MCP server and the Zendesk tools appear; remove it and they go.
- **Your plan:** your plan's limits and features apply. Marketing and analytics data needs Pro or Agency.
- **Changes:** change tools need `"confirm": true`, **Allow changes** on the MCP server, the account's switch on, nothing paused on **Permissions**, and the daily email limit not reached. The exception is `organize_emails` (archive, label, mark read), which needs only a Pro or Agency plan and nothing paused.
- **Activity:** every call appears in **Activity** in the app, as "Developer API".

## Limits

- Up to **120 requests a minute** per MCP server. Over that, you get `429 rate_limited`. Need more? Use a second MCP server, or cache results on your side.
- Providers' own limits still apply (Google Ads, Zendesk and so on). When a provider says "slow down", the tool returns an error saying so.
- Data is read live on every call. Plugsight keeps only short-lived lists, such as which accounts a login reaches (15 minutes) and contacts (5 minutes), so cache results yourself if you show them often.

## In this section

- [Authentication](https://docs.plugsight.app/developers/authentication.md): the API key, the header, and keeping it secret.
- [Calling tools](https://docs.plugsight.app/developers/calling-tools.md): listing tools, calling one, the answer format and making changes.
- [Errors](https://docs.plugsight.app/developers/errors.md): every status code and error body.
- Tool reference: [Accounts](https://docs.plugsight.app/developers/accounts-tools.md), [Email](https://docs.plugsight.app/developers/email-tools.md), [Zendesk](https://docs.plugsight.app/developers/zendesk-tools.md), [Marketing and analytics](https://docs.plugsight.app/developers/marketing-tools.md), [Calendar](https://docs.plugsight.app/developers/calendar-tools.md), [Contacts](https://docs.plugsight.app/developers/contacts-tools.md), [WooCommerce](https://docs.plugsight.app/developers/woocommerce-tools.md), [Magento](https://docs.plugsight.app/developers/magento-tools.md), [Shopify](https://docs.plugsight.app/developers/shopify-tools.md), [Mailchimp](https://docs.plugsight.app/developers/mailchimp-tools.md), [Bing Webmaster Tools](https://docs.plugsight.app/developers/bing-webmaster-tools.md), [Custom API](https://docs.plugsight.app/developers/custom-api-tools.md), [Custom MCP server](https://docs.plugsight.app/developers/custom-mcp-tools.md) and [PageSpeed](https://docs.plugsight.app/developers/pagespeed-tools.md).
- Tools for connectors still waiting for Google's approval: [Google Drive](https://docs.plugsight.app/developers/drive-tools.md) (coming soon), [Google Tag Manager](https://docs.plugsight.app/developers/tag-manager-tools.md), [YouTube](https://docs.plugsight.app/developers/youtube-tools.md), [Google Merchant Center](https://docs.plugsight.app/developers/merchant-center-tools.md), [Google Sheets](https://docs.plugsight.app/developers/sheets-tools.md), [Google Docs](https://docs.plugsight.app/developers/docs-tools.md), [Google Forms](https://docs.plugsight.app/developers/forms-tools.md), [Google Meet](https://docs.plugsight.app/developers/meet-tools.md).

---

Web version: https://docs.plugsight.app/developers
