# Authentication

## login

`TOOL login`

Login to Gauzy with email and password and create a session

Authentication: no security requirement declared for this operation.

Parameters:

- `email` (argument, string, email, required) - Email address for authentication
  Type: string, email
  
  Email address for authentication
  
  pattern: "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"

- `password` (argument, string, required) - Password for authentication
  Type: string
  
  Password for authentication
  
  minLength: 1

- `createSession` (argument, boolean, optional) - Whether to create a new session (default: true)
  Type: boolean
  
  Whether to create a new session (default: true)

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "login",
    "arguments": {
        "email": "user@example.com",
        "password": "string",
        "createSession": true
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "login",
  "arguments": {
    "email": "user@example.com",
    "password": "string",
    "createSession": true
  }
});
```

### Python

```python
result = await session.call_tool("login", arguments={
  "email": "user@example.com",
  "password": "string",
  "createSession": true
})
```


## logout

`TOOL logout`

Logout from Gauzy, clear authentication tokens, and cleanup sessions

Authentication: no security requirement declared for this operation.

Parameters:

- `cleanupAllSessions` (argument, boolean, optional) - Whether to cleanup all user sessions (default: true)
  Type: boolean
  
  Whether to cleanup all user sessions (default: true)

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "logout",
    "arguments": {
        "cleanupAllSessions": true
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "logout",
  "arguments": {
    "cleanupAllSessions": true
  }
});
```

### Python

```python
result = await session.call_tool("logout", arguments={
  "cleanupAllSessions": true
})
```


## get_auth_status

`TOOL get_auth_status`

Get current authentication status, user information, and session details

Authentication: no security requirement declared for this operation.

Parameters:

- `includeSessionInfo` (argument, boolean, optional) - Whether to include session information (default: true)
  Type: boolean
  
  Whether to include session information (default: true)

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_auth_status",
    "arguments": {
        "includeSessionInfo": true
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "get_auth_status",
  "arguments": {
    "includeSessionInfo": true
  }
});
```

### Python

```python
result = await session.call_tool("get_auth_status", arguments={
  "includeSessionInfo": true
})
```


## refresh_auth_token

`TOOL refresh_auth_token`

Manually refresh the authentication token and update session context

Authentication: no security requirement declared for this operation.

Parameters:

- `updateSessionActivity` (argument, boolean, optional) - Whether to update session activity (default: true)
  Type: boolean
  
  Whether to update session activity (default: true)

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "refresh_auth_token",
    "arguments": {
        "updateSessionActivity": true
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "refresh_auth_token",
  "arguments": {
    "updateSessionActivity": true
  }
});
```

### Python

```python
result = await session.call_tool("refresh_auth_token", arguments={
  "updateSessionActivity": true
})
```


## get_session_info

`TOOL get_session_info`

Get detailed information about current or user sessions

Authentication: no security requirement declared for this operation.

Parameters:

- `targetSessionId` (argument, string, optional) - Specific session ID to query (default: current session)
  Type: string
  
  Specific session ID to query (default: current session)

- `includeConnections` (argument, boolean, optional) - Whether to include connection details (default: false)
  Type: boolean
  
  Whether to include connection details (default: false)

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_session_info",
    "arguments": {
        "targetSessionId": "string",
        "includeConnections": true
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "get_session_info",
  "arguments": {
    "targetSessionId": "string",
    "includeConnections": true
  }
});
```

### Python

```python
result = await session.call_tool("get_session_info", arguments={
  "targetSessionId": "string",
  "includeConnections": true
})
```


## cleanup_sessions

`TOOL cleanup_sessions`

Cleanup expired sessions and get session statistics

Authentication: no security requirement declared for this operation.

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "cleanup_sessions",
    "arguments": {}
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "cleanup_sessions",
  "arguments": {}
});
```

### Python

```python
result = await session.call_tool("cleanup_sessions", arguments={})
```
