> For the complete documentation index, see [llms.txt](https://docs.dapta.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dapta.ai/dforms/developers/api-keys.md).

# API keys & MCP

The dashboard no longer creates or revokes API keys. Keys you already have keep working with the REST API v1. To connect an AI agent, use the MCP connector and sign in with your account. Key rules, li

{% hint style="info" %}
**The dashboard no longer creates, lists or revokes API keys.** Keys you already have keep working with the REST API v1, with the same rules as before. To connect an AI agent (Claude, ChatGPT, Claude Code, Codex, Cursor, OpenClaw, Hermes), use the [MCP connector](https://docs.dapta.ai/dforms/developers/mcp-connector.md): you sign in with your account and there is no key to create.
{% endhint %}

***

## Connect an AI agent: use the connector

The recommended way to let an AI agent work in your workspace is the dForms MCP connector. Open **Connect your agent** in the left menu, pick your app and follow the steps. The agent signs in with your account, works in every workspace you can open, and acts with your role in each one.

See [Connect your AI agent (MCP)](https://docs.dapta.ai/dforms/developers/mcp-connector.md) for every app's steps, and **Tools** in the left menu for what the agent can do.

***

## Keys you already have

An API key lets a script or an agent call the REST API v1 as the person who created it: create forms, edit and publish them, put the previous version back, and read responses and analytics.

* **It keeps working.** Send it as `Authorization: Bearer <key>`, as before. The dForms MCP server also still accepts it.
* **It acts as its creator.** It has that person's role. If the role changes, or the person leaves the workspace, the key follows.
* **Treat it like a password.** Anyone holding it can act as you in that workspace.

| Rule                   | Value                                                                       |
| ---------------------- | --------------------------------------------------------------------------- |
| Workspaces per key     | One: the workspace it was created in                                        |
| Active keys per person | 10 per workspace                                                            |
| Requests per key       | 120 per minute; past that the API answers `429` with a `Retry-After` header |
| Name                   | 1 to 60 characters                                                          |

### Listing and revoking

The `/v1/api-keys` routes of the API still list, create and revoke keys, but only for a signed-in session: a key can never list, create or revoke keys. A member sees and revokes their own keys; an owner or admin sees and can revoke every active key in the workspace. Revoking stops a key right away and cannot be undone.

If you need a key revoked and cannot call that route, write to <josue@daptatech.com>.

***

## What a key can call

A key reaches the routes an agent needs to build and run forms, and nothing that manages the workspace. Any other route answers `403` with `KEY_NOT_ALLOWED`.

| A key can                                                                                                                                                  | A key cannot                                                                  |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| Create, read, edit, publish, revert, duplicate, move and delete forms, and change their link                                                               | List, create or revoke keys                                                   |
| Folders                                                                                                                                                    | Members, invitations and workspaces                                           |
| Set a form's destinations and test its webhook                                                                                                             | Write your profile, language or workspace link code                           |
| Read and delete responses, their files, deliveries and the CSV                                                                                             | Connect or disconnect an integration                                          |
| Analytics and the per question summary                                                                                                                     | List dCal event types                                                         |
| The brand kit, the link pages and the notification emails                                                                                                  | The Google Sheets, Salesforce and HighLevel setup routes the form editor uses |
| Read the integrations: `GET /v1/integrations`, `/v1/integrations/webhooks`, `/v1/integrations/hubspot/properties`, `/v1/integrations/calendly/event-types` |                                                                               |

The integration routes a key cannot call all need a person in a browser:

* **Connecting or disconnecting** an app is a consent screen (Google) or a credential an owner or admin types in (Salesforce, HighLevel, HubSpot, Calendly), so it happens on the **Integrations** page.
* **dCal event types** are read with the signed-in person's own Dapta session, which dForms forwards to dCal. A key is a credential for dForms only, so it has no session to forward. Pick a dCal event in the form editor.
* **Setting up a Google Sheets, Salesforce or HighLevel card** (choosing or creating the spreadsheet, listing its tabs, the Salesforce fields or the HighLevel fields) belongs to the form's **Connect** tab.

Owners and admins only, with a key as in the dashboard: the brand kit writes, the notification emails and the webhook test. A member's key gets `403` with `FORBIDDEN` there.

***

## Destinations: Google Sheets, Salesforce and HighLevel need a connection

`PUT /v1/forms/{id}/destinations` replaces a form's whole list of destinations, and `POST /v1/forms` can carry destinations in its config. A Google Sheets, Salesforce or HighLevel destination delivers through the workspace's own connection. With a key, dForms will not store one that would deliver into nothing:

| What the key sends                         | Provider connected | Provider not connected                                    |
| ------------------------------------------ | ------------------ | --------------------------------------------------------- |
| A **new or changed** entry, switched on    | Saved              | `400` with `INTEGRATION_NOT_CONNECTED`. Nothing is saved. |
| An entry **sent back exactly as stored**   | Saved              | Saved, and listed in `warnings`                           |
| An entry switched off (`"enabled": false`) | Saved              | Saved                                                     |

"Exactly as stored" ignores differences that change nothing, such as a field left out instead of `null`, or a Salesforce field written as `"Email"` instead of `["Email"]`. On `POST /v1/forms` nothing is stored yet, so every enabled Google Sheets, Salesforce or HighLevel entry counts as new. Webhook and HubSpot destinations are not affected. A signed-in person in the dashboard is never refused, only warned, because the **Connect** tab saves a card switched on before its app is connected.

For example, a Salesforce destination on a workspace that has not connected Salesforce:

{% code overflow="wrap" %}

```bash
curl -X PUT "https://api.dforms.ai/v1/forms/$FORM_ID/destinations" \
  -H "Authorization: Bearer $DFORMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"destinations":[{"type":"salesforce","enabled":true,"fieldMappings":{"email_1":"Email"},"staticFields":{"LeadSource":"Web"}}]}'
```

{% endcode %}

```json
{
  "error": "INTEGRATION_NOT_CONNECTED",
  "message": "Destination 1 is a new or changed Salesforce destination, and Salesforce is not connected in this workspace, so it would deliver nothing. ...",
  "provider": "salesforce",
  "index": 0,
  "integrationsUrl": "https://app.dforms.ai/admin/integrations"
}
```

`provider` is `google-sheets`, `salesforce` or `gohighlevel`, `index` is the entry's position in the list you sent, and `integrationsUrl` is the page where someone connects the app in a browser. Hand that link to a person, then send the same request again. On a deployment that cannot connect Google Sheets at all, the message says so instead and the body adds `"unavailable": true`: there is no page to hand over, so leave the destination out or switched off.

A save that goes through answers with the form as saved, plus:

| Field          | When it is there                                                                                                                                                                                                                                                                                                                                                                            |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `warnings`     | When an enabled entry was saved but delivers nothing yet. Each has a `code` (`INTEGRATION_NOT_CONNECTED` for an entry kept while its app is disconnected, `DESTINATION_INCOMPLETE` for a Google Sheets entry with no spreadsheet or no headed column yet), the entry's `index` and `type`, a `message` and, for a connection problem, `integrationsUrl`. `POST /v1/forms` reports them too. |
| `sheetHeaders` | When the save touched row 1 of a Google Sheets destination's spreadsheet. Its `outcome` is `written`, `unchanged`, `stale`, `foreign` or `failed`, as described in [MCP tools reference](https://docs.dapta.ai/dforms/developers/mcp-tools.md#destinations).                                                                                                                                |

`GET /v1/integrations` tells you beforehand what is connected: `providers`, `serverProvided`, `unavailable` (the apps this deployment cannot connect at all, such as `google-sheets` without a Google OAuth client), `googlePicker` (whether an existing spreadsheet can be picked) and `dcal` (`{ "createEventUrl": "..." }`, or `null` when the deployment has no dCal).

{% hint style="info" %}
A Google Sheets destination only writes to spreadsheets dForms created or someone picked in the dashboard (Google's `drive.file` permission). Take `spreadsheetId` from `GET /v1/forms/{id}`, not from a spreadsheet link.
{% endhint %}

***

## The API reference

The API publishes its own OpenAPI 3.1 document at `https://api.dforms.ai/openapi.json`, generated from the API itself, so it is always current. It documents `PUT /v1/forms/{id}/destinations` with its body, `warnings` and `sheetHeaders`, the `INTEGRATION_NOT_CONNECTED` refusal and the `warnings` of `POST /v1/forms`, and marks every route a key can call with the `apiKey` scheme.

Webhook `signatureHeader` and `timeoutMs` are set in the dashboard only. With an API key, a webhook entry that carries either one is refused with `400` (issue code `UNSUPPORTED_FIELD`), even when it matches what is stored, so leave them out. See [Public API & rate limits](https://docs.dapta.ai/dforms/developers/public-api.md#the-openapi-document).

The unauthenticated endpoints every public form uses are described in [Public API & rate limits](https://docs.dapta.ai/dforms/developers/public-api.md).

## What's next

* [Connect your AI agent (MCP)](https://docs.dapta.ai/dforms/developers/mcp-connector.md): the recommended way to connect an agent, no key needed.
* [MCP tools reference](https://docs.dapta.ai/dforms/developers/mcp-tools.md): the same rules for an agent connected over MCP.
* [MCP connector privacy](https://docs.dapta.ai/dforms/developers/mcp-privacy.md): what the connector reads and records.
* [Public API & rate limits](https://docs.dapta.ai/dforms/developers/public-api.md): the open endpoints behind every public form.
* [Webhooks](https://docs.dapta.ai/dforms/connect/webhooks.md): push every submission to your own systems without polling.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.dapta.ai/dforms/developers/api-keys.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
