SDK Reference


Allow users to edit their posts.

Only users who created the post can call this function.

How to use?

const res = await orbis.editPost(post_id, content, encryptionRules);


  • post_id - (stream) ID of the post to edit
  • content - A JSON object that contains the details of the post being shared
    • body - string Content of the post being shared
    • title - string optional Title of the post (can be used for articles)
    • context - string optional Context in which the post is being shared. Can be a random string or a group / channel id
    • master - string optional If the post is being shared as a comment of a post
    • reply_to - string optional If the post shared is a reply to another comment in a thread
    • mentions - array optional Array of mentions if this post is mentioning other users, the array items must contain:
      • did - string Did of the user being mentioned
      • username - string Current username of the user
    • tags - array optional Array of tags that can be used to filter posts in queries:
      • slug - string Identifier for the tag (used in queries)
      • title - string Title that can be displayed in the app for example
    • media - array optional An array of media objects stored on IPFS
      • url - string media URL must start with ipfs://
      • gateway - string URL of the IPFS gateway where the media is stored
    • data - object optional Can be used to attach some custom data to a post
  • encryptionRules - object optional A JSON object containing the optional encryption rules for this post.
    • type - string The type of encryption needed, can be token-gated or custom for now.
      • token-gated(Token-gated posts):
        • chain - string The chain on which the smart contract is. Must be one of those in lowercase
        • contractType - string The type of contract being used, must be ERC20, ERC721 or ERC1155.
        • contractAddress - string The address of the contract.
        • minTokenBalance - string The minimum balance required to decrypt the post (in WEI for ERC20).
        • tokenId - string optional Used only for ERC1155 tokens to represent the tokenId used.
      • custom (Custom encryption rules):
        • accessControlConditions - object The custom Lit access control conditions you want to use to encrypt this post.


  status: 200,
  result: "Success updating TileDocument."