Retrieve current session information including active signin, user data, and session state.
curl --request GET \
--url https://{deploymentHost}/session
{
"status": 200,
"message": "",
"data": {
"user": {
"id": "user_456789123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"username": "johndoe",
"image_url": "https://cdn.example.com/avatars/johndoe.jpg",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
"organization": {
"id": "org_123456789",
"name": "Acme Corporation",
"slug": "acme-corp",
"image_url": "https://cdn.example.com/orgs/acme.jpg"
},
"workspace": {
"id": "workspace_987654321",
"name": "Development Team",
"slug": "dev-team"
}
},
"session": {
"signin_attempts": [],
"signins": [
{
"id": "signin_987654321",
"user_id": "user_456789123",
"created_at": "2024-01-01T12:00:00Z"
}
],
"signup_attempts": [],
"active_signin": {
"id": "signin_987654321",
"user_id": "user_456789123",
"created_at": "2024-01-01T12:00:00Z"
}
},
"errors": []
}
Session cookie authentication for production deployments. The session token is automatically set as an HTTP-only, secure cookie.
Session information retrieved successfully
The response is of type object
.
curl --request GET \
--url https://{deploymentHost}/session
{
"status": 200,
"message": "",
"data": {
"user": {
"id": "user_456789123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"username": "johndoe",
"image_url": "https://cdn.example.com/avatars/johndoe.jpg",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
"organization": {
"id": "org_123456789",
"name": "Acme Corporation",
"slug": "acme-corp",
"image_url": "https://cdn.example.com/orgs/acme.jpg"
},
"workspace": {
"id": "workspace_987654321",
"name": "Development Team",
"slug": "dev-team"
}
},
"session": {
"signin_attempts": [],
"signins": [
{
"id": "signin_987654321",
"user_id": "user_456789123",
"created_at": "2024-01-01T12:00:00Z"
}
],
"signup_attempts": [],
"active_signin": {
"id": "signin_987654321",
"user_id": "user_456789123",
"created_at": "2024-01-01T12:00:00Z"
}
},
"errors": []
}