Gatekeeper API
Response samples
- 200
{- "uptimeSeconds": 0,
- "dids": {
- "total": 0,
- "byType": {
- "agents": 0,
- "assets": 0,
- "confirmed": 0,
- "unconfirmed": 0,
- "ephemeral": 0,
- "invalid": 0
}, - "byRegistry": {
- "property1": 0,
- "property2": 0
}, - "byVersion": {
- "property1": 0,
- "property2": 0
}, - "eventsQueue": { }
}, - "memoryUsage": {
- "rss": 0,
- "heapTotal": 0,
- "heapUsed": 0,
- "external": 0,
- "arrayBuffers": 0
}
}
Create, update, or delete a DID
Request Body schema: application/jsonrequired
type required | string Value: "create" Must be "create" to create a new DID. |
created required | string <date-time> Timestamp of when the operation was created. |
required | object MDIP metadata fields for creation. |
required | object Cryptographic signature verifying the create operation. |
publicJwk | object Required if mdip.type = "agent". Contains the public key in JWK format. |
controller | string Required if mdip.type = "asset". Must match the |
Responses
Request samples
- Payload
{- "type": "delete",
- "did": "string",
- "signature": {
- "value": "string",
- "signed": "2019-08-24T14:15:22Z",
- "signer": "string",
- "hash": "string"
}
}
Response samples
- 500
"string"
Resolve a DID Document
path Parameters
did required | string The DID to resolve. |
query Parameters
atTime | string <date-time> Timestamp to return the state of the DID as of this specific time. |
atVersion | integer Specific version of the DID Document to retrieve. Versioning increments each time an |
confirm | boolean If |
verify | boolean If |
Responses
Response samples
- 200
- 404
{- "@context": "string",
- "didDocument": {
- "@context": [
- "string"
], - "id": "string",
- "controller": "string",
- "verificationMethod": [
- {
- "id": "string",
- "controller": "string",
- "type": "string",
- "publicKeyJwk": { }
}
], - "authentication": [
- "string"
]
}, - "didDocumentMetadata": {
- "created": "2019-08-24T14:15:22Z",
- "updated": "2019-08-24T14:15:22Z",
- "deleted": "2019-08-24T14:15:22Z",
- "version": 0,
- "versionId": "string",
- "canonicalId": "string",
- "confirmed": true,
- "deactivated": true
}, - "didDocumentData": { },
- "mdip": {
- "type": "agent",
- "registry": "local",
- "version": 0,
- "validUntil": "2019-08-24T14:15:22Z",
- "registration": "string"
}
}
Update an existing DID (deprecated) Deprecated
path Parameters
did required | string The DID to update. |
Request Body schema: application/jsonrequired
type required | string Value: "update" Must be |
did required | string The DID being updated. Must match the path parameter |
doc | object The updated DID Document or subset of data for this DID. |
previd | string Reference to the previous version. |
signature required | object Cryptographic signature. |
Responses
Request samples
- Payload
{- "type": "update",
- "did": "string",
- "doc": { },
- "previd": "string",
- "signature": { }
}
Response samples
- 200
- 500
true
Delete a DID (deprecated) Deprecated
path Parameters
did required | string The DID to delete. |
Request Body schema: application/jsonrequired
type required | string Value: "delete" Must be "delete" to deactivate the DID. |
did required | string The DID being deleted. |
signature required | object Cryptographic signature. |
previd | string Reference to the previous version. |
Responses
Request samples
- Payload
{- "type": "delete",
- "did": "string",
- "signature": { },
- "previd": "string"
}
Response samples
- 200
true
Retrieve a list of DIDs or DID Documents.
Request Body schema: application/jsonoptional
dids | Array of strings A list of specific DIDs to check. If omitted, all known DIDs are retrieved. |
updatedAfter | string <date-time> Only return DIDs/DID Docs updated after this time. |
updatedBefore | string <date-time> Only return DIDs/DID Docs updated before this time. |
confirm | boolean If true, only return DID Docs that are fully confirmed. |
verify | boolean If true, verifies signatures during DID resolution. If signature checks fail, an error is thrown. |
resolve | boolean If true, return DID Documents instead of just string identifiers. |
Responses
Request samples
- Payload
{- "dids": [
- "string"
], - "updatedAfter": "2019-08-24T14:15:22Z",
- "updatedBefore": "2019-08-24T14:15:22Z",
- "confirm": true,
- "verify": true,
- "resolve": true
}
Response samples
- 200
- 500
[ ]
Export events for one or more DIDs
Request Body schema: application/jsonoptional
dids | Array of strings A list of DIDs to export. If omitted, all known DIDs are exported. |
Responses
Request samples
- Payload
{- "dids": [
- "string"
]
}
Response samples
- 200
- 500
[- [
- {
- "registry": "string",
- "time": "2019-08-24T14:15:22Z",
- "ordinal": 0,
- "operation": { },
- "did": "string"
}
]
]
Import one or more DIDs
Request Body schema: application/jsonrequired
did required | string The DID these events belong to. |
required | object The DID operation including signatures and other data. |
registry required | string The registry this event belongs to. |
time required | string <date-time> Timestamp when this event was recorded. |
integer or Array of integers |
Responses
Request samples
- Payload
[- [
- {
- "did": "string",
- "operation": {
- "type": "string",
- "created": "2019-08-24T14:15:22Z",
- "mdip": { },
- "publicJwk": { },
- "signature": { }
}, - "registry": "string",
- "time": "2019-08-24T14:15:22Z",
- "ordinal": 0
}
]
]
Response samples
- 200
- 500
{- "queued": 0,
- "processed": 0,
- "rejected": 0,
- "total": 0
}
Export non-local DID events in a single sorted batch
Request Body schema: application/jsonoptional
dids | Array of strings A list of DIDs to export. If omitted, all known DIDs are used for exporting. |
Responses
Request samples
- Payload
{- "dids": [
- "string"
]
}
Response samples
- 200
- 500
[- {
- "registry": "string",
- "time": "2019-08-24T14:15:22Z",
- "ordinal": 0,
- "operation": {
- "type": "string",
- "did": "string",
- "signature": { }
}, - "did": "string"
}
]
Import a batch of DID events
Request Body schema: application/jsonrequired
did required | string The DID to which this event pertains. |
required | object A DID operation, such as "create", "update", or "delete". |
registry required | string The registry to which this event belongs. |
time required | string <date-time> Timestamp when the event was recorded. |
integer or Array of integers |
Responses
Request samples
- Payload
[- {
- "did": "string",
- "operation": {
- "type": "create",
- "created": "2019-08-24T14:15:22Z",
- "mdip": { },
- "publicJwk": { },
- "signature": { }
}, - "registry": "local",
- "time": "2019-08-24T14:15:22Z",
- "ordinal": 0
}
]
Response samples
- 200
- 500
{- "queued": 0,
- "processed": 0,
- "rejected": 0,
- "total": 0
}
Retrieve the queued events for a specific registry
path Parameters
registry required | string The name of the registry whose queue is being retrieved. Valid values may include "local", "hyperswarm", "TBTC", "TFTC", etc. |
Responses
Response samples
- 200
- 500
[- {
- "registry": "string",
- "time": "2019-08-24T14:15:22Z",
- "ordinal": 0,
- "operation": {
- "type": "string",
- "did": "string",
- "signature": { }
}, - "did": "string"
}
]
Remove specified DIDs from the queue
path Parameters
registry required | string The name of the registry from which events will be cleared. Must be a valid, supported registry. |
Request Body schema: application/jsonrequired
type required | string The operation type. |
did required | string The DID targeted by this operation. |
doc | object The (optional) DID document content, present if type is "update" or "create" with doc data. |
previd | string Reference to the previous version (optional). |
signature required | object Cryptographic signature. |
Responses
Request samples
- Payload
[- {
- "type": "string",
- "did": "string",
- "doc": { },
- "previd": "string",
- "signature": { }
}
]
Response samples
- 200
- 500
[- { }
]
Process queued events
Iterates over all queued events, importing them if they are valid (adding or merging). Continues until no more new events can be processed. If processEvents
is already running, it may return { busy: true }
to indicate that processing is in progress.
Responses
Response samples
- 200
- 500
{- "added": 0,
- "merged": 0,
- "rejected": 0,
- "pending": 0
}
Retrieve a specific block for a given registry
path Parameters
registry required | string The name of the registry to retrieve the block from. |
required | string or integer The identifier of the block to retrieve. Can be either a block hash (string) or a block height (integer). |
Responses
Response samples
- 200
- 500
{- "hash": "string",
- "height": 0,
- "time": 0,
- "timeISO": "2019-08-24T14:15:22Z"
}
Add a new block to a specific registry
path Parameters
registry required | string The name of the registry to which the block will be added. |
Request Body schema: application/jsonrequired
hash required | string The hash of the block. |
height required | integer The height of the block. |
time required | integer The timestamp of the block in seconds since the Unix epoch. |
Responses
Request samples
- Payload
{- "hash": "string",
- "height": 0,
- "time": 0
}
Response samples
- 200
- 500
true