Managing Datasources

Get all datasources

Endpoint

GET /v1/spaces/:space_id/datasources

Parameters

Name Description
search required Search term

Request

Query Parameters

search=ScArD6WgR

cURL

curl "https://api.storyblok.com/v1/spaces/895/datasources?search=ScArD6WgR" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxNzU0LCJ0aW1lc3RhbXAiOjE1MzkzMzM5NzR9.66dYk7he8xacWU-isjAAraQ0Rfsb1RYk5eP-pcIY9zw" \

Response

Body

{
  "datasources": [
    {
      "id": 71,
      "name": "ScArD6WgR",
      "slug": "Dg8hYrPd",
      "dimensions": [

      ]
    }
  ]
}

Get a single datasource

Endpoint

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

Request

cURL

curl "https://api.storyblok.com/v1/spaces/896/datasources/73" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxNzU1LCJ0aW1lc3RhbXAiOjE1MzkzMzM5NzR9.aoZ8tsXZDMBWGYQIMR5I2rfZRJB6tKwYRoAGBy9SGGk" \

Response

Body

{
  "datasource": {
    "id": 73,
    "name": "QhVvP7DzF",
    "slug": "E0LrF0Dq1",
    "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/893/datasources" -d '{"datasource":{"name":"My Datasource","slug":"mydatasource"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxNzUyLCJ0aW1lc3RhbXAiOjE1MzkzMzM5NzR9.w_Jcex98zfvjYJQqjy7kUkBbJh0R9r8ySAhO29hzonc" \

Response

Body

{
  "datasource": {
    "id": 68,
    "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/894/datasources/70" -d '{"datasource":{"name":"My Datasource","slug":"mydatasource1"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxNzUzLCJ0aW1lc3RhbXAiOjE1MzkzMzM5NzR9.gYTgxYMBRUdBJ-fSn1FgzcOZbyuL2QhvYMxe6VQV81U" \

Response

Body

{
  "datasource": {
    "id": 70,
    "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/897/datasources/75" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxNzU2LCJ0aW1lc3RhbXAiOjE1MzkzMzM5NzR9.99xgwlQI2j-O4-S4MgdkegA1jj-Ax4qOMypraWYPcVM" \

Response

Body

Documentation