Skip to content

Create a notarization

Category: Notarization

Description: Creates a notarization for a specific hash on a designated blockchain.

Type: POST

URL: /notarize

Requirements

  • A valid API Key must be provided (header Authorization: Bearer <API_KEY>)
  • The Notarization module must be enabled for the project

Body Params (INotarizeRequest)

NameTypeDescriptionRequired
notarizationHashstringThe hash to be notarized
chainIdstring | numberThe target blockchain ID (chain) where the notarization will be recorded
namestringOptional name to identify the notarization
metadatastringOptional additional metadata
webhookDataobjectOptional data to be sent to the webhook

Response

ts
type NotarizeResponse = {
  taskId: string; // Task ID for asynchronous notarization tracking
};

Error Handling

HTTP StatusMeaning
200Notarization created successfully
513Insufficient Credits
515Parameter validation error
512Internal server error

Code Examples

Installation

tsx
npm i node-fetch

Request

tsx
// data: INotarizeRequest
const url = `${this.backendUrl}/notarize`;
let config = {
  method: "post",
  maxBodyLength: Infinity,
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${this.apiKey}`,
  },
  body: JSON.stringify(data),
};

const response = await fetch(url, config);
const JSONResponse = await response.json();