Skip to content

Create a Datasource

Terminal window
https://mapi.storyblok.com/v1/spaces/:space_id/datasources

Create a new datasource.

  • :space_id required number

    Numeric ID of a space

  • datasource The Datasource Object

    The datasource object

    Show child properties
    • name required string

      The name a datasource

    • slug required string

      Slug of a datasource

curl "https://mapi.storyblok.com/v1/spaces/656/datasources/" \
-X POST \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"datasource\":{\"name\":\"Labels for Website\",\"slug\":\"labels\"}}"

Request for adding values in a specific dimension.

curl "https://mapi.storyblok.com/v1/spaces/656/datasources/" \
-X POST \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"datasource\":{\"dimensions_attributes\":[{\"entry_value\":\"es\",\"name\":\"Spanish\"},{\"entry_value\":\"de\",\"name\":\"German\"}],\"name\":\"Labels for Website\",\"slug\":\"label\"}}"