> For the complete documentation index, see [llms.txt](https://docs.transparentedge.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.transparentedge.eu/guides/api/invalidation.md).

# Invalidation

Through the API, we provide our clients with a resource invalidation service. Below are the details and instructions for using it.

The procedure for invalidating resources against the API is relatively simple. We will start by making a call to this URL:

```
https://api.transparentcdn.com/v1/companies/{COMPANY_ID}/invalidate/
```

In this request, we need to include a list or array within a JSON object where we will indicate the resources we want to invalidate, identified by their URLs.

```c
{
    "urls":[
            "http://www.servidor.com/recurso1",
            "http://fotos.servidor2.com/imagen2.jpg"
        ]
}
```

We can execute this call using [curl](https://www.mit.edu/afs.new/sipb/user/ssen/src/curl-7.11.1/docs/curl.html) or any interface that allows making HTTP requests. Here is an example of how a call would be composed to invalidate the resources *recurso1* and *imagen2*.<br>

```json
curl -XPOST -H 'Authorization: Bearer TOKEN' -d '{"urls":["http://www.servidor.com/recurso1","http://fotos.servidor2.com/imagen2.jpg"]}' -H "Content-Type: application/json" https://api.transparentcdn.com/v1/companies/42/invalidate/
```

This request will return a JSON response, where we can find the **URLs** that have been sent for invalidation. The result would be as follows, assuming that "servidor.com" and "fotos.servidor.com" are registered as sites within our system and are associated with the client making the request.

```json
{
    "urls": [
        "http://fotos.servidor.com",
        "http://fotos.servidor.com/imagen2.jpg"
    ],
}
```

Our API provides a system for executing recursive invalidations. This means that all **URLs** that match the ones sent will be invalidated. To do this, an additional parameter needs to be included in the request: "ban" with a value of "1" to activate this service. Therefore, by executing the request with the following message, everything starting with *"/recursos/"* from *fotos.servidor.com* will be marked as invalid content.

```json
{
    "urls": [
        "http://fotos.servidor.com/recursos/"
    ],
    "ban": "1"
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.transparentedge.eu/guides/api/invalidation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
