> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/integrations/builtin/credentials/strapi.md).

# Strapi credentials

You can use these credentials to authenticate the following nodes:

* [Strapi](/integrations/builtin/app-nodes/n8n-nodes-base.strapi.md)

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

Create a [Strapi](https://strapi.io/) admin account with:

* Access to an existing Strapi project.
* At least one collection type within that project.
* Published data within that collection type.

Refer to the Strapi developer [Quick Start Guide](https://docs.strapi.io/dev-docs/quick-start) for more information.

## Supported authentication methods <a href="#supported-authentication-methods" id="supported-authentication-methods"></a>

* API user account: Requires a user account with appropriate content permissions.
* API token: Requires an admin account.

## Related resources <a href="#related-resources" id="related-resources"></a>

Refer to [Strapi's documentation](https://docs.strapi.io/dev-docs/api/rest) for more information about the service.

## Using API user account <a href="#using-api-user-account" id="using-api-user-account"></a>

To configure this credential, you'll need:

* A user **Email**: Must be for a user account, not an admin account. Refer to the more detailed instructions below.
* A user **Password**: Must be for a user account, not an admin account. Refer to the more detailed instructions below.
* The **URL**: Use the public URL of your Strapi server, defined in `./config/server.js` as the `url` parameter. Strapi recommends using an absolute URL.
  * For Strapi Cloud projects, use the URL of your Cloud project, for example: `https://my-strapi-project-name.strapiapp.com`
* The **API Version**: Select the version of the API you want your calls to use. Options include:
  * **Version 3**
  * **Version 4**

In Strapi, the configuration involves two steps:

1. [Configure a role](#configure-a-role).
2. [Create a user account](#create-a-user-account).

Refer to the more detailed instructions below for each step.

### Configure a role <a href="#configure-a-role" id="configure-a-role"></a>

For API access, use the Users & Permissions Plugin in **Settings > Users & Permissions Plugin**.

Refer to [Configuring Users & Permissions Plugin](https://docs.strapi.io/user-docs/settings/configuring-users-permissions-plugin-settings) for more information on the plugin. Refer to [Configuring end-user roles](https://docs.strapi.io/user-docs/users-roles-permissions/configuring-end-users-roles) for more information on roles.

For the n8n credential, the user must have a role that grants them API permissions on the collection type. For the role, you can either:

* Update the default **Authenticated** role to include the permissions and assign the user to that role. Refer to [Configuring role's permissions](https://docs.strapi.io/user-docs/users-roles-permissions/configuring-end-users-roles#configuring-roles-permissions) for more information.
* Create a new role to include the permissions and assign the user to that role. Refer to [Creating a new role](https://docs.strapi.io/user-docs/users-roles-permissions/configuring-end-users-roles#creating-a-new-role) for more information.

For either option, once you open the role:

1. Go to the **Permissions** section.
2. Open the section for the relevant collection type.
3. Select the permissions for the collection type that the role should have. Options include:
   * `create` (POST)
   * `find` and `findone` (GET)
   * `update` (PUT)
   * `delete` (DELETE)
4. Repeat for all relevant collection types.
5. Save the role.

Refer to [Endpoints](https://docs.strapi.io/dev-docs/api/rest#endpoints) for more information on the permission options.

### Create a user account <a href="#create-a-user-account" id="create-a-user-account"></a>

Now that you have an appropriate role, create an end-user account and assign the role to it:

1. Go to **Content Manager > Collection Types > User**.
2. Select **Add new entry**.
3. Fill in the user details. The n8n credential requires these fields, though your Strapi project may have more custom required fields:
   * **Username**: Required for all Strapi users.
   * **Email**: Enter in Strapi and use as the **Email** in the n8n credential.
   * **Password**: Enter in Strapi and use as the **Password** in the n8n credential.
   * **Role**: Select the role you set up in the previous step.

Refer to [Managing end-user accounts](https://docs.strapi.io/user-docs/users-roles-permissions/managing-end-users) for more information.

## Using API token <a href="#using-api-token" id="using-api-token"></a>

To configure this credential, you'll need:

* An **API Token**: Create an API token from **Settings > Global Settings > API Tokens**. Refer to Strapi's [Creating a new API token documentation](https://docs.strapi.io/user-docs/settings/API-tokens#creating-a-new-api-token) for more details and information on regenerating API tokens.<br>

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>API tokens permission</strong></p><p>If you don't see the <strong>API tokens</strong> option in <strong>Global settings</strong>, your account doesn't have the <strong>API tokens > Read</strong> permission.</p></div>
* The **URL**: Use the public URL of your Strapi server, defined in `./config/server.js` as the `url` parameter. Strapi recommends using an absolute URL.
  * For Strapi Cloud projects, use the URL of your Cloud project, for example: `https://my-strapi-project-name.strapiapp.com`
* The **API Version**: Select the version of the API you want your calls to use. Options include:
  * **Version 3**
  * **Version 4**


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.n8n.io/integrations/builtin/credentials/strapi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
