SureshakeDocs
ApiEndpoints

User Endpoints

Manage user profiles and settings.

User endpoints allow you to manage your own profile and view public profiles of other users.

Get Current User

Retrieve the profile of the currently authenticated user.

GET/api/v1/users/me
curl -H "Authorization: Bearer $TOKEN" https://api.sureshake.com/api/v1/users/me
const response = await fetch('https://api.sureshake.com/api/v1/users/me', {
headers: { 'Authorization': `Bearer ${token}` }
});
const { data } = await response.json();
200 OK
{
"data": {
  "id": "user_2mxr57...",
  "email": "alex@example.com",
  "name": "Alex River",
  "slug": "alex-river",
  "avatar": "https://...",
  "bio": "Strategic analyst...",
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-03-20T14:45:00Z"
},
"meta": {
  "timestamp": "2024-03-20T15:00:00Z"
}
}

Get User Profile

Retrieve a public user profile by its unique identifier.

GET/api/v1/users/profile/:id
curl https://api.sureshake.com/api/v1/users/profile/user_2mxr57...
const response = await fetch('https://api.sureshake.com/api/v1/users/profile/user_2mxr57...');
const { data } = await response.json();

Update Profile

Update your own profile information.

PATCH/api/v1/users/me
curl -X PATCH \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Alex River", "bio": "New bio..."}' \
https://api.sureshake.com/api/v1/users/me
const response = await fetch('https://api.sureshake.com/api/v1/users/me', {
method: 'PATCH',
headers: {
  'Authorization': `Bearer ${token}`,
  'Content-Type': 'application/json'
},
body: JSON.stringify({
  name: 'Alex River',
  bio: 'New bio...'
})
});

On this page