---
title: Delete a Task
description: Delete a task using the numeric ID.
url: https://storyblok.com/docs/api/management/tasks/delete-a-task
---

# Delete a Task

DELETE

```html
https://mapi.storyblok.com/v1/spaces/:space_id/tasks/:task_id
```

Delete a task using the numeric ID.

## Path parameters

-   `:space_id` (required) (number)
    
    Numeric ID of a space
    
-   `:task_id` (required) (number)
    
    The task id
    

## Examples

-   cURL
    
    ```shellscript
    curl "https://mapi.storyblok.com/v1/spaces/288868932106293/tasks/124" \
      -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/tasks/124')
      console.log({ response })
    } catch (error) {
      console.log(error)
    }
    ```
    
-   PHP
    
    ```php
    $client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
    
    $client->delete('spaces/288868932106293/tasks/124')->getBody();
    ```
    
-   Java
    
    ```java
    HttpResponse<String> response = Unirest.delete("https://mapi.storyblok.com/v1/spaces/288868932106293/tasks/124")
      .header("Authorization", "YOUR_OAUTH_TOKEN")
      .asString();
    ```
    
-   C#
    
    ```csharp
    var client = new RestClient("https://mapi.storyblok.com/v1/spaces/288868932106293/tasks/124");
    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/tasks/124"
    
    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/tasks/124')
    ```
    
-   Swift
    
    ```swift
    let storyblok = URLSession(storyblok: .mapi(accessToken: .oauth("YOUR_OAUTH_TOKEN")))
    var request = URLRequest(storyblok: storyblok, path: "spaces/288868932106293/tasks/124")
    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/tasks/124")
    
    println(response.body<JsonElement>())
    ```

## Pagination

-   [Previous: Create a Task](/docs/api/management/tasks/create-a-task)
-   [Next: Retrieve a Single Task](/docs/api/management/tasks/retrieve-a-single-task)
