---
title: "Delete a resource"
method: DELETE
path: "/api/v1/devices/{deviceId}/resource-links/{resourceHref}"
tags: ["Resource Links"]
---

# Delete a resource

`DELETE /api/v1/devices/{deviceId}/resource-links/{resourceHref}`

Request to delete a resource is an async operation. The device after successful resource deletion unpublishes the resource from the plgd hub. This information is published to the WebSocket in form of an `RESOURCE_UNPUBLISHED` event.

## Query parameters

- `timeToLive` integer

## Response `200`

Confirmation event about successful resource deletion.

- object
  - `data` Resource
    - `resourceId` ResourceId
      - `deviceId` string, uuid
      - `href` string, url
    - `content` union
      - ResourceContent
      - ResourceCreatedContent
        - `href` string, uri
        - `rt` string[]
        - `if` string[]
        - `rep` object — Resource content provided as JSON object or base64 encoded CBOR.
    - `auditContext` AuditContext
      - `userId` string
      - `correlationId` string
    - `eventMetadata` EventMetadata
      - `version` string, uint64
      - `timestamp` string, int64
      - `connectionId` string
      - `sequence` string, uint64
    - `status` 'UNKNOWN' | 'OK' | 'BAD_REQUEST' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'NOT_FOUND' | 'UNAVAILABLE' | 'NOT_IMPLEMENTED' | 'ACCEPTED' | 'ERROR' | 'METHOD_NOT_ALLOWED' | 'CREATED' | 'NOT_MODIFIED'

## Other responses

- `204` — Action will asynchronously processed.
- `400` — Bad Request
- `401` — Not authorized
- `403` — Forbidden
- `404` — Entity was not found.

## Changes

> 42 revisions in range; 3 not diffed.

- **2023-10-03** `43d5d4e000ad` — 1 warning
  - added the new `NOT_MODIFIED` enum value to the `data/status` response property for the response status `200`
- **2022-01-05** `afc9b9af73b5` — 6 info
  - added the optional property `error/details/items/typeUrl` to the response with the `400` status
  - added the optional property `error/details/items/typeUrl` to the response with the `401` status
  - added the optional property `error/details/items/typeUrl` to the response with the `403` status
  - added the optional property `error/details/items/value` to the response with the `400` status
  - …2 more
- **2021-08-05** `750a4952762c` — 1 info
  - added the new optional `query` request parameter `timeToLive`
- **2021-07-27** `4d121732b593` — 1 info
  - endpoint added
- **2020-04-11** `562192db9767` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway/changes/api/v1/devices/:deviceId/resource-links/:resourceHref/delete.md)

---

[API](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway.md) · [All operations](https://skmtc.dev/plgd-dev/apis/plgd-http-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/plgd-dev/plgd-http-gateway/revisions/bbfd9fa43407/schema)
