Managing Datasources

Get all datasources

Endpoint

GET /v1/spaces/:space_id/datasources

Parameters

Name Description
search required Search term

Request

Query Parameters

search=Xz0yJrR2I

cURL

curl "https://api.storyblok.com/v1/spaces/598/datasources?search=Xz0yJrR2I" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo4NDYsInRpbWVzdGFtcCI6MTUzMjY4MDQ4M30.E-zrCX3tWfIKcB-3wdcDMDZIY-7V8BopVx2IxNRJnaE" \

Response

Body

{
  "datasources": [
    {
      "id": 113,
      "name": "Xz0yJrR2I",
      "slug": "H6Tg1aXt5",
      "dimensions": [

      ]
    }
  ]
}

Get a single datasource

Endpoint

GET /v1/spaces/:space_id/datasources/:id

Request

cURL

curl "https://api.storyblok.com/v1/spaces/599/datasources/115" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo4NDcsInRpbWVzdGFtcCI6MTUzMjY4MDQ4M30.VC9GU8iWZJmV2vvG5YyP3bZDCwlbnFwJ0Z9D_Gn62Gk" \

Response

Body

{
  "datasource": {
    "id": 115,
    "name": "9wL5S233H",
    "slug": "MuNx0hKe",
    "dimensions": [

    ]
  }
}

Create a datasource

Endpoint

POST /v1/spaces/:space_id/datasources

Parameters

Name Description
datasource[name] required Name of the datasource
datasource[slug] required Slug of the datasource

Request

cURL

curl "https://api.storyblok.com/v1/spaces/596/datasources" -d '{"datasource":{"name":"My Datasource","slug":"mydatasource"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo4NDQsInRpbWVzdGFtcCI6MTUzMjY4MDQ4M30.Vv0zAiIUeBlTv11Rhn8yd0NEhTpLPFoNLtyPh9Ggf4A" \

Response

Body

{
  "datasource": {
    "id": 110,
    "name": "My Datasource",
    "slug": "mydatasource",
    "dimensions": [

    ]
  }
}

Updating a datasource

Endpoint

PUT /v1/spaces/:space_id/datasources/:id

Parameters

Name Description
datasource[name] required Name of the datasource
datasource[slug] required Slug of the datasource

Request

cURL

curl "https://api.storyblok.com/v1/spaces/597/datasources/112" -d '{"datasource":{"name":"My Datasource","slug":"mydatasource1"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo4NDUsInRpbWVzdGFtcCI6MTUzMjY4MDQ4M30.mXRw6zzOlqjF-BLj3rk8kjZeoptizIYwFgeetwJmevE" \

Response

Body

{
  "datasource": {
    "id": 112,
    "name": "My Datasource",
    "slug": "mydatasource1",
    "dimensions": [

    ]
  }
}

Deleting a datasource

Endpoint

DELETE /v1/spaces/:space_id/datasources/:id

Request

cURL

curl "https://api.storyblok.com/v1/spaces/600/datasources/117" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo4NDgsInRpbWVzdGFtcCI6MTUzMjY4MDQ4M30.TEr2qlPE7iHCQTI9WNbyk2ERB2jyKQFKbxPq_XzUG8g" \

Response

Body

Documentation