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

# Authentication

> Create an app and get your API key to authenticate with the Makeswift REST API.

export const ReadinessBadge = ({type}) => {
  const validTags = ["beta", "alpha", "experimental"];
  const tagText = type?.trim().toLowerCase();
  if (!tagText || !validTags.includes(tagText)) return null;
  useEffect(() => {
    const titleElement = document.querySelector("#page-title, .page-title, h1");
    if (!titleElement) return;
    if (titleElement.querySelector(".badge")) return;
    const badge = document.createElement("span");
    badge.className = `badge ${tagText}-badge`;
    badge.textContent = tagText;
    badge.style.transform = "translateY(-3px)";
    titleElement.appendChild(badge);
  }, []);
  return null;
};

<ReadinessBadge type="beta" />

To use the Makeswift REST API, you'll need to create an app and obtain an API key. This guide walks you through the setup process.

<Note>
  While both API Key and Bearer Token authentication methods are supported, you must use **only one** authentication method per request. Requests that include both an API Key and Bearer Token will be rejected.
</Note>

## Prerequisites

Apps is currently an early access feature. You'll need to enable it before you can create an app.

## Enable Apps early access

1. Open **Settings** in the Makeswift builder
2. Navigate to **User** → **Early access**
3. Toggle on **Apps**

<Frame>
  <img src="https://mintcdn.com/makeswift/9BOYzTsJ_drmhlro/images/apps/toggle-apps-early-access.png?fit=max&auto=format&n=9BOYzTsJ_drmhlro&q=85&s=b6f0b5e83bcaa6a663a4b69d496c593b" alt="Early access settings showing the Apps toggle" width="3022" height="1896" data-path="images/apps/toggle-apps-early-access.png" />
</Frame>

## Create an app

Once Apps is enabled, you can create your first app:

1. Open **Settings** in the Makeswift builder
2. Navigate to **Workspace** → **Apps**
3. Click **Create app**

<Frame>
  <img src="https://mintcdn.com/makeswift/9BOYzTsJ_drmhlro/images/apps/go-to-apps-settings.png?fit=max&auto=format&n=9BOYzTsJ_drmhlro&q=85&s=cb5872cbbeb4ac12248921d24c149c11" alt="Apps settings page" width="3025" height="1898" data-path="images/apps/go-to-apps-settings.png" />
</Frame>

4. Enter a **Name** for your app
5. Optionally, choose an **Icon** and add a **Description**
6. Click **Continue**

<Frame>
  <img src="https://mintcdn.com/makeswift/9BOYzTsJ_drmhlro/images/apps/create-app.png?fit=max&auto=format&n=9BOYzTsJ_drmhlro&q=85&s=1eee7b7c6b0a45a4e9d564d0b47bfcce" alt="Create app dialog" width="3023" height="1896" data-path="images/apps/create-app.png" />
</Frame>

## Copy your API key

After creating your app, you'll be shown your API key. This is the only time the key will be displayed.

<Warning>
  Save your API key immediately. It won't be shown again after you close the
  dialog. If you lose it, you'll need to create a new app.
</Warning>

<Frame>
  <img src="https://mintcdn.com/makeswift/9BOYzTsJ_drmhlro/images/apps/copy-app-api-key.png?fit=max&auto=format&n=9BOYzTsJ_drmhlro&q=85&s=aa7a3bed46bc192395387f74f03723ff" alt="App API key dialog" width="3023" height="1897" data-path="images/apps/copy-app-api-key.png" />
</Frame>

1. Click the **Copy** button or **Copy and Close** to copy the API key
2. Store the key securely (e.g., in environment variables or a secrets manager)

## Get your Site ID

Many API endpoints require a Site ID. To find it:

1. Open **Settings** in the Makeswift builder
2. Navigate to **Site** → **Site**
3. Copy the **Site Id** value

<Frame>
  <img src="https://mintcdn.com/makeswift/9BOYzTsJ_drmhlro/images/apps/copy-site-id.png?fit=max&auto=format&n=9BOYzTsJ_drmhlro&q=85&s=336ce886895afd87d2237e67861f4c89" alt="Site settings showing Site Id" width="3018" height="1897" data-path="images/apps/copy-site-id.png" />
</Frame>

## Get your Workspace ID

Some API endpoints operate at the workspace level and require a Workspace ID:

1. Open **Settings** in the Makeswift builder
2. Navigate to **Workspace** → **Workspace**
3. Copy the **Workspace Id** value

<Frame>
  <img src="https://mintcdn.com/makeswift/9BOYzTsJ_drmhlro/images/apps/copy-workspace-id.png?fit=max&auto=format&n=9BOYzTsJ_drmhlro&q=85&s=76342e9a46c0ef2187571454e5d79682" alt="Workspace settings showing Workspace Id" width="3023" height="1896" data-path="images/apps/copy-workspace-id.png" />
</Frame>

## Using your API key

Include your API key in the `x-api-key` header with every request:

```bash theme={null}
curl https://api.makeswift.com/v2/sites \
  -H "x-api-key: your-api-key"
```

<Note>
  Keep your API key secure and never expose it in client-side code. Use
  environment variables to store your key in your application.
</Note>

## Next steps

Now that you have your API key, you can start making requests to the API:

* [List your sites](/developer/reference/api/sites/list-sites)
* [List your pages](/developer/reference/api/pages/list-pages)
* [Configure locales](/developer/reference/api/locales/create-locale)
