> For the complete documentation index, see [llms.txt](https://create.cloud4wi.ai/dev-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://create.cloud4wi.ai/dev-hub/api-reference/getting-started/authentication.md).

# Authentication

Using your **clientKey** and **clientSecret** you can request for a **token** by calling the dedicated method (note: replace asterisks with your clientKey and clinetSecret)

{% tabs %}
{% tab title="curl" %}

```shell
/curl -X POST \
 https://explore.cloud4wi.com/v1/sts/login/services \
 -H 'Cache-Control: no-cache' \
 -H 'Content-Type: application/json' \
 -H 'accept: application/json' \
 -d '{
 "clientKey":"ck-********-****-****-****-************",
 "clientSecret":"********************************"
}'/curl -X POST \
```

{% endtab %}
{% endtabs %}

If the client key and secret are correct, then the API will return a JWT token.

```json
{"token":[[JWT_TOKEN]]"}
```

{% tabs %}
{% tab title="curl" %}

```shell
curl -X GET \
 'https://explore.cloud4wi.com/v2/customers/organizations/[[CID]]?sortBy=created_absolute&sortReverse=false' \
 -H 'Authorization: Bearer [[JWT_TOKEN]]' \
 -H 'Cache-Control: no-cache' \
 -H 'accept: application/json'
```

{% endtab %}
{% endtabs %}

The JWT token expires after **one day**; to get a new one, restart and call again /v1/sts/login/services.

### AuthN/AuthZ Flow

<img src="https://uploads-ssl.webflow.com/5eb42691bf103600ee3afc30/5eb5d477ecd059c41c0120e9_flow1.png" alt="" data-size="original">

## Endpoints

Use your **client key** and **client secret** to retrieve a valid authentication **token**

{% openapi src="<https://developers.cloud4wi.com/api-explore-inspector/api-explore.yml>" path="/v1/sts/login/services" method="post" %}
<https://developers.cloud4wi.com/api-explore-inspector/api-explore.yml>
{% endopenapi %}

You can manually revoke a token using the following end-point:

{% openapi src="<https://developers.cloud4wi.com/api-explore-inspector/api-explore.yml>" path="/v1/sts/logout" method="post" %}
<https://developers.cloud4wi.com/api-explore-inspector/api-explore.yml>
{% endopenapi %}


---

# 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://create.cloud4wi.ai/dev-hub/api-reference/getting-started/authentication.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.
