Skip to main content
The Message API lets you validate and submit signed Farcaster protocol messages to the Hub. Note that the message has to be sent as the encoded bytestream of the protobuf (Message.encode(msg).finish() in typescript), as POST data to the endpoint. The encoding of the POST data has to be set to application/octet-stream. The endpoint returns the Message object as JSON if it was successfully submitted or validated

submitMessage

Submit a signed protobuf-serialized message to the Hub Query Parameters Example
Response

submitBulkMessages

Submit several signed protobuf-serialized messages to the Hub at once. Each one will be submitted to the node sequentially. Query Parameters Example
Response

Auth

If the rpc auth has been enabled on the server (using --rpc-auth username:password), you will need to also pass in the username and password while calling submitMessage or submitBulkMessages using HTTP Basic Auth. Example
JS Example

validateMessage

Validate a signed protobuf-serialized message with the Hub. This can be used to verify that the hub will consider the message valid. Or to validate message that cannot be submitted (e.g. Frame actions)
The hub validates the following for all messages:
  • The fid is registered
  • The signer is active and registered to the fid
  • The message hash is correct
  • The signature is valid and corresponds to the signer
  • Any other message specific validation
For FrameAction messages, note that the hub does not validate the castId is actually an existing cast. Nor does it validate the frame url matches the embedded url in the cast. Make sure to check for this if it’s important for your application.
Query Parameters Example
Response

Using with Rust, Go or other programming languages

Messages need to be signed with a Ed25519 account key belonging to the FID. If you are using a different programming language than Typescript, you can manually construct the MessageData object and serialize it to the data_bytes field of the message. Then, use the data_bytes to compute the hash and signature. Please see the rust-submitmessage example for more details