# Delete a child project

Canonical page: https://docs.ovok.com/slim-apis/project/delete-a-child-project

| Method | Path |
| --- | --- |
| `DELETE` | `/v1/slim/project/child/:subProjectId` |

[Authentication](/authentication) · [Access policies](/access-policies)

Deletes an empty direct child project of your current project, including the setup Ovok created with it. Use it to remove a child project that is no longer needed.

**Auth:** Bearer token for a project admin. No other role passes.
**Scope:** `subProjectId` must be a direct child of the caller's project (from the token).

## Request [#request]

### Path parameters [#path-parameters]

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `subProjectId` | `string` | Yes | Id of the child project to delete. Must be a direct child of your project. |

## Behaviour [#behaviour]

- The child must be empty: no `Patient`, `Device` or `Location`, and no child projects of its own. Otherwise the request is refused with 409 and nothing is changed. The 409 body has `error: "project_not_empty"` ([`project_not_empty`](/errors/project-not-empty)), a `counts` object per resource type and the `childProjectIds`.
- On success Ovok unlinks the child from your project, deletes its access policies, practitioners, memberships, threshold plan, client applications, top-level organizations and tenant code, deletes the project, then revokes its Signals tenant.
- User accounts are never deleted: a user can belong to other projects. Audit records (`Provenance`, `AuditEvent`) are kept.
- Two deletes of the same project cannot run at once: the second gets 409.
- If the project's Signals tenant credentials cannot be read, the request answers 503 and nothing is changed. Retry it.
- If the project's Signals tenant credentials cannot be read, the request answers 503 and nothing is changed. Retry it.
- The delete is safe to retry. If the Signals revoke fails, the project is already deleted and the request answers 502. Send the same request again to finish it.
- Returns `{ "success": true }`.


## Example [#example]

```bash
curl -X DELETE 'https://api.sandbox.ovok.com/v1/slim/project/child/b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"
```

## Successful response [#successful-response]

`200` — The sub tenant was deleted successfully.

```json
{ "success": true }
```

| Field | Type | Description |
| --- | --- | --- |
| `success` | `boolean` | Always `true`. |

## Errors [#errors]

| Status | Meaning |
| --- | --- |
| [`401`](/errors/unauthenticated) | The bearer token is missing or invalid, or the session carries no project. |
| [`403`](/errors/forbidden) | The caller is not a project admin. |
| [`404`](/errors/not-found) | `subProjectId` is not a direct child of the caller's project. |
| [`409`](/errors/conflict) | The project still holds residents, devices, locations or child projects, or another delete of it is in progress. |
| [`422`](/errors/validation-failed) | `subProjectId` is empty. |
| [`502`](/errors/upstream-error) | The project was deleted, but its Signals tenant could not be revoked. Retry the delete. |
| [`503`](/errors/service-unavailable) | The Signals tenant credentials of the project cannot be read. Nothing was changed. Retry shortly. |
