Skip to main content

Submit a message.

POST 

/api/v1/messages

Submit a message. The node takes care of missing fields and tries to build the message. On success, the message will be stored in the Tangle. This endpoint will return the identifier of the built message. The node will try to auto-fill the following fields in case they are missing: networkId, parentMessageIds, nonce. If payload is missing, the message will be built without a payload.

Request

Body

required
    networkId string

    Network identifier. This field signifies for which network the message is meant for. It also tells which protocol rules apply to the message. It is computed out of the first 8 bytes of the BLAKE2b-256 hash of the concatenation of the network type and protocol version string.

    parentMessageIds string[]

    The identifiers of the messages this message references.

    payload object
    oneOf
    type integerrequired

    Set to value 0 to denote a Transaction Payload.

    essence objectrequired
    oneOf
    type integerrequired

    Set to value 0 to denote a Transaction Essence.

    inputs object[]required
  • Array [
  • oneOf
    type integerrequired

    Set to value 0 to denote an UTXO Input.

    transactionId stringrequired

    The BLAKE2b-256 hash of the transaction from which the UTXO comes from.

    transactionOutputIndex integerrequired

    The index of the output on the referenced transaction to consume.

  • ]
  • outputs object[]required
  • Array [
  • anyOf
    type integerrequired

    Set to value 0 to denote a SigLockedSingleOutput.

    address objectrequired
    anyOf
    type integerrequired

    Set to value 0 to denote an Ed25519 Address.

    address stringrequired

    The hex-encoded BLAKE2b-256 hash of the Ed25519 public key.

    amount integerrequired

    The amount of tokens to deposit with this SigLockedSingleOutput output.

  • ]
  • payload objectnullablerequired
    oneOf
    type integerrequired

    Set to value 2 to denote a Indexation Payload.

    index stringrequired

    The indexation key to find/look up this message. It has a size between 1 and 64 bytes and must be encoded as a hex-string.

    data stringrequired

    The optional data to attach. This may have a length of 0.

    unlockBlocks object[]required
  • Array [
  • oneOf
    type integerrequired

    Denotes a Signature Unlock Block.

    signature objectrequired
    oneOf
    type integerrequired

    Set to value 0 to denote an Ed25519 Signature.

    publicKey stringrequired

    The public key of the Ed25519 keypair which is used to verify the signature.

    signature stringrequired

    The signature signing the serialized Transaction Essence.

  • ]
  • nonce string

    The nonce which lets this message fulfill the Proof-of-Work requirement.

Responses

Successful operation.

Schema
    data objectrequired
    messageId stringrequired

    The message identifier of the submitted message.

Loading...