> ## Documentation Index
> Fetch the complete documentation index at: https://docs.energy.nayax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

Nayax Energy Core's API is a machine-to-machine server side API. The API is organized around REST and has predictable resource-oriented URLs. Developers are expected to send requests to Nayax Energy Core from their backend resources.

This API is organized around standard REST and HTTP with predictable resource-oriented URLs. This allows you to use any HTTP client regardless of programming language to send requests to Nayax Energy Core from your backend resources.

<Danger>
  **Making API Requests Directly from the Client**

  Making requests directly from a client application **exposes your Client ID and Client Secret**, which can lead to your account being compromised. **DO NOT** expose your client ID or Client Secret to any client-side application.
</Danger>

## Basic Authentication

1. Log into [**Network Manager**](https://admin.lynkwell.com) and go to the [API Clients section of the developers page](https://admin.lynkwell.com/developers#API%20Clients).
   ![Nayax Energy Core API Clients](https://docs-assets.lynkwell.com/create-api-client.png)

2. Choose your existing API client or create a new one by typing in a "Client Name" and clicking on the `Create API Client` button.
   ![step2-2](https://docs-assets.lynkwell.com/create-api-client.png)

3. Copy the `Client ID` and `Client Secret` and store them in a safe place. You will need them to request a token.
   ![step3](https://docs-assets.lynkwell.com/step-3-new-client.png)

4. Use your `Client ID` and `Client Secret` to request an authorization from Nayax Energy Core's OAuth2 client credentials token route ([https://lynkwell-prod.us.auth0.com/oauth/token](https://lynkwell-prod.us.auth0.com/oauth/token)). This request will return an `access_token` that can be used to authorize future API requests.

   **Example Request:**

   ```bash theme={null}
   curl --request POST \
   --url https://lynkwell-prod.us.auth0.com/oauth/token \
   --header 'content-type: application/json' \
   --data `{
       "client_id":"${YOUR_CLIENT_ID}",
       "client_secret":"${YOUR_CLIENT_SECRET}",
       "audience":"https://api.lynkwell.com",
       "grant_type":"client_credentials"
   }`
   ```

   **Example Response:**

   ```json theme={null}
   {
     "type": "object",
     "required": ["access_token", "token_type", "expires_in", "scope"],
     "properties": {
       "access_token": {
         "type": "string"
       },
       "token_type": {
         "type": "string",
         "const": "Bearer"
       },
       "expires_in": {
         "description": "The number of seconds until the token expires",
         "type": "integer"
       },
       "scope": {
         "description": "The scopes associated with the token",
         "type": "string"
       }
     }
   }
   ```

5. Include the `access_token` in the `Authorization` header of your API requests in the format `Authorization: Bearer ACCESS_TOKEN`.

   **Example Request:**

   ```bash theme={null}
   curl --request GET \
   --url "https://api.lynkwell.com/asset-management/v1/assets" \
   --header "content-type: application/json" \
   --header "Authorization: Bearer ACCESS_TOKEN"
   ```
