
## Delete a time-tracking entry

`DELETE /v1/tasks/:taskId/time/:itemId`

Deletes a time-tracking entry. It cannot be restored via the API — create a new one if needed.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `taskId` (path) | number | yes | Task ID |
| `itemId` (path) | number | yes | Time-tracking entry ID |

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/tasks/289/time/161" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/tasks/289/time/161" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks/289/time/161', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

if (res.status === 204) {
  console.log('Entry deleted')
}
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks/289/time/161', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

if (res.status === 204) {
  console.log('Deleted')
}
```

## Response

A successful deletion returns HTTP status `204 No Content` with an empty body — check the status code to confirm success.

## Response example

```
HTTP/1.1 204 No Content
```

## Error response example

404 — the entry was not found or is inaccessible:

```json
{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "Time entry not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `NOT_FOUND` | An entry with this `itemId` was not found (including if it or the parent task has already been deleted) |
| 403 | `SCOPE_DENIED` | The API key lacks the `task` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

Full list of common API errors — [Errors](/docs/errors).

## See also

- [List time-tracking entries](./list.md)
- [Get a time-tracking entry](./get.md)
- [Update a time-tracking entry](./update.md)
- [Tasks](/docs/entities/tasks)
