get__user_{userId}

GET /user/{userId}

Get User by ID

Retrieve role information for a specific user within the same organization. This endpoint allows organization members to view each other's roles and permissions.

TypeScript Client Library

public getUserById = async (userId: string): Promise<UserRoleResponse> => {
  return this.makeRequest<UserRoleResponse>(`user/${userId}`, 'GET', null);
};

Code Samples

# You can also use wget
curl -X GET https://backend.flashback.tech/user/{userId} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

Parameters

Name
In
Type
Required
Description

userId

path

string

true

Unique identifier of the target user

Example responses

200 Response

{
  "success": true,
  "data": {
    "userId": "550e8400-e29b-41d4-a716-446655440000",
    "orgRole": 2,
    "orgRoleDescription": "WORKSPACES",
    "orgRoles": [0, 1, 2]
  }
}

403 Response

{
  "success": false,
  "message": "User not associated with any organization"
}

404 Response

{
  "success": false,
  "message": "User not found"
}

500 Response

{
  "success": false,
  "message": "Internal server error",
  "error": "Database connection failed"
}

Responses

Status
Meaning
Description
Schema

200

User role retrieved successfully

Inline

403

Access denied

Inline

404

User not found

Inline

500

Internal server error

Inline

Response Schema

Status Code 200

Name
Type
Required
Restrictions
Description

» success

boolean

false

none

Indicates if the request was successful

» data

object

false

none

User role data

»» userId

string

false

none

Unique identifier for the target user

»» orgRole

integer

false

none

User's organization role (0x00-0xff)

»» orgRoleDescription

string

false

none

Human-readable role description

»» orgRoles

[integer]

false

none

Array of available roles for the user

Status Code 403

Name
Type
Required
Restrictions
Description

» success

boolean

false

none

Indicates if the request was successful

» message

string

false

none

Error message describing the access restriction

Status Code 404

Name
Type
Required
Restrictions
Description

» success

boolean

false

none

Indicates if the request was successful

» message

string

false

none

Error message describing the issue

Status Code 500

Name
Type
Required
Restrictions
Description

» success

boolean

false

none

Indicates if the request was successful

» message

string

false

none

Error message describing the issue

» error

string

false

none

Detailed error information

Enumerated Values

Parameter
Value
Description

» orgRole

0x00

USER - Default role with basic access

» orgRole

0x01

BILLING - Can manage billing and subscriptions

» orgRole

0x02

WORKSPACES - Can manage workspaces and team members

» orgRole

0xfe

ADMINISTRATORS - Administrative access

» orgRole

0xff

OWNER - Full organization access

Last updated

Was this helpful?