# Organizations

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

&#x20;You can use an organization access token, see "[Authenticating as an ICR organization](/documentation/carbonregistry.com/api/apps/authentication/authenticate-as-an-organization.md)". And you can also use an installation access token to access these endpoints using your ICR App. For more information, see "[Authenticating as an ICR App installation.](/documentation/carbonregistry.com/api/apps/authentication/authenticate-as-an-installation.md)" And
{% endhint %}

### Information

Metadata for an organization.

{% openapi src="/files/e1BPG9KQvvapGzTy8alf" path="/organizations/{id}" 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 %}

Gets base information on a specific organization.

Callable by any access token with permissions "[organization\_info:read](/documentation/carbonregistry.com/api/apps/creating-icr-apps/registering-an-icr-app/permissions.md#organization_info)".

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

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

{% endtab %}

{% tab title="Typescript" %}

{% endtab %}
{% endtabs %}

### Organization's Inventory Accounts

Returns the inventory accounts that this organization owns. Default and subaccounts.

{% openapi src="/files/e1BPG9KQvvapGzTy8alf" path="/organizations/{id}/addresses" 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 %}

Gets the public wallet addresses of an organization. Mainly used for getting addresses to deposit credits into or to get inventory data for subaccounts.

Callable by any access token with permissions "[organization\_info:read](/documentation/carbonregistry.com/api/apps/creating-icr-apps/registering-an-icr-app/permissions.md#organization_info)".

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

```bash
curl -X 'GET' \
  'https://api.carbonregistry.com/organizations/{ORG_ID}/addresses' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"\
  -H 'x-icr-api-version: 2023-06-16'
```

{% endtab %}

{% tab title="Typescript" %}

{% endtab %}
{% endtabs %}

### Organization Inventory

This is the main inventory of an organization. Currently only "read" and "read and request" access are available for the inventory. The "read and request" access gives an app the permission to make transfer / retirement requests toward the credits in the organization's inventory.

{% openapi src="/files/e1BPG9KQvvapGzTy8alf" path="/organizations/{id}/inventory" 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 %}

This returns all the credits in an organization's inventory.&#x20;

Callable by any access token with permissions "[organization\_inventory:read](/documentation/carbonregistry.com/api/apps/creating-icr-apps/registering-an-icr-app/permissions.md#organization_inventory)".

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

```bash
curl -X 'GET' \
  'https://api.carbonregistry.com/organizations/{ORG_ID}/inventory' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"\
  -H 'x-icr-api-version: 2023-06-16'
```

{% endtab %}
{% endtabs %}

{% openapi src="/files/e1BPG9KQvvapGzTy8alf" path="/organizations/{id}/inventory/action/{action}" 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 %}

Creates a "transfer" / "retire" / "transfer\_retire" transaction and puts it in the processing queue. To monitor the state of the transaction you can query the[ transaction endpoint](#read-specific-transaction).

Callable by any access token with permissions "[organization\_inventory:read\_write](/documentation/carbonregistry.com/api/apps/creating-icr-apps/registering-an-icr-app/permissions.md#organization_inventory)".

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

```bash
curl -X 'POST' \
  'https://api.carbonregistry.com/organizations/{ORG_ID}/inventory/action/{REQUEST_ACTION}' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"\
  -H 'x-icr-api-version: 2023-06-16' \
  -H 'Content-Type: application/json' \
  -d '{
  "creditId": "exPost-2-0x1234567890abcdef",
  "amount": 100,
  "toOrganizationId": "123e4567-e89b-12d3-a456-426614174000",
  "toAddress": "0x1234567890abcdef",
  "retirementData": {
    "reason": "Retirement reason",
    "beneficiaryName": "John Doe",
    "comment": "This is a comment"
  }
}'
```

{% endtab %}

{% tab title="Typescript" %}

{% endtab %}
{% endtabs %}

{% openapi src="/files/e1BPG9KQvvapGzTy8alf" path="/organizations/{id}/transactions/{transactionId}" 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 %}

Gets a specific transaction.

Callable by any access token with permissions "[organization\_inventory:read](/documentation/carbonregistry.com/api/apps/creating-icr-apps/registering-an-icr-app/permissions.md#organization_inventory)".

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

```bash
curl -X 'GET' \
  'https://api.carbonregistry.com/organizations/{ORG_ID}/inventory/transactions/{TRANSACTION_ID}' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"\
  -H 'x-icr-api-version: 2023-06-16'
```

{% endtab %}

{% tab title="Typescript" %}

{% endtab %}
{% endtabs %}

### Testing endpoints

#### friendbot - test credits

{% openapi src="/files/e1BPG9KQvvapGzTy8alf" path="/organizations/{id}/friendbot" 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 %}

To get some test credits into your organization on the [sandbox](https://sandbox-app.carbonregistry.com) you can use this endpoint with and organization Id that you control. It will deposit a 100 credits into your organization.

Callable by any access token regardless of permissions.

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

```bash
curl -X 'GET' \
  'https://api.carbonregistry.com/organizations/{ORG_ID}/friendbot' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"\
  -H 'x-icr-api-version: 2023-06-16'
```

{% endtab %}

{% tab title="Typescript" %}

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://documentation.carbonregistry.com/documentation/carbonregistry.com/api/endpoints/v0.5/organizations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
