> For the complete documentation index, see [llms.txt](https://docs.videsk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.videsk.io/es-developers/api-publica/autorizacion.md).

# Autorización

Te explicamos como transaccionar con nuestra API mediante autorización.

La API de Videsk utiliza una autorización estándar basada en cabecera `Authorization`, usando el esquema `Bearer`.

No utilizamos definición de versionamiento en URL o cabeceras ya que se realiza de forma interna mediante configuración de cada cuenta, es decir, en tu propia cuenta podrás definir cual versión de API utilizar en caso de estar disponible.

{% hint style="info" %}
Existen ciertos endpoints que requerirán ciertos campos en el cuerpo (`body`) dependiendo del API Token que hayas creado, ya sea para usarlo de forma pública o en backend.

Este comportamiento se verá reflejado en las medidas de seguridad como captcha o similares.
{% endhint %}

## Ejemplo de autorización

<mark style="color:blue;">`GET`</mark> `https://api.videsk.io/public/video-contact-center/segments`

Obtener segmentos usando autorización con API Key

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer | Bearer {API Key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json |

{% tabs %}
{% tab title="401: Unauthorized Invalid JWT" %}

```javascript
{
	"name": "NotAuthenticated",
	"message": "Authorization header with valid JWT is required.",
	"code": 401,
	"className": "not-authenticated",
	"errors": {}
}
```

{% endtab %}

{% tab title="401: Unauthorized JWT malformed" %}

```javascript
{
	"name": "NotAuthenticated",
	"message": "jwt malformed",
	"code": 401,
	"className": "not-authenticated",
	"errors": {}
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid signature" %}

```javascript
{
	"name": "NotAuthenticated",
	"message": "invalid signature",
	"code": 401,
	"className": "not-authenticated",
	"errors": {}
}
```

{% endtab %}

{% tab title="401: Unauthorized Infected JWT" %}

```javascript
{
	"name": "NotAuthenticated",
	"message": "Unexpected token � in JSON at position 6",
	"code": 401,
	"className": "not-authenticated",
	"errors": {}
}
```

{% endtab %}

{% tab title="401: Unauthorized Expired JWT" %}

```javascript
{
	"name": "NotAuthenticated",
	"message": "jwt expired",
	"code": 401,
	"className": "not-authenticated",
	"errors": {}
}
```

{% endtab %}

{% tab title="403: Forbidden API Key don" %}

```javascript
{
	"name": "Forbidden",
	"message": "You don't have access to /public/video-contact-center/segments. Please contact to your administrator.",
	"code": 403,
	"className": "forbidden",
	"errors": {}
}
```

{% endtab %}

{% tab title="403: Forbidden Integration key was removed" %}

```javascript
{
	"name": "Forbidden",
	"message": "The integration token it's invalid or was removed.",
	"code": 403,
	"className": "forbidden",
	"errors": {}
}
```

{% endtab %}
{% endtabs %}


---

# 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.videsk.io/es-developers/api-publica/autorizacion.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.
