Subaccounts

Endpoints for managing entity's subaccounts

Get accounts for an entity

get

Returns a list of all the subaccounts this entity owns.

Authorizations
Path parameters
idstringRequired

Entity ID

Responses
200Success
application/json
get
GET /v1/{id}/accounts HTTP/1.1
Host: api.carbonregistry.com
Authorization: Bearer <token>
Accept: */*
200Success
{
  "accounts": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "type": "default",
      "name": "Default",
      "address": "0x32Be343B94f860124dC4fEe278FDCBD38C102D88",
      "ownerId": "550e8400-e29b-41d4-a716-446655440000"
    }
  ]
}

Create a new subaccount for an entity

post
Authorizations
Path parameters
idstringRequired

Entity ID

Body
namestringRequired

The name associated with this subaccount

Example: Customer 1 account
Responses
200Success
application/json
post
POST /v1/{id}/accounts HTTP/1.1
Host: api.carbonregistry.com
Authorization: Bearer <token>
Content-Type: application/json
Accept: */*
Content-Length: 29

{
  "name": "Customer 1 account"
}
200Success
{
  "account": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "default",
    "name": "Default",
    "address": "0x32Be343B94f860124dC4fEe278FDCBD38C102D88",
    "ownerId": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Delete an account for an entity

delete
Authorizations
Path parameters
idstringRequired

Entity ID

accIdstringRequired

Subaccount ID to delete

Responses
200Success
application/json
delete
DELETE /v1/{id}/accounts/{accId} HTTP/1.1
Host: api.carbonregistry.com
Authorization: Bearer <token>
Accept: */*
200Success
{
  "account": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "default",
    "name": "Default",
    "address": "0x32Be343B94f860124dC4fEe278FDCBD38C102D88",
    "ownerId": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Last updated