> For the complete documentation index, see [llms.txt](https://docs.piercloud.com/api-docs-pier-cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.piercloud.com/api-docs-pier-cloud/api-pier-cloud/public-routes-en-us.md).

# Public Routes (EN-US)

Lighthouse API Public Routes Usage Description

***

## API Documentation

### Base URL

```
https://api.piercloud.io
```

### HTTP Client Authentication

All HTTP clients need to be registered on the Pier Cloud platform to obtain access credentials. For more information, [visit the link](https://docs.piercloud.com/plataforma-de-finops/finops-platform-english/platform-configuration/setup-features/api-keys).

***

### Authentication

#### 1. Generate Access Token

Generate an access token for the HTTP client.

* **URL:** `/auth`
* **Method:** `POST`
* **Description:** Returns the access token and other information based on the provided credentials.

**Headers**

| Name           | Type   | Required | Description                |
| -------------- | ------ | -------- | -------------------------- |
| `Content-Type` | string | Yes      | Must be `application/json` |

**Body**

```json
{
  "client_id": "string",
  "client_secret": "string"
}
```

**Example Request**

```bash
curl -X POST https://api.piercloud.io/auth \
     -H "Content-Type: application/json" \
     -d '{
           "client_id": "client_id",
           "client_secret": "client_secret",
         }'
```

**Successful Response (201 Created)**

```json
{
  "code": "success",
  "data": {
    "access_token": "JWT Token",
    "expires_in": "Expiration time in seconds",
    "refresh_expires_in": 0,
    "token_type": "Bearer",
    "not-before-policy": 0,
    "session_state": "",
    "scope": "List of access permissions for the HTTP client"
  }
}
```

**Error Response (400 Bad Request)**

```json
{
  "code": "bad-request/invalid-parameters",
  "message": "error message"
}
```

**Error Response (401 Unauthorized)**

```json
{
  "code": "failed",
  "message": "invalid or expired token"
}
```

***
