> For the complete documentation index, see [llms.txt](https://docs.guestway.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.guestway.io/account-and-administration/api-access/how-to-create-an-api-access-token.md).

# How to create an API access token

This guide shows you how to create a token for the Guestway Open API, with only the permissions your integration needs.

{% hint style="info" %}
**Before you start**

* You have the **Super admin** role.
* To make API requests, you also need the Partnership API Key of your company from Guestway. You use the same key for all your automations. If you do not have a key yet, contact <support@guestway.io>.
  {% endhint %}

## Create the token

{% stepper %}
{% step %}

### Open API access

Go to **Settings** → **Organization** → **API Access**. On the **API Access** tab, click **Create**.
{% endstep %}

{% step %}

### Name the token

Enter a **Name**.

{% hint style="success" %}
Create one token for each automation or system. Name the token after the system and the environment, for example *Zapier - production* or *Data export - staging*.
{% endhint %}
{% endstep %}
{% endstepper %}

## Choose the permissions

{% stepper %}
{% step %}

### Select the permissions

Select the permissions in **Scopes**. See [API access](https://docs.guestway.io/account-and-administration/api-access.md#token-permissions) for the full list.

{% hint style="success" %}
Give the token only the permissions the integration really needs. If the token ever leaks, it can do less harm. Use **Full Access** only when there is no other way.
{% endhint %}
{% endstep %}

{% step %}

### Create it

Click **Create**.
{% endstep %}
{% endstepper %}

## Copy and store the token

{% stepper %}
{% step %}

### Copy the token

In **API Token generated**, click **Copy token & close**. The token starts with **gw\_**.

{% hint style="warning" %}
The full token shows only once. If you lose it, delete the token and create a new one.
{% endhint %}
{% endstep %}

{% step %}

### Store it safely

Paste the token in a secret manager. Do not put it in documents or tickets.
{% endstep %}
{% endstepper %}

## Use the token

{% stepper %}
{% step %}

### Add both headers

Add both headers to every API request:

```
X-Api-Key: <your partnership api key>
Authorization: Bearer gw_<your organization access token>
```

See the [Guestway Open API reference](https://api.guestway.io/swagger/open) for the endpoints.
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>Why do requests return 401 Unauthorized?</summary>

The token is missing, deleted or wrong. Check that the request has the header `Authorization: Bearer gw_...` with a token that still exists.

</details>

<details>

<summary>Why do requests return 403 Forbidden?</summary>

The token does not have the permission for that part of the API. Check the **Permissions** of the token, and add the missing one.

</details>

<details>

<summary>Why are requests rejected at once?</summary>

The `X-Api-Key` header is missing or wrong. Every request needs a valid Partnership API Key, otherwise Guestway rejects it before it checks the token.

</details>

<details>

<summary>Why do I get rate limit errors?</summary>

You send more than 5 requests per second or 10,000 per day. Slow down your client, or contact <support@guestway.io> for higher limits.

</details>

## Related

* [API access](https://docs.guestway.io/account-and-administration/api-access.md)
* [How to rotate or revoke an API token](https://docs.guestway.io/account-and-administration/api-access/how-to-rotate-or-revoke-an-api-token.md)
* [About partnership API keys and access tokens](https://docs.guestway.io/account-and-administration/api-access/about-partnership-api-keys-and-access-tokens.md)


---

# 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.guestway.io/account-and-administration/api-access/how-to-create-an-api-access-token.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.
