> For the complete documentation index, see [llms.txt](https://docs.scaleconnect.com.au/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scaleconnect.com.au/api/rest-api/scaleai-rest-api/authentication.md).

# Authentication

## Validate Jwt

> Validate JWT token and get user data + control centers.\
> \
> Args:\
> &#x20;   jwt\_token: JWT token for authentication\
> &#x20;   environment: 'local', 'dev', or 'prod'\
> &#x20;   user\_id: Optional user ID for admin access

```json
{"openapi":"3.1.0","info":{"title":"ScaleAI r16 API","version":"2.0.0"},"servers":[{"url":"https://agent-backend.r16.app"}],"security":[{"HTTPBearer":[]},{"JwtTokenQuery":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"},"JwtTokenQuery":{"type":"apiKey","in":"query","name":"jwt_token"}},"schemas":{"JWTValidateResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"user":{"anyOf":[{"$ref":"#/components/schemas/UserInfo"},{"type":"null"}]},"onboarding":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Onboarding"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["valid"],"title":"JWTValidateResponse","description":"Response model for JWT validation."},"UserInfo":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phonenumber"},"personalDetails":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Personaldetails"},"controlCentres":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Controlcentres","default":[]}},"type":"object","title":"UserInfo","description":"User information returned from JWT validation."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/auth/validate":{"get":{"tags":["Authentication"],"summary":"Validate Jwt","description":"Validate JWT token and get user data + control centers.\n\nArgs:\n    jwt_token: JWT token for authentication\n    environment: 'local', 'dev', or 'prod'\n    user_id: Optional user ID for admin access","operationId":"validate_jwt_auth_validate_get","parameters":[{"name":"environment","in":"query","required":false,"schema":{"type":"string","default":"dev","title":"Environment"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JWTValidateResponse"}}}},"401":{"description":"JWT is required","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}},"required":["detail"]}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}},"required":["detail"]}}}},"504":{"description":"Upstream authentication service timed out","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}},"required":["detail"]}}}}}}}}}
```

## Get Strategies

> Get available strategies for the authenticated user.\
> \
> Args:\
> &#x20;   jwt\_token: JWT token for authentication\
> &#x20;   environment: 'local', 'dev', or 'prod'\
> &#x20;   user\_id: Optional user ID for admin access

```json
{"openapi":"3.1.0","info":{"title":"ScaleAI r16 API","version":"2.0.0"},"servers":[{"url":"https://agent-backend.r16.app"}],"security":[{"HTTPBearer":[]},{"JwtTokenQuery":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"},"JwtTokenQuery":{"type":"apiKey","in":"query","name":"jwt_token"}},"schemas":{"StrategiesResponse":{"type":"object","properties":{"strategies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["strategies"]},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/strategies":{"get":{"tags":["Authentication"],"summary":"Get Strategies","description":"Get available strategies for the authenticated user.\n\nArgs:\n    jwt_token: JWT token for authentication\n    environment: 'local', 'dev', or 'prod'\n    user_id: Optional user ID for admin access","operationId":"get_strategies_strategies_get","parameters":[{"name":"environment","in":"query","required":false,"schema":{"type":"string","default":"dev","title":"Environment"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StrategiesResponse"}}}},"401":{"description":"JWT is required","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}},"required":["detail"]}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}},"required":["detail"]}}}},"504":{"description":"Upstream authentication service timed out","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}},"required":["detail"]}}}},"default":{"description":"Non-200 status forwarded from the onboarding or strategy upstream API.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}},"required":["detail"]}}}}}}}}}
```


---

# 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://docs.scaleconnect.com.au/api/rest-api/scaleai-rest-api/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.
