---
title: Delete a Datasource
description: Delete a datasource using its numeric ID
url: https://storyblok.com/docs/api/management/datasources/delete-a-datasource
---

# Delete a Datasource

DELETE

```html
https://mapi.storyblok.com/v1/spaces/:space_id/datasources/:datasource_id
```

Delete a datasource using its numeric ID.

## Path parameters

-   `:space_id` (required) (number)
    
    Numeric ID of a space
    
-   `:datasource_id` (required) (number)
    
    Numeric ID of a datasource
    

## Examples

-   cURL
    
    ```shellscript
    curl "https://mapi.storyblok.com/v1/spaces/288868932106293/datasources/91" \
      -X DELETE \
      -H "Authorization: YOUR_OAUTH_TOKEN"
    ```
    
-   JS
    
    ```javascript
    // storyblok-js-client@>=7, node@>=18
    import Storyblok from "storyblok-js-client";
    
    const storyblok = new Storyblok({
      oauthToken: "YOUR_PERSONAL_ACCESS_TOKEN",
    });
    
    try {
      const response = await storyblok.delete('spaces/288868932106293/datasources/91')
      console.log({ response })
    } catch (error) {
      console.log(error)
    }
    ```
    
-   PHP
    
    ```php
    $client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
    
    $client->delete('spaces/288868932106293/datasources/91')->getBody();
    ```
    
-   Java
    
    ```java
    HttpResponse<String> response = Unirest.delete("https://mapi.storyblok.com/v1/spaces/288868932106293/datasources/91")
      .header("Authorization", "YOUR_OAUTH_TOKEN")
      .asString();
    ```
    
-   C#
    
    ```csharp
    var client = new RestClient("https://mapi.storyblok.com/v1/spaces/288868932106293/datasources/91");
    var request = new RestRequest(Method.DELETE);
    
    request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
    IRestResponse response = client.Execute(request);
    ```
    
-   Python
    
    ```python
    import requests
    
    url = "https://mapi.storyblok.com/v1/spaces/288868932106293/datasources/91"
    
    querystring = {}
    
    payload = ""
    headers = {
      'Authorization': "YOUR_OAUTH_TOKEN"
    }
    
    response = requests.request("DELETE", url, data=payload, headers=headers, params=querystring)
    
    print(response.text)
    ```
    
-   Ruby
    
    ```ruby
    require 'storyblok'
    client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
    
    client.delete('spaces/288868932106293/datasources/91')
    ```
    
-   Swift
    
    ```swift
    let storyblok = URLSession(storyblok: .mapi(accessToken: .oauth("YOUR_OAUTH_TOKEN")))
    var request = URLRequest(storyblok: storyblok, path: "spaces/288868932106293/datasources/91")
    request.httpMethod = "DELETE"
    let (data, _) = try await storyblok.data(for: request)
    print(try JSONSerialization.jsonObject(with: data))
    ```
    
-   Kotlin
    
    ```kotlin
    val client = HttpClient {
        install(Storyblok(MAPI)) {
            accessToken = OAuth("YOUR_OAUTH_TOKEN")
        }
    }
    
    val response = client.delete("spaces/288868932106293/datasources/91")
    
    println(response.body<JsonElement>())
    ```

## Pagination

-   [Previous: Create a Datasource](/docs/api/management/datasources/create-a-datasource)
-   [Next: Retrieve a Single Datasource](/docs/api/management/datasources/retrieve-a-single-datasource)
