Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Content Watcher Service

API Reference

Open Full API Reference Page

Path Table

MethodPathDescription
POST/v1/scanner/resetReset blockchain scan to a specific block number or offset from the current position
GET/v1/scanner/optionsGet the current watch options for the blockchain content event scanner
POST/v1/scanner/optionsSet watch options to filter the blockchain content scanner by schemas or MSA Ids
POST/v1/scanner/pausePause the blockchain scanner
POST/v1/scanner/startResume the blockchain content event scanner
POST/v1/searchSearch for DSNP content by id and filters, starting from upperBound block and going back for blockCount number of blocks
POST/v1/webhooksRegister a webhook to be called when new content is encountered on the chain
DELETE/v1/webhooksClear all previously registered webhooks
GET/v1/webhooksGet the list of currently registered webhooks
GET/healthzCheck the health status of the service
GET/livezCheck the live status of the service
GET/readyzCheck the ready status of the service
GET/metrics

Reference Table

NamePathDescription
ResetScannerDto#/components/schemas/ResetScannerDto
ChainWatchOptionsDto#/components/schemas/ChainWatchOptionsDto
ContentSearchRequestDto#/components/schemas/ContentSearchRequestDto
HttpStatus#/components/schemas/HttpStatusStatus of search response
SearchResponseDto#/components/schemas/SearchResponseDto
AnnouncementTypeName#/components/schemas/AnnouncementTypeNameAnnouncement 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 from upperBound block and going back for blockCount number 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
  }[]
}