# Delete an activity observation

Operation ID: `patient.deleteActivity`

Delete a single activity FHIR Observation by its resource id. Requires a patient Bearer JWT.

## Public method

`deleteActivity`

Signature: `patient.deleteActivity(activityId)`

Return type: `Promise<JsonValue>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`DELETE /patients/activity/{activity_id}`

## Path parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `activity_id` | `string` | Yes |  |  |  | No |  |

## Query parameters

None.

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`DeleteActivityResponse`](../models/DeleteActivityResponse.md) | application/json | Activity observation deleted |

## Success response examples

### 200

```json
{
  "deleted": "activity-example-001"
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `401` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | Authorization required — missing, invalid, expired, or non-patient Bearer JWT |
| `404` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | No Observation exists with this id |

## Error examples

### 401 — Missing or invalid access token

```json
{
  "error": "Authorization required"
}
```

### 404 — The activity observation does not exist

```json
{
  "error": "Not Found"
}
```

## NodeJS / TypeScript implementation

```ts
import { HCSDK } from "@healthcloudai/hc-sdk";
```

```ts
const activityId = "<ACTIVITY_ID>";

const result = await patient.deleteActivity(activityId);
```

## cURL

```bash
curl -X DELETE \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-patient.health.cloud/patients/activity/%3CACTIVITY_ID%3E'
```

## Notes

None.

## Prepared Test Console scenario

No canonical scenario is currently associated.

## Real response

No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
