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

# Public API

The REST API offers programmatic access to various features, including catalog data, self-service actions, automations, and scorecards.

## Authentication <a href="#public-api-auth" id="public-api-auth"></a>

To use the REST API, users must first generate an API key. Without this key, all access to the REST API will be denied. Users can create API access keys on the `Plugins` page.

<figure><img src="/files/sOIT1E3ph5lg3etf7C9v" alt="public api in plugins page"><figcaption></figcaption></figure>

Once on the `Plugins` page, select *View Details* for the **Public API** plugin and you will be able to generate an API key.

<figure><img src="/files/iw6Mswt4msmzuCHpPX6D" alt="generate api key"><figcaption></figcaption></figure>

{% hint style="info" %}
Tokens created via this process are valid for a duration of 10 years.&#x20;
{% endhint %}

{% hint style="warning" %}
Users are limited to one active token at any given time. **Generating a new token will automatically deactivate any previously issued token.**\
\
If you feel the need to have more than one token valid at each time, feel free to reach out to `support@rely.io`.
{% endhint %}

These keys act as credentials for authenticating access to Rely's REST API. To authenticate, include the key in the `Authorization` header of your API request. Format it as `Bearer {your_token_here}`, as shown in the example below.

```javascript
const response = await fetch('/api/v1/legacy/users/invite', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer YOUR_TOKEN_HERE",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "name": "John Doe",
      "email": "john.doe@rely.io"
    }),
});
const data = await response.json();
```

## Examples

To see a functional example for interacting with Rely's public API checkout our guide for "[Enhancing Deployment Visibility through GitLab Pipelines and Rely.io’s Public API](/guides-and-tutorials/enhancing-deployment-visibility-through-gitlab-pipelines-and-relys-api.md)".

## Troubleshooting

If you encounter any issues that you're unable to resolve on your own, please don't hesitate to contact our support team at `support@rely.io`.&#x20;

Additionally, if you would like to discuss a specific use-case you're targeting, feel free to [book a session with one of our experts](https://calendar.app.google/fHWH3to58EcSqLdh8) to brainstorm and gain further insights.
