> For the complete documentation index, see [llms.txt](https://bittu-1.gitbook.io/meshkit-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bittu-1.gitbook.io/meshkit-documentation/api/revoke.md).

# revoke()

## Overview

Unpins a CID from Pinata. This removes the provider pin but does not guarantee immediate or global deletion from IPFS gateways or other nodes.

## Purpose

Use `revoke()` when your application needs to remove its Pinata pin for a CID.

## Endpoint / Method

```ts
async revoke(cid: string): Promise<boolean>
```

Provider endpoint:

```http
DELETE https://api.pinata.cloud/pinning/unpin/{cid}
```

## Parameters

| Name  | Type     | Required | Description                         |
| ----- | -------- | -------- | ----------------------------------- |
| `cid` | `string` | Yes      | Raw CID or URL containing `/ipfs/`. |

### Request schema table

| Field | Type     | Required | Notes                                              |
| ----- | -------- | -------- | -------------------------------------------------- |
| `cid` | `string` | Yes      | Normalized before calling Pinata's unpin endpoint. |

## Response

Returns `Promise<boolean>`.

| Value            | Description                                         |
| ---------------- | --------------------------------------------------- |
| `true`           | Pinata accepted the unpin request.                  |
| Rejected promise | The CID was invalid or Pinata rejected the request. |

### Response schema table

| Type      | Description                                                     |
| --------- | --------------------------------------------------------------- |
| `boolean` | `true` when `response.ok` is true. Failed HTTP responses throw. |

## Examples

### Example request

```ts
const revoked = await meshkit.revoke("bafybeigdyrzt5examplecid");
```

### Example response

```ts
true
```

## Errors

| Error                  | Cause                                          |
| ---------------------- | ---------------------------------------------- |
| `Invalid CID`          | CID is empty after trimming and normalization. |
| `HTTP error 401`       | Invalid Pinata JWT.                            |
| Provider error details | Pinata rejected the unpin request.             |

### Error schema table

| Field     | Type     | Description                                                                           |
| --------- | -------- | ------------------------------------------------------------------------------------- |
| `name`    | `string` | Standard JavaScript error name.                                                       |
| `message` | `string` | `Invalid CID`, Pinata error details, `HTTP error {status}`, or network error message. |

## Notes

* This method calls Pinata unpinning, not a universal IPFS delete operation.
* Content may still be available if pinned elsewhere, cached by gateways, or retained by other IPFS nodes.
* Query strings and trailing slashes are removed before the provider calls Pinata.

## Best Practices

* Use precise language in product UI, such as "unpin" or "revoke provider pin", instead of promising deletion.
* Keep an audit trail in your app if revocation matters for compliance workflows.
* Handle missing or already-unpinned CIDs as provider errors.

## Related APIs

* [store()](/meshkit-documentation/api/store.md)
* [upload()](/meshkit-documentation/api/upload.md)
* [Error Handling](/meshkit-documentation/error-handling.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bittu-1.gitbook.io/meshkit-documentation/api/revoke.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
