Skip to content

Create a Discussion

Terminal window
https://mapi.storyblok.com/v1/spaces/space_id/stories/story_id/discussions

This endpoint creates a new discussion.

  • :space_id required number

    Numeric ID of a space

  • :story_id required number

    ID of the story

  • comment required object

    The comment is an object in the discussion that contains a message_json array object.

    Show message_json properties The message_json property is an array containing JSON objects representing the comments’ messages.

    • text string

      The text part

    • type string

      The type

    • attrs object

      Attributes

  • lang string

    Language code to add the discussion to.

  • title required string

    Title of the discussion field.

  • fieldname string

    Technical name of the discussion field

  • block_uid required string

    The ID of discussion block.

  • component string

    The component/block name to which the discussion belongs to

curl "https://mapi.storyblok.com/v1/spaces/606/stories/12367/discussions" \
-X POST \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"discussion\":{\"block_uid\":\"f7bd92e3-b309-4441-a8a0-654e499fefc8\",\"comment\":{\"message_json\":[{\"text\":\"this is a comment \",\"type\":\"text\"},{\"attrs\":{\"id\":99734,\"label\":\"Fortune Ikechi\"},\"type\":\"mention\"}]},\"component\":\"feature\",\"fieldname\":\"name\",\"lang\":\"default\",\"title\":\"Name\"}}"

You will receive a discussions object as a response.