> For the complete documentation index, see [llms.txt](https://documentation.carbonregistry.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.carbonregistry.com/documentation/carbonregistry.com/api/apps/authentication/authenticate-as-an-app.md).

# Authenticate as an App

### About Authenticating as an ICR App

You must authenticate as an ICR App in order to make REST API requests as the application. For example, if you want to use the API to generate an installation access token for accessing organization resources, list installations across organizations for your app, or create new user / organization pairs with your app auto installed on the organization, you must authenticate as an app.

If a REST API endpoint requires you to authenticate as an app, the documentation for that endpoint will indicate that you must use a JWT to access the endpoint.&#x20;

### Using a JSON Web Token (JWT) to Authenticate as an ICR App

1. Generate a JSON Web Token (JWT) for your app. For more information, see "[Generating a JSON Web Token (JWT) for an ICR App.](/documentation/carbonregistry.com/api/apps/authentication/generate-a-jwt.md)"
2. Include the JWT in the `Authorization` header of your request. In the following example, replace `YOUR_JWT` with your JWT.&#x20;

{% tabs %}
{% tab title="Bash" %}

<pre class="language-bash"><code class="lang-bash">curl --request GET \
<strong>--url "https://api.carbonregistry.com/app/installations" \
</strong>--header "Authorization: Bearer YOUR_JWT"
</code></pre>

{% endtab %}

{% tab title="Javascript" %}

```typescript
await axios.get(
`https://api.carbonregistry/app/installations`,
{
  headers: {
    Authorization: `Bearer ${YOUR_JWT}`,
    },
  },
)
```

{% endtab %}
{% endtabs %}


---

# 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://documentation.carbonregistry.com/documentation/carbonregistry.com/api/apps/authentication/authenticate-as-an-app.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.
