Content Watcher Service
API Reference
Path Table
| Method | Path | Description |
|---|---|---|
| POST | /v1/scanner/reset | Reset blockchain scan to a specific block number or offset from the current position |
| GET | /v1/scanner/options | Get the current watch options for the blockchain content event scanner |
| POST | /v1/scanner/options | Set watch options to filter the blockchain content scanner by schemas or MSA Ids |
| POST | /v1/scanner/pause | Pause the blockchain scanner |
| POST | /v1/scanner/start | Resume the blockchain content event scanner |
| POST | /v1/search | Search for DSNP content by id and filters, starting from upperBound block and going back for blockCount number of blocks |
| POST | /v1/webhooks | Register a webhook to be called when new content is encountered on the chain |
| DELETE | /v1/webhooks | Clear all previously registered webhooks |
| GET | /v1/webhooks | Get the list of currently registered webhooks |
| GET | /healthz | Check the health status of the service |
| GET | /livez | Check the live status of the service |
| GET | /readyz | Check the ready status of the service |
| GET | /metrics |
Reference Table
| Name | Path | Description |
|---|---|---|
| ResetScannerDto | #/components/schemas/ResetScannerDto | |
| ChainWatchOptionsDto | #/components/schemas/ChainWatchOptionsDto | |
| ContentSearchRequestDto | #/components/schemas/ContentSearchRequestDto | |
| HttpStatus | #/components/schemas/HttpStatus | Status of search response |
| SearchResponseDto | #/components/schemas/SearchResponseDto | |
| AnnouncementTypeName | #/components/schemas/AnnouncementTypeName | Announcement types to send to the webhook |
| WebhookRegistrationDto | #/components/schemas/WebhookRegistrationDto | |
| WebhookRegistrationResponseDto | #/components/schemas/WebhookRegistrationResponseDto |
Path Details
[POST]/v1/scanner/reset
-
Summary
Reset blockchain scan to a specific block number or offset from the current position -
Operation id
ScanControllerV1_resetScanner_v1
RequestBody
- application/json
{
// The block number to reset the scanner to
blockNumber?: number
// Number of blocks to rewind the scanner to (from `blockNumber` if supplied; else from latest block)
rewindOffset?: number
// Whether to schedule the new scan immediately or wait for the next scheduled interval
immediate?: boolean
}
Responses
- 201
[GET]/v1/scanner/options
-
Summary
Get the current watch options for the blockchain content event scanner -
Operation id
ScanControllerV1_getWatchOptions_v1
Responses
- 200
application/json
{
intentIds?: number[]
dsnpIds?: string[]
}
[POST]/v1/scanner/options
-
Summary
Set watch options to filter the blockchain content scanner by schemas or MSA Ids -
Operation id
ScanControllerV1_setWatchOptions_v1
RequestBody
- application/json
{
intentIds?: number[]
dsnpIds?: string[]
}
Responses
- 201
[POST]/v1/scanner/pause
-
Summary
Pause the blockchain scanner -
Operation id
ScanControllerV1_pauseScanner_v1
Responses
- 201
[POST]/v1/scanner/start
-
Summary
Resume the blockchain content event scanner -
Operation id
ScanControllerV1_startScanner_v1
Parameters(Query)
immediate?: boolean
Responses
- 201
[POST]/v1/search
-
Summary
Search for DSNP content by id and filters, starting fromupperBoundblock and going back forblockCountnumber of blocks -
Operation id
SearchControllerV1_search_v1
RequestBody
- application/json
{
// An optional client-supplied reference ID by which it can identify the result of this search
clientReferenceId?: string
// The highest block number to start the backward search from
upperBoundBlock?: number
// The number of blocks to scan (backwards)
blockCount: number
// The schemaIds/dsnpIds to filter by
filters?: #/components/schemas/ChainWatchOptionsDto
// A webhook URL to be notified of the results of this search
webhookUrl: string
}
Responses
- 200 Returns a jobId to be used to retrieve the results
application/json
{
// Status of search response
status: #/components/schemas/HttpStatus
// Job id of search job
jobId: string
}
[POST]/v1/webhooks
-
Summary
Register a webhook to be called when new content is encountered on the chain -
Operation id
WebhookControllerV1_registerWebhook_v1
RequestBody
- application/json
{
// Announcement types to send to the webhook
announcementTypes?: enum[tombstone, broadcast, reply, reaction, profile, update][]
// Webhook URL
url: string
}
Responses
- 201
[DELETE]/v1/webhooks
-
Summary
Clear all previously registered webhooks -
Operation id
WebhookControllerV1_clearAllWebHooks_v1
Responses
- 200
[GET]/v1/webhooks
-
Summary
Get the list of currently registered webhooks -
Operation id
WebhookControllerV1_getRegisteredWebhooks_v1
Responses
- 200 Returns a list of registered webhooks
application/json
{
// Status of webhook registration response
status: #/components/schemas/HttpStatus
registeredWebhooks: {
// Announcement types to send to the webhook
announcementTypes?: enum[tombstone, broadcast, reply, reaction, profile, update][]
// Webhook URL
url: string
}[]
}
[GET]/healthz
-
Summary
Check the health status of the service -
Operation id
HealthController_healthz
Responses
- 200 Service is healthy
[GET]/livez
-
Summary
Check the live status of the service -
Operation id
HealthController_livez
Responses
- 200 Service is live
[GET]/readyz
-
Summary
Check the ready status of the service -
Operation id
HealthController_readyz
Responses
- 200 Service is ready
[GET]/metrics
- Operation id
PrometheusController_index
Responses
- 200
References
#/components/schemas/ResetScannerDto
{
// The block number to reset the scanner to
blockNumber?: number
// Number of blocks to rewind the scanner to (from `blockNumber` if supplied; else from latest block)
rewindOffset?: number
// Whether to schedule the new scan immediately or wait for the next scheduled interval
immediate?: boolean
}
#/components/schemas/ChainWatchOptionsDto
{
intentIds?: number[]
dsnpIds?: string[]
}
#/components/schemas/ContentSearchRequestDto
{
// An optional client-supplied reference ID by which it can identify the result of this search
clientReferenceId?: string
// The highest block number to start the backward search from
upperBoundBlock?: number
// The number of blocks to scan (backwards)
blockCount: number
// The schemaIds/dsnpIds to filter by
filters?: #/components/schemas/ChainWatchOptionsDto
// A webhook URL to be notified of the results of this search
webhookUrl: string
}
#/components/schemas/HttpStatus
// Status of search response
enum[100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 210, 300, 301, 302, 303, 304, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 423, 424, 428, 429, 456, 500, 501, 502, 503, 504, 505, 507, 508]
#/components/schemas/SearchResponseDto
{
// Status of search response
status: #/components/schemas/HttpStatus
// Job id of search job
jobId: string
}
#/components/schemas/AnnouncementTypeName
// Announcement types to send to the webhook
enum[tombstone, broadcast, reply, reaction, profile, update]
#/components/schemas/WebhookRegistrationDto
{
// Announcement types to send to the webhook
announcementTypes?: enum[tombstone, broadcast, reply, reaction, profile, update][]
// Webhook URL
url: string
}
#/components/schemas/WebhookRegistrationResponseDto
{
// Status of webhook registration response
status: #/components/schemas/HttpStatus
registeredWebhooks: {
// Announcement types to send to the webhook
announcementTypes?: enum[tombstone, broadcast, reply, reaction, profile, update][]
// Webhook URL
url: string
}[]
}