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

# Get Session

> Retrieves the current status and details of an existing MedAssist session.

Use this endpoint to check session status, expiration, and metadata.


<RequestExample>
  ```bash cURL theme={null}
  curl --location --request GET 'https://api.eka.care/med-assist/session/a349a41e-5d49-488a-b300-66ccbfdf16b3' \
  --header 'x-agent-id: <agent-id>'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.eka.care/med-assist/session/a349a41e-5d49-488a-b300-66ccbfdf16b3"

  payload = {}
  headers = {
    'x-agent-id': '<agent-id>'
  }

  response = requests.request("GET", url, headers=headers, data=payload)

  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const url = "https://api.eka.care/med-assist/session/a349a41e-5d49-488a-b300-66ccbfdf16b3";

  const headers = {
    'x-agent-id': '<agent-id>'
  };

  fetch(url, {
    method: 'GET',
    headers: headers
  })
  .then(response => response.text())
  .then(result => console.log(result));
  ```
</RequestExample>

## Session Refresh

When a session token expires, you can refresh it using the refresh endpoint:

<RequestExample>
  ```bash cURL - Refresh Token theme={null}
  curl --location --request GET 'https://api.eka.care/med-assist/session/a349a41e-5d49-488a-b300-66ccbfdf16b3/refresh' \
  --header 'x-agent-id: <agent-id>' \
  --header 'x-sess-token: <old_token>'
  ```

  ```python Python - Refresh Token theme={null}
  import requests

  url = "https://api.eka.care/med-assist/session/a349a41e-5d49-488a-b300-66ccbfdf16b3/refresh"

  payload = {}
  headers = {
    'x-agent-id': '<agent-id>',
    'x-sess-token': '<old_token>'
  }

  response = requests.request("GET", url, headers=headers, data=payload)

  print(response.text)
  ```
</RequestExample>

The refresh endpoint returns a new token with extended expiration time.


## OpenAPI

````yaml GET /med-assist/session/{session_id}
openapi: 3.0.1
info:
  title: MedAssist APIs
  description: Medical assistant chat functionality for healthcare consultations
  version: 1.0.0
servers:
  - url: https://api.eka.care
    description: Production server
  - url: https://api.dev.eka.care
    description: Development server
security: []
paths:
  /med-assist/session/{session_id}:
    get:
      summary: Get Session
      description: >
        Retrieves the current status and details of an existing MedAssist
        session.


        Use this endpoint to check session status, expiration, and metadata.
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The unique session identifier
          example: a349a41e-5d49-488a-b300-66ccbfdf16b3
      responses:
        '200':
          description: Session retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  session_id:
                    type: string
                    format: uuid
                    description: Unique session identifier
                    example: a349a41e-5d49-488a-b300-66ccbfdf16b3
                  expires_at:
                    type: string
                    format: date-time
                    description: Session expiration timestamp
                    example: '2024-01-01T12:00:00Z'
        '403':
          description: Forbidden. Missing agent or malformed token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: forbidden
                  msg: No agent id provided
        '404':
          description: Session not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: not_found
                  msg: Session not found
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: internal_server_error
                  msg: Internal server error
      security:
        - agentAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code identifying the type of error
              example: internal_server_error
            msg:
              type: string
              description: Human-readable error message
              example: No agent id provided
          required:
            - code
            - msg
      required:
        - error
  securitySchemes:
    agentAuth:
      type: apiKey
      in: header
      name: x-agent-id
      description: Your API key for authentication

````