Managing Datasources

Get all datasources

Endpoint

GET /v1/spaces/:space_id/datasources

Parameters

Name Description
search required Search term

Request

Query Parameters

search=Bb7tHh1w

cURL

curl "https://api.storyblok.com/v1/spaces/665/datasources?search=Bb7tHh1w" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxMDg5LCJ0aW1lc3RhbXAiOjE1NDI0Njg3OTV9.P9eJCZ-p704iC0z7u9UTK13CLnJW7V5e4oH-2XyLES0" \

Response

Body

{
  "datasources": [
    {
      "id": 91,
      "name": "Bb7tHh1w",
      "slug": "H70c19T2F",
      "dimensions": [

      ]
    }
  ]
}

Get a single datasource

Endpoint

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

Request

cURL

curl "https://api.storyblok.com/v1/spaces/666/datasources/93" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxMDkwLCJ0aW1lc3RhbXAiOjE1NDI0Njg3OTV9.43zvy1Ll0SaJrGNpfn0ovyre0IOeG9Irod9VxWOfePA" \

Response

Body

{
  "datasource": {
    "id": 93,
    "name": "4v5qUwXn0",
    "slug": "YnWj42FfN",
    "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/663/datasources" -d '{"datasource":{"name":"My Datasource","slug":"mydatasource"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxMDg3LCJ0aW1lc3RhbXAiOjE1NDI0Njg3OTV9.-ZTMhWXnNTLj-3aMMxRAwmtfgC_GPKZtimNDxYosqfw" \

Response

Body

{
  "datasource": {
    "id": 88,
    "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/664/datasources/90" -d '{"datasource":{"name":"My Datasource","slug":"mydatasource1"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxMDg4LCJ0aW1lc3RhbXAiOjE1NDI0Njg3OTV9.LWSUcPhe9PaUOqHGy5WBEMRjZwnQFjaQxTz76-SVe6E" \

Response

Body

{
  "datasource": {
    "id": 90,
    "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/667/datasources/95" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxMDkxLCJ0aW1lc3RhbXAiOjE1NDI0Njg3OTV9.Ccmil9bZxu42Yb8vGO97FqHOgGj3jXL6JhLci3MsF-U" \

Response

Body

Documentation