# Authentication in the Hablla API

The Hablla API uses authentication via Workspace Token, a recommended approach for integrations, automations, and bots.

### Authentication via Workspace Token (Recommended)

The **Workspace Token** is a token directly linked to a specific workspace. It is the most practical and robust form of authentication for integrations and automations.

**Main Advantages:**

* Allows access to most API routes.
* **Does not expire**.
* Can be used safely in automated environments.
* Offers traceability (actions are recorded in the history as executed via automation).

#### How to get it

You can capture the *workspace token* when running a flow in Hablla that uses an API component. In the request response, it will be available in the header `Authorization`.

> **📌 Visual example:**

<figure><img src="/files/d7023ca0c3fc0c3b7c426e0bbe8dc1eb302db3f8" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
[*The field `Authorization` contains the token you should use. Important: always replace it with `token_here` when sharing public examples to avoid leaks.*](#user-content-fn-1)[^1]
{% endhint %}

#### Identifying the Workspace ID

The workspace ID (example: `64e683e59a0a699241b5222c`) is unique per customer. You can find it directly in the browser URL when accessing your environment in Hablla Studio:

`https://studio.hablla.com/workspaces/<WORKSPACE_ID>`

#### Request example

```http
curl "https://api.hablla.com/v2/workspaces/<WORKSPACE_ID>/persons?page=1&limit=50" \
  -H "authorization: <YOUR_TOKEN_HERE>" \
  -H "accept: application/json"
```

### Conclusion

| Token Type      | Ideal for                       | Traceable actions? | Expiration | Recommended? |
| --------------- | ------------------------------- | ------------------ | ---------- | ------------ |
| Workspace Token | Integrations, automations, bots | ✅ Yes (as bot)     | ❌ No       | ✅ Yes        |

[^1]:


---

# Agent Instructions: 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:

```
GET https://docs.hablla.com/hablla-docs-en/api/authentication-in-the-hablla-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
