# Delete a team

DELETE`/v1/teams/{team_id}`[Token scope: `teams:write`](https://developers.tasksmate.indrasol.com/guides/authentication/#scopes)

Request

**curl**


```bash
curl -X DELETE "https://tasksmate-fdfsarhnf5gacfb7.eastus-01.azurewebsites.net/v1/teams/<team_id>" \
  -H "Authorization: Bearer $TASKSMATE_TOKEN"
```

**Python**


```python
from tasksmate import TasksMate

tm = TasksMate()  # reads TASKSMATE_TOKEN
result = tm.teams.delete("<team_id>")
print(result)
```

Response 200

```json
{
  "ok": false,
  "team_id": "string",
  "detached_projects": 0,
  "detached_tasks": 0
}
```

SOFT delete (`is_active = false`; the team disappears from lists, its id stays valid for history). Never deletes a project or a task.

## Authorizations

-   **[bearerAuth](https://developers.tasksmate.indrasol.com/reference/#bearerauth)**
-   **[TasksMateToken](https://developers.tasksmate.indrasol.com/reference/#tasksmatetoken)**

## Parameters

### Path Parameters

**team\_id**

required

_Team Id_

string

### Query Parameters

**detach**

_Detach_

First unfile everything filed under the team (its projects and tasks lose their `team_id`); without it the delete is refused (409) while anything is still filed under the team.

boolean

First unfile everything filed under the team (its projects and tasks lose their `team_id`); without it the delete is refused (409) while anything is still filed under the team.

**reason**

Any of:

**string**


string

**null**


null

### Header Parameters

**If-Match**

string

The `ETag` you read; a stale one is a 412 and nothing is written.

## Responses

### 200

Successful Response

application/json

_TeamDeleted_

Returned by `teams.delete`.

object

**ok**

required

_Ok_

boolean

**team\_id**

required

_Team Id_

string

**detached\_projects**

required

_Detached Projects_

Projects unfiled from the team (`detach=true`), else 0

integer

**detached\_tasks**

required

_Detached Tasks_

Tasks unfiled from the team (`detach=true`), else 0

integer

Example

```json
{
  "ok": false,
  "team_id": "string",
  "detached_projects": 0,
  "detached_tasks": 0
}
```

### 400

Bad request — a query parameter outside what the operation accepts (`invalid-parameter`)

application/problem+json

_Problem_

An RFC 9457 problem details object — the body of every error response. `detail` is the human-readable explanation; `request_id` identifies the request for support.

object

**type**

required

`about:blank` or a `urn:tasksmate:problem:*` identifier

string

Allowed values: about:blank urn:tasksmate:problem:validation urn:tasksmate:problem:invalid-parameter urn:tasksmate:problem:precondition-failed urn:tasksmate:problem:idempotency-key-reused urn:tasksmate:problem:idempotency-key-in-flight urn:tasksmate:problem:idempotency-key-invalid urn:tasksmate:problem:rate-limit urn:tasksmate:problem:internal urn:tasksmate:problem:token-invalid urn:tasksmate:problem:token-expired urn:tasksmate:problem:token-revoked urn:tasksmate:problem:insufficient-scope urn:tasksmate:problem:test-token-read-only urn:tasksmate:problem:token-policy urn:tasksmate:problem:url-refused

**title**

required

string

**status**

required

integer

**detail**

required

Human-readable explanation (a string; for a 422, the list of validation errors)

**instance**

required

string

**request\_id**

required

string

**errors**

Structured failures: validation errors, or `{loc, msg, allowed}` for a bad parameter

Array<object>

object

Example

```json
{
  "type": "about:blank",
  "title": "Bad request",
  "status": 400,
  "detail": "…",
  "instance": "/v1/…",
  "request_id": "9b2f1c1e-8c1a-4a53-9f9e-0f5f1f2d7c11"
}
```

### 401

Missing or invalid bearer token

application/problem+json

_Problem_

An RFC 9457 problem details object — the body of every error response. `detail` is the human-readable explanation; `request_id` identifies the request for support.

object

**type**

required

`about:blank` or a `urn:tasksmate:problem:*` identifier

string

Allowed values: about:blank urn:tasksmate:problem:validation urn:tasksmate:problem:invalid-parameter urn:tasksmate:problem:precondition-failed urn:tasksmate:problem:idempotency-key-reused urn:tasksmate:problem:idempotency-key-in-flight urn:tasksmate:problem:idempotency-key-invalid urn:tasksmate:problem:rate-limit urn:tasksmate:problem:internal urn:tasksmate:problem:token-invalid urn:tasksmate:problem:token-expired urn:tasksmate:problem:token-revoked urn:tasksmate:problem:insufficient-scope urn:tasksmate:problem:test-token-read-only urn:tasksmate:problem:token-policy urn:tasksmate:problem:url-refused

**title**

required

string

**status**

required

integer

**detail**

required

Human-readable explanation (a string; for a 422, the list of validation errors)

**instance**

required

string

**request\_id**

required

string

**errors**

Structured failures: validation errors, or `{loc, msg, allowed}` for a bad parameter

Array<object>

object

Example

```json
{
  "type": "about:blank",
  "title": "Missing or invalid bearer token",
  "status": 401,
  "detail": "…",
  "instance": "/v1/…",
  "request_id": "9b2f1c1e-8c1a-4a53-9f9e-0f5f1f2d7c11"
}
```

### 403

Authenticated, but not allowed

application/problem+json

_Problem_

An RFC 9457 problem details object — the body of every error response. `detail` is the human-readable explanation; `request_id` identifies the request for support.

object

**type**

required

`about:blank` or a `urn:tasksmate:problem:*` identifier

string

Allowed values: about:blank urn:tasksmate:problem:validation urn:tasksmate:problem:invalid-parameter urn:tasksmate:problem:precondition-failed urn:tasksmate:problem:idempotency-key-reused urn:tasksmate:problem:idempotency-key-in-flight urn:tasksmate:problem:idempotency-key-invalid urn:tasksmate:problem:rate-limit urn:tasksmate:problem:internal urn:tasksmate:problem:token-invalid urn:tasksmate:problem:token-expired urn:tasksmate:problem:token-revoked urn:tasksmate:problem:insufficient-scope urn:tasksmate:problem:test-token-read-only urn:tasksmate:problem:token-policy urn:tasksmate:problem:url-refused

**title**

required

string

**status**

required

integer

**detail**

required

Human-readable explanation (a string; for a 422, the list of validation errors)

**instance**

required

string

**request\_id**

required

string

**errors**

Structured failures: validation errors, or `{loc, msg, allowed}` for a bad parameter

Array<object>

object

Example

```json
{
  "type": "about:blank",
  "title": "Authenticated, but not allowed",
  "status": 403,
  "detail": "…",
  "instance": "/v1/…",
  "request_id": "9b2f1c1e-8c1a-4a53-9f9e-0f5f1f2d7c11"
}
```

### 404

Not found

application/problem+json

_Problem_

An RFC 9457 problem details object — the body of every error response. `detail` is the human-readable explanation; `request_id` identifies the request for support.

object

**type**

required

`about:blank` or a `urn:tasksmate:problem:*` identifier

string

Allowed values: about:blank urn:tasksmate:problem:validation urn:tasksmate:problem:invalid-parameter urn:tasksmate:problem:precondition-failed urn:tasksmate:problem:idempotency-key-reused urn:tasksmate:problem:idempotency-key-in-flight urn:tasksmate:problem:idempotency-key-invalid urn:tasksmate:problem:rate-limit urn:tasksmate:problem:internal urn:tasksmate:problem:token-invalid urn:tasksmate:problem:token-expired urn:tasksmate:problem:token-revoked urn:tasksmate:problem:insufficient-scope urn:tasksmate:problem:test-token-read-only urn:tasksmate:problem:token-policy urn:tasksmate:problem:url-refused

**title**

required

string

**status**

required

integer

**detail**

required

Human-readable explanation (a string; for a 422, the list of validation errors)

**instance**

required

string

**request\_id**

required

string

**errors**

Structured failures: validation errors, or `{loc, msg, allowed}` for a bad parameter

Array<object>

object

Example

```json
{
  "type": "about:blank",
  "title": "Not found",
  "status": 404,
  "detail": "…",
  "instance": "/v1/…",
  "request_id": "9b2f1c1e-8c1a-4a53-9f9e-0f5f1f2d7c11"
}
```

### 409

Conflict (a duplicate, or an `Idempotency-Key` still in flight)

application/problem+json

_Problem_

An RFC 9457 problem details object — the body of every error response. `detail` is the human-readable explanation; `request_id` identifies the request for support.

object

**type**

required

`about:blank` or a `urn:tasksmate:problem:*` identifier

string

Allowed values: about:blank urn:tasksmate:problem:validation urn:tasksmate:problem:invalid-parameter urn:tasksmate:problem:precondition-failed urn:tasksmate:problem:idempotency-key-reused urn:tasksmate:problem:idempotency-key-in-flight urn:tasksmate:problem:idempotency-key-invalid urn:tasksmate:problem:rate-limit urn:tasksmate:problem:internal urn:tasksmate:problem:token-invalid urn:tasksmate:problem:token-expired urn:tasksmate:problem:token-revoked urn:tasksmate:problem:insufficient-scope urn:tasksmate:problem:test-token-read-only urn:tasksmate:problem:token-policy urn:tasksmate:problem:url-refused

**title**

required

string

**status**

required

integer

**detail**

required

Human-readable explanation (a string; for a 422, the list of validation errors)

**instance**

required

string

**request\_id**

required

string

**errors**

Structured failures: validation errors, or `{loc, msg, allowed}` for a bad parameter

Array<object>

object

Example

```json
{
  "type": "about:blank",
  "title": "Conflict (a duplicate, or an `Idempotency-Key` still in flight)",
  "status": 409,
  "detail": "…",
  "instance": "/v1/…",
  "request_id": "9b2f1c1e-8c1a-4a53-9f9e-0f5f1f2d7c11"
}
```

### 412

`If-Match` does not match the current `ETag`

application/problem+json

_Problem_

An RFC 9457 problem details object — the body of every error response. `detail` is the human-readable explanation; `request_id` identifies the request for support.

object

**type**

required

`about:blank` or a `urn:tasksmate:problem:*` identifier

string

Allowed values: about:blank urn:tasksmate:problem:validation urn:tasksmate:problem:invalid-parameter urn:tasksmate:problem:precondition-failed urn:tasksmate:problem:idempotency-key-reused urn:tasksmate:problem:idempotency-key-in-flight urn:tasksmate:problem:idempotency-key-invalid urn:tasksmate:problem:rate-limit urn:tasksmate:problem:internal urn:tasksmate:problem:token-invalid urn:tasksmate:problem:token-expired urn:tasksmate:problem:token-revoked urn:tasksmate:problem:insufficient-scope urn:tasksmate:problem:test-token-read-only urn:tasksmate:problem:token-policy urn:tasksmate:problem:url-refused

**title**

required

string

**status**

required

integer

**detail**

required

Human-readable explanation (a string; for a 422, the list of validation errors)

**instance**

required

string

**request\_id**

required

string

**errors**

Structured failures: validation errors, or `{loc, msg, allowed}` for a bad parameter

Array<object>

object

Example

```json
{
  "type": "about:blank",
  "title": "`If-Match` does not match the current `ETag`",
  "status": 412,
  "detail": "…",
  "instance": "/v1/…",
  "request_id": "9b2f1c1e-8c1a-4a53-9f9e-0f5f1f2d7c11"
}
```

### 422

The body or query did not validate (`validation`), or an `Idempotency-Key` was reused

application/problem+json

_Problem_

An RFC 9457 problem details object — the body of every error response. `detail` is the human-readable explanation; `request_id` identifies the request for support.

object

**type**

required

`about:blank` or a `urn:tasksmate:problem:*` identifier

string

Allowed values: about:blank urn:tasksmate:problem:validation urn:tasksmate:problem:invalid-parameter urn:tasksmate:problem:precondition-failed urn:tasksmate:problem:idempotency-key-reused urn:tasksmate:problem:idempotency-key-in-flight urn:tasksmate:problem:idempotency-key-invalid urn:tasksmate:problem:rate-limit urn:tasksmate:problem:internal urn:tasksmate:problem:token-invalid urn:tasksmate:problem:token-expired urn:tasksmate:problem:token-revoked urn:tasksmate:problem:insufficient-scope urn:tasksmate:problem:test-token-read-only urn:tasksmate:problem:token-policy urn:tasksmate:problem:url-refused

**title**

required

string

**status**

required

integer

**detail**

required

Human-readable explanation (a string; for a 422, the list of validation errors)

**instance**

required

string

**request\_id**

required

string

**errors**

Structured failures: validation errors, or `{loc, msg, allowed}` for a bad parameter

Array<object>

object

Example

```json
{
  "type": "about:blank",
  "title": "The body or query did not validate (`validation`), or an `Idempotency-Key` was reused",
  "status": 422,
  "detail": "…",
  "instance": "/v1/…",
  "request_id": "9b2f1c1e-8c1a-4a53-9f9e-0f5f1f2d7c11"
}
```

### 429

An access token over its per-minute limit (`rate-limit`; see `Retry-After`)

application/problem+json

_Problem_

An RFC 9457 problem details object — the body of every error response. `detail` is the human-readable explanation; `request_id` identifies the request for support.

object

**type**

required

`about:blank` or a `urn:tasksmate:problem:*` identifier

string

Allowed values: about:blank urn:tasksmate:problem:validation urn:tasksmate:problem:invalid-parameter urn:tasksmate:problem:precondition-failed urn:tasksmate:problem:idempotency-key-reused urn:tasksmate:problem:idempotency-key-in-flight urn:tasksmate:problem:idempotency-key-invalid urn:tasksmate:problem:rate-limit urn:tasksmate:problem:internal urn:tasksmate:problem:token-invalid urn:tasksmate:problem:token-expired urn:tasksmate:problem:token-revoked urn:tasksmate:problem:insufficient-scope urn:tasksmate:problem:test-token-read-only urn:tasksmate:problem:token-policy urn:tasksmate:problem:url-refused

**title**

required

string

**status**

required

integer

**detail**

required

Human-readable explanation (a string; for a 422, the list of validation errors)

**instance**

required

string

**request\_id**

required

string

**errors**

Structured failures: validation errors, or `{loc, msg, allowed}` for a bad parameter

Array<object>

object

Example

```json
{
  "type": "about:blank",
  "title": "An access token over its per-minute limit (`rate-limit`; see `Retry-After`)",
  "status": 429,
  "detail": "…",
  "instance": "/v1/…",
  "request_id": "9b2f1c1e-8c1a-4a53-9f9e-0f5f1f2d7c11"
}
```

### 500

Unexpected server error — quote `request_id`

application/problem+json

_Problem_

An RFC 9457 problem details object — the body of every error response. `detail` is the human-readable explanation; `request_id` identifies the request for support.

object

**type**

required

`about:blank` or a `urn:tasksmate:problem:*` identifier

string

Allowed values: about:blank urn:tasksmate:problem:validation urn:tasksmate:problem:invalid-parameter urn:tasksmate:problem:precondition-failed urn:tasksmate:problem:idempotency-key-reused urn:tasksmate:problem:idempotency-key-in-flight urn:tasksmate:problem:idempotency-key-invalid urn:tasksmate:problem:rate-limit urn:tasksmate:problem:internal urn:tasksmate:problem:token-invalid urn:tasksmate:problem:token-expired urn:tasksmate:problem:token-revoked urn:tasksmate:problem:insufficient-scope urn:tasksmate:problem:test-token-read-only urn:tasksmate:problem:token-policy urn:tasksmate:problem:url-refused

**title**

required

string

**status**

required

integer

**detail**

required

Human-readable explanation (a string; for a 422, the list of validation errors)

**instance**

required

string

**request\_id**

required

string

**errors**

Structured failures: validation errors, or `{loc, msg, allowed}` for a bad parameter

Array<object>

object

Example

```json
{
  "type": "about:blank",
  "title": "Unexpected server error",
  "status": 500,
  "detail": "…",
  "instance": "/v1/…",
  "request_id": "9b2f1c1e-8c1a-4a53-9f9e-0f5f1f2d7c11"
}
```

---
Source: https://developers.tasksmate.indrasol.com/reference/operations/teamsdelete/
