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

# Authenticate with username and password

> Returns an OAuth token set including an access token for subsequent API calls.



## OpenAPI

````yaml https://api.trlyr.com/auth/docs/doc.json post /auth/public/authenticate
openapi: 3.1.0
info:
  description: >
    This API manages authentication, users, organisations, groups, permissions,
    and resource associations for the terralayr system. 
     
    Use the public endpoints to authenticate and obtain access tokens. Admin
    endpoints require a valid Bearer token and appropriate permissions. 
     
    ### Authorization 
     
    Public endpoints such as `/auth/public/authenticate` do not require an
    existing token. 
     
    To retrieve a valid token, authenticate with username and password: 
     
    ``` 

    POST https://api.trlyr.com/auth/public/authenticate 

    ``` 
     
    with the following JSON body: 
     
    ``` 

    { 
        "username": "YOUR_USERNAME", 
        "password": "YOUR_PASSWORD" 
    } 

    ``` 
     
    Your username and password are the ones you created after receiving an
    invitation to join your organisation. 
     
    You should receive a JSON response body from which you can extract your
    token under `access_token`. 
     
    If you have any questions, don't hesitate to contact our account manager at
    the following address: support@trlyr.com. 
  title: terralayr Auth API
  version: 1.0.0
servers:
  - description: Production API
    url: https://api.trlyr.com
  - description: Sandbox API
    url: https://api.sandbox.trlyr.com
security: []
tags:
  - name: auth
  - name: admin
externalDocs:
  description: ''
  url: ''
paths:
  /auth/public/authenticate:
    post:
      tags:
        - auth
      summary: Authenticate with username and password
      description: >-
        Returns an OAuth token set including an access token for subsequent API
        calls.
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/pkg_models_http_public_requests.LoginRequestBody
              description: Login credentials
              summary: loginRequest
        description: Login credentials
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pkg_models_http_public_responses.LoginResponseBody
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
components:
  schemas:
    pkg_models_http_public_requests.LoginRequestBody:
      properties:
        password:
          type: string
        username:
          type: string
      type: object
    pkg_models_http_public_responses.LoginResponseBody:
      properties:
        access_token:
          type: string
        expires_in:
          type: integer
        id_token:
          type: string
        refresh_token:
          type: string
        scope:
          type: string
        token_type:
          type: string
      type: object

````