Endpoints available for ICR apps

Your ICR App can make requests to the following REST endpoints with an App signed JWT.

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."

Access tokens

Access tokens are how your app gets access to organization and credit resources on ICR.

app access token

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.

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'

installation access token

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".

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' 

delete access token

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

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'

create user and organization

This endpoint allows an app to create a user and an organization under that user. The resulting organization has the app auto installed. This can be useful if a user of an app's website is interacting with credits on ICR but does not have an organization themselves then the app can create a user on ICR for him and an organization. Can especially be useful when finishing a purchase of credits, then the receiver of the credits must be an organization. In this case the marketplace can create the user / organization and deposit the credits there where the end user can claim them at a later date.

curl -X 'POST' \
  'https://api.carbonregistry.com/app/create/user/organization' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer YOUR_JWT"\
  -H 'x-icr-api-version: 2023-06-16' \
  -H 'Content-Type: application/json' \
  -d '{
  "user": {
    "email": "john@gmail.com",
    "fullName": "John Doe",
    "profilePicture": ""
  },
  "organization": {
    "fullName": "Organization 1",
    "type": "other",
    "countryCode": "US"
  }
}'

all app installations

A paginated list of all app installations for this app.

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'

specific app installation

Returns a specific app installation.

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'

Last updated