curl --request GET \
--url https://api.letpiper.com/v1/auth/me \
--header 'Authorization: Bearer <token>'{
"user": {
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"timezone": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"invited_at": "2023-11-07T05:31:56Z"
},
"organizations": [
{
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_information": "<string>",
"timezone": "<string>",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"role": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"is_system": true
},
"permissions": []
}
]
}Get current user information including their organizations, roles, and permissions.
This endpoint is user-only and rejects platform tokens.
Args: principal: The authenticated principal db: Database session
Returns: User data with list of organizations, roles, and effective permissions
Raises: HTTPException: If principal is a platform token
curl --request GET \
--url https://api.letpiper.com/v1/auth/me \
--header 'Authorization: Bearer <token>'{
"user": {
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"timezone": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"invited_at": "2023-11-07T05:31:56Z"
},
"organizations": [
{
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_information": "<string>",
"timezone": "<string>",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"role": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"is_system": true
},
"permissions": []
}
]
}Platform token (starts with pat_)