> ## Documentation Index
> Fetch the complete documentation index at: https://docs.widgetic.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> How an AI assistant signs in to Widgetic, which permissions it can hold, and how to revoke its access

An assistant can connect to `https://mcp.widgetic.com` in two ways. Both work in one workspace, the one the connection is made for, and both need a workspace on a paid plan: a workspace still in its free trial cannot connect an assistant or make a key yet.

| | Sign in with Widgetic (OAuth) | API key |
| - | - | - |
| Best for | ChatGPT, Codex, Cursor, Claude Code, VS Code | Clients that cannot open a browser, scripts |
| You do | Approve the connection once on a Widgetic page, and choose the workspace | Create a key in the workspace and put it in the client's settings |
| Works in | The workspace you chose | The workspace the key was made for |
| Permissions | Exactly the ones you approve | All of them |
| Ends when | You remove it, or Widgetic ends it for you | You delete or rotate the key |

## Sign in with Widgetic

The assistant starts the sign-in for you. You are taken to a Widgetic page, you sign in if you are not already, and you see which application is asking and what it would be allowed to do:

**1. The assistant asks to connect**

Your client registers itself with Widgetic automatically and opens your browser.

**2. You review the request**

The page names the application, lists each permission in plain words and asks which of your workspaces the assistant may work in. A workspace that cannot connect (it is in its free trial, or has no plan) is listed with the reason. Nothing is granted until you choose **Allow**; **Cancel** refuses the request.

**3. The assistant is connected**

The client receives a short-lived access token and a way to renew it, and keeps itself signed in. You are not asked again until you remove the connection.

The connection works in the workspace you chose and does not follow the workspace you have open on widgetic.com later. To work in another workspace, connect again and choose it: you can have one connection for each of your workspaces.

> [!WARNING]
>
> Only approve a request you started. Check that the page is on `widgetic.com` and that the application name is the one you are connecting.

### Permissions

These are the permissions an assistant can ask for. The consent page uses exactly these words.

| Permission | What you are told you are approving |
| - | - |
| `widgetic.read` | See your widgets, media library, Brand Kit, A/B tests, translations, workflows and account details |
| `widgetic.write` | Create and change widgets, your Brand Kit, A/B tests, translations and workflows, and add, rename and move files in your media library. Creating widgets uses your plan's credits. A translation sends the widget's text to a language model |
| `widgetic.publish` | Publish widgets and workflows, take a widget offline again, start A/B tests and turn on translations. A published widget is visible to anyone who has the link, and a test or a translation changes what visitors to your pages see |
| `widgetic.delete` | Delete widgets, with their versions and published copies, and files from your media library. This cannot be undone: embeds of a deleted widget stop working on websites, and widgets that load a deleted file stop showing it |
| `openid` | Confirm that you are signed in to Widgetic |
| `email` | See your email address |
| `profile` | See your name |
| `offline_access` | Stay connected until you disconnect it, without asking you to sign in again |

Each tool needs one of the first four; the [tools reference](https://docs.widgetic.com/docs/agents/tools.md) says which. A tool called without its permission is refused and the assistant is told to ask you to connect again and approve it. A finished build also needs `widgetic.publish` to publish itself: a connection approved without it still builds, and keeps the result as a draft until you connect again and approve publishing, or publish it in Widgetic.

## API keys

Open the workspace you want the key for, create a key under [**Settings** > **API Keys**](https://widgetic.com/workspaces?settings=api-keys) in your Widgetic dashboard, then send it on every request. The key works in that workspace and in no other, whichever workspace you have open afterwards; a person with several workspaces makes a key in each of them.

```bash theme={"theme":"css-variables"}
Authorization: Bearer wdg_org_your_api_key_here
```

A workspace key (`wdg_org_`) works, as long as it was made with full access. You can [limit a key](https://docs.widgetic.com/docs/authentication.md#limit-what-a-key-can-do) to some of what your workspace may do (Read only, Content or Custom), and the Widgetic MCP server refuses a key limited that way, because it hands an assistant every tool your workspace has. A workspace key acts as the workspace's owner: the widgets it makes, and the credits it spends, are theirs, in that workspace. A key that works carries all four permissions, and there is no way to narrow it, so prefer signing in with Widgetic wherever the client supports it. Keep keys out of shared files and public repositories; see [Authentication](https://docs.widgetic.com/docs/authentication.md) for key handling in general.

## Revoking access

**1. Open your connected apps**

Go to [widgetic.com/profile/connected-apps](https://widgetic.com/profile/connected-apps) while signed in.

**2. Disconnect the application**

Choose **Disconnect** next to the assistant and confirm. It stops being able to use your account straight away, and it has to ask you for permission again to get back in.

Removing the server inside your assistant only makes the assistant forget it. To end the access itself, disconnect it at Widgetic as above. An API key is revoked by deleting it in the dashboard.

### When Widgetic ends a connection for you

Widgetic disconnects every connected assistant when you:

* change your password,
* delete your account, or
* are removed from a workspace: the connections made for that workspace end, and the ones made for your other workspaces stay.

If a workspace's plan ends, its connections are not removed, but they stop working until it has a plan again: see [When the workspace has no plan](#when-the-workspace-has-no-plan).

## When the workspace has no plan

A connection and a key are credentials for a paying workspace, so both follow the plan of the workspace they were made for, the same way [the REST API and the CLI do](https://docs.widgetic.com/docs/authentication.md#keys-and-your-workspace-plan).

| The workspace is... | What the server does |
| - | - |
| In its free trial | Refuses every request with `403`, for a connection and for a key alike: connecting an assistant is part of the paid plans, and a key cannot be made yet. |
| Without a plan, or paying late beyond its grace period | Keeps the connection and the key, switched off rather than deleted. The server still accepts them, so that the assistant can tell you why: every tool is refused in the plan's own words, except `get_profile` and the tools that follow or cancel a build that started while the plan was active (`get_widget`, `show_widget`, `cancel_widget_creation`). Nothing can start work. |
| Back on a paid plan | The same connection and the same key work again within about a minute. Nothing is made again. |
| Deleted | Its connections end with it and its keys are deleted. |

Only the plan of that workspace counts. Another workspace of the same person, paid or not, neither unlocks a connection nor locks it.

## When a request is refused

A credential that is missing, expired or not valid is refused at the door with `401`, before any tool runs. A credential that is fine and may not use the server is refused with `403`: the workspace is in its free trial or has no plan with API access, the key was made with a limit, or the app is not open to Widgetic yet (`access_denied`). A tool called without a permission it needs is not an HTTP error: the tool answers with an error that carries a challenge, which is how ChatGPT knows to show its connect screen again, and the fix is to connect again and approve every permission.

Every status, what it means and what to do about it, and how a tool error differs from an HTTP error, are in [Errors](https://docs.widgetic.com/docs/agents/build-a-client.md#errors).

## Privacy

Widgetic receives what your assistant sends in tool calls, such as the description of a widget you asked for, and the files you ask it to save. It does not receive the rest of your conversation. Requests to create or revise a widget are screened with a content moderation service first. The [privacy policy](https://widgetic.com/legal/privacy) has the details, and [the support team](https://docs.widgetic.com/docs/introduction.md#need-help) can help with any question about a connection.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.