Sub-Accounts

Sub-accounts are a feature of the Dock Certs API that allows Dock enterprise customers to segregate their data within Dock's platform based on their own customers. Each sub-account can have its own keys, organization profiles, credential designs and verification templates conviently organized to help with tracking and auditing of the activity performed by each.

When using a sub-account the root account can set up separate API keys for each sub-account. By using the sub-account specific API key it will ensure all the transactions are attributed to that sub-account.

Create Sub-Account

Parameters

NameInTypeRequiredDescription

body

body

object

true

Subaccount object

ยป name

body

string

true

The sub account name

ยป image

body

string

false

The sub account image

POST /subaccounts REQUEST


curl -X POST https://api-testnet.dock.io/subaccounts \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

Body parameter

{
  "name": "string",
  "image": "string"
}

Responses

StatusMeaningDescriptionSchema

200

Subaccount has been created

400

Error creating subaccount

402

Transaction limit reached or upgrade required to proceed

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "email": "string",
  "image": "string"
}

List Sub-Accounts

Parameters

NameInTypeRequiredDescription

offset

query

integer(int32)

false

How many items to offset by for pagination

limit

query

integer(int32)

false

How many items to return at one time (max 64)

GET /subaccounts REQUEST

Code samples


curl -X GET https://api-testnet.dock.io/subaccounts \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

Responses

StatusMeaningDescriptionSchema

200

A paged array of subaccounts

Example responses

200 Response

[
  {
    "id": 0,
    "name": "string",
    "email": "string",
    "image": "string"
  }
]

Get Sub-Account by ID

Parameters

NameInTypeRequiredDescription

id

path

string

true

An ID

GET /subaccounts/{id} REQUEST

Code samples


curl -X GET https://api-testnet.dock.io/subaccounts/{id} \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

Responses

StatusMeaningDescriptionSchema

200

Expected response to a valid request

400

Error getting subaccount

401

You do not own this subaccount

404

Subaccount was not found

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "email": "string",
  "image": "string"
}

Update the specified sub-account.

Parameters

NameInTypeRequiredDescription

id

path

string

true

An ID

body

body

object

true

Subaccount properties

ยป name

body

string

true

The sub account name

ยป image

body

string

false

The sub account image

PATCH /subaccounts/{id} REQUEST

Code samples


curl -X PATCH https://api-testnet.dock.io/subaccounts/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

Body parameter

{
  "name": "string",
  "image": "string"
}

Responses

StatusMeaningDescriptionSchema

200

Subaccount has been updated

400

Error creating subaccount

401

You do not own this subaccount

402

Transaction limit reached or upgrade required to proceed

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "email": "string",
  "image": "string"
}

Deletes the specified sub-account.

Parameters

NameInTypeRequiredDescription

id

path

string

true

An ID

DELETE /subaccounts/{id} REQUEST

Code samples


curl -X DELETE https://api-testnet.dock.io/subaccounts/{id} \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

Responses

StatusMeaningDescriptionSchema

200

Subaccount deleted

None

400

Error deleting subaccount

401

You do not own this subaccount

404

Subaccount was not found

Example responses

400 Response

{
  "status": 0,
  "type": "string",
  "message": "string"
}

Get Sub-Account Usage

Get details about the activity that this sub-account has performed against the system.

Parameters

NameInTypeRequiredDescription

id

path

string

true

An ID

startTime

query

string(date-time)

false

Timestamp for the start of the range (ISO 8601)

endTime

query

string(date-time)

false

Timestamp for the end of the range (ISO 8601)

offset

query

integer(int32)

false

How many items to offset by for pagination

limit

query

integer(int32)

false

How many items to return at one time (max 64)

GET /subaccounts/{id}/usage REQUEST

Code samples


curl -X GET https://api-testnet.dock.io/subaccounts/{id}/usage \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

Responses

StatusMeaningDescriptionSchema

200

A paged array of subaccount transaction usage metadata

401

You do not own this subaccount

Example responses

200 Response

[
  {}
]

Create Sub-Account API Key

Creates an API key for a subaccount. In order for activity to be associated with the given sub-account an API key needs to be created for that sub-account and then that key must be used for all transactions related to that sub-account.

Parameters

NameInTypeRequiredDescription

id

path

string

true

An ID

body

body

object

false

Subaccount properties

POST /subaccounts/{id}/keys REQUEST

Code samples


curl -X POST https://api-testnet.dock.io/subaccounts/{id}/keys \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

Body parameter

{}

Responses

StatusMeaningDescriptionSchema

200

Subaccount API key created

400

Error creating subaccount API key

401

You do not own this subaccount

402

Transaction limit reached or upgrade required to proceed

Example responses

200 Response

{
  "code": 0
}

List Sub-Account API Keys

Parameters

NameInTypeRequiredDescription

id

path

string

true

An ID

offset

query

integer(int32)

false

How many items to offset by for pagination

limit

query

integer(int32)

false

How many items to return at one time (max 64)

GET /subaccounts/{id}/keys REQUEST

Code samples


curl -X GET https://api-testnet.dock.io/subaccounts/{id}/keys \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

Responses

StatusMeaningDescriptionSchema

200

A paged array of subaccount key metadata

401

You do not own this subaccount

Example responses

200 Response

[
  {}
]

Delete a Sub-Account API Key

Delete the specified API key for the given sub-account.

Parameters

NameInTypeRequiredDescription

id

path

string

true

An ID

keyId

path

string

true

An API key ID

DELETE /subaccounts/{id}/keys/{keyId} REQUEST

Code samples


curl -X DELETE https://api-testnet.dock.io/subaccounts/{id}/keys/{keyId} \
  -H 'Accept: application/json' \
  -H 'DOCK-API-TOKEN: API_KEY'

Responses

StatusMeaningDescriptionSchema

200

Subaccount API key deleted

None

400

Error deleting subaccount API key

401

You do not own this subaccount

404

Subaccount API key was not found

Example responses

400 Response

{
  "status": 0,
  "type": "string",
  "message": "string"
}

Last updated