# Apps

{% hint style="info" %}
**Who can use these endpoints**

You need to use a JWT to access these endpoints using your ICR App's private key to sign it. For more information, see "[Authenticating as an ICR App.](https://documentation.carbonregistry.com/documentation/carbonregistry.com/api/apps/authentication/authenticate-as-an-app)"
{% endhint %}

### Access tokens

Access tokens are how your app gets access to organization and credit resources on CarbonRegistry.com.&#x20;

#### app access token

{% openapi src="<https://2441265052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfIdoGcZZdvap67xjb5h1%2Fuploads%2Fmabe2nfB82a3vZ8qM4e9%2Fopenapi.yaml?alt=media&token=b0070a9e-b5c0-4246-9200-1241aa683103>" path="/app/accessTokens" method="post" %}
[openapi.yaml](https://2441265052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfIdoGcZZdvap67xjb5h1%2Fuploads%2Fmabe2nfB82a3vZ8qM4e9%2Fopenapi.yaml?alt=media\&token=b0070a9e-b5c0-4246-9200-1241aa683103)
{% endopenapi %}

The app access token is an access token you can use if you do not need to make requests accessing organization resources. This is mostly for semi-public endpoints like getting information on [public projects](https://documentation.carbonregistry.com/documentation/carbonregistry.com/api/endpoints/projects#projects).

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

```bash
curl -X 'POST' \
  'https://api.carbonregistry.com/app/accessTokens' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer YOUR_JWT"\
  -H 'x-icr-api-version: 2023-06-16'
```

{% endtab %}

{% tab title="Typescript" %}

{% endtab %}
{% endtabs %}

#### installation access token

{% openapi src="<https://2441265052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfIdoGcZZdvap67xjb5h1%2Fuploads%2Fmabe2nfB82a3vZ8qM4e9%2Fopenapi.yaml?alt=media&token=b0070a9e-b5c0-4246-9200-1241aa683103>" path="/app/installations/{installationId}/accessTokens" method="post" %}
[openapi.yaml](https://2441265052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfIdoGcZZdvap67xjb5h1%2Fuploads%2Fmabe2nfB82a3vZ8qM4e9%2Fopenapi.yaml?alt=media\&token=b0070a9e-b5c0-4246-9200-1241aa683103)
{% endopenapi %}

Installation access tokens are the tokens you need when accessing resources from organizations. These tokens are needed when making requests to the "[Endpoints available for ICR App installations](https://documentation.carbonregistry.com/documentation/carbonregistry.com/api/endpoints/v0.5/organizations)".

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

```bash
curl -X 'POST' \
  'https://api.carbonregistry.com/app/installations/{INSTALLATION_ID}/accessTokens' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer YOUR_JWT"\
  -H 'x-icr-api-version: 2023-06-16' 
```

{% endtab %}

{% tab title="Typescript" %}

{% endtab %}
{% endtabs %}

#### delete access token

{% openapi src="<https://2441265052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfIdoGcZZdvap67xjb5h1%2Fuploads%2Fmabe2nfB82a3vZ8qM4e9%2Fopenapi.yaml?alt=media&token=b0070a9e-b5c0-4246-9200-1241aa683103>" path="/app/installations/token" method="delete" %}
[openapi.yaml](https://2441265052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfIdoGcZZdvap67xjb5h1%2Fuploads%2Fmabe2nfB82a3vZ8qM4e9%2Fopenapi.yaml?alt=media\&token=b0070a9e-b5c0-4246-9200-1241aa683103)
{% endopenapi %}

Enables deleting / invalidating an access token. It invalidates the one used in the authorization header.

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

```bash
curl -X 'DELETE' \
  'https://api.carbonregistry.com/app/installations/token' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"\
  -H 'x-icr-api-version: 2023-06-16'
```

{% endtab %}

{% tab title="Typescript" %}

{% endtab %}
{% endtabs %}

#### all app installations

{% openapi src="<https://2441265052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfIdoGcZZdvap67xjb5h1%2Fuploads%2Fmabe2nfB82a3vZ8qM4e9%2Fopenapi.yaml?alt=media&token=b0070a9e-b5c0-4246-9200-1241aa683103>" path="/app/installations" method="get" %}
[openapi.yaml](https://2441265052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfIdoGcZZdvap67xjb5h1%2Fuploads%2Fmabe2nfB82a3vZ8qM4e9%2Fopenapi.yaml?alt=media\&token=b0070a9e-b5c0-4246-9200-1241aa683103)
{% endopenapi %}

A paginated list of all app installations for this app.&#x20;

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

```bash
curl -X 'GET' \
  'https://api.carbonregistry.com/app/installations?limit=10&page=0' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer YOUR_JWT"\
  -H 'x-icr-api-version: 2023-06-16'
```

{% endtab %}

{% tab title="Typescript" %}

{% endtab %}
{% endtabs %}

#### specific app installation

{% openapi src="<https://2441265052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfIdoGcZZdvap67xjb5h1%2Fuploads%2Fmabe2nfB82a3vZ8qM4e9%2Fopenapi.yaml?alt=media&token=b0070a9e-b5c0-4246-9200-1241aa683103>" path="/app/installations/{installationId}" method="get" %}
[openapi.yaml](https://2441265052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfIdoGcZZdvap67xjb5h1%2Fuploads%2Fmabe2nfB82a3vZ8qM4e9%2Fopenapi.yaml?alt=media\&token=b0070a9e-b5c0-4246-9200-1241aa683103)
{% endopenapi %}

Returns a specific app installation.

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

```bash
curl -X 'GET' \
  'https://api.carbonregistry.com/app/installations/{INSTALLATION_ID}' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer YOUR_JWT"\
  -H 'x-icr-api-version: 2023-06-16'
```

{% endtab %}

{% tab title="Typescript" %}

{% endtab %}
{% endtabs %}
