# Auth

## Authenticate and get access token

> Authenticate with email and password and get an access token for authorizing requests to Customers API endpoints. Access token is valid for 24 hours.

```json
{"openapi":"3.0.1","info":{"title":"Customers api","version":"1.0"},"tags":[{"name":"Auth"}],"servers":[{"url":"https://customers-api.netnut.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"Login":{"required":["email","password"],"type":"object","properties":{"email":{"type":"string","description":"credentials"},"password":{"type":"string","description":"options"}},"description":"Login credentials"},"LoginSuccess":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"token":{"type":"string","description":"token"}},"description":"Login credentials"},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"message":{"type":"string","description":"message"}}}}},"paths":{"/auth/login":{"post":{"tags":["Auth"],"summary":"Authenticate and get access token","description":"Authenticate with email and password and get an access token for authorizing requests to Customers API endpoints. Access token is valid for 24 hours.","operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Login"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginSuccess"}}}},"400":{"description":"fail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /auth/authenticated

> Check access token status

```json
{"openapi":"3.0.1","info":{"title":"Customers api","version":"1.0"},"tags":[{"name":"Auth"}],"servers":[{"url":"https://customers-api.netnut.io/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"LoginSuccess":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"token":{"type":"string","description":"token"}},"description":"Login credentials"},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"is success"},"message":{"type":"string","description":"message"}}}}},"paths":{"/auth/authenticated":{"get":{"tags":["Auth"],"summary":"Check access token status","operationId":"me","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginSuccess"}}}},"400":{"description":"fail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# 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://help.netnut.io/netnut-documentation/resources/customers-api/auth.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.
