User API Documentation

Get All Users

Endpoint

GET /users

Response Structure

Response Fields:

  • UserId: Unique identifier for the user
  • Name: User's name
  • Email: User's email address
  • OrganizationId: Organization identifier
  • Role: User's role
  • CreatedAt: Account creation timestamp
  • UpdatedAt: Last update timestamp

REQUEST EXAMPLE

curl --location 'https://apidev.xbattery.energy/v1/users' \
--header 'ApiKey: '

RESPONSE EXAMPLE

{
  "success": true,
  "data": [
    {
      "UserId": "75016f277a3e-4b7c-8351866652ba3a41",
      "Name": "sonu",
      "Email": "sonu@xbattery.energy",
      "OrganizationId": 1,
      "Role": "Admin",
      "CreatedAt": "20250103T092322.214Z",
      "UpdatedAt": "20250103T092322.214Z"
    },
    {
      "UserId": "773b9d2c-f57c-4dfa-84a8-f77aca9b672b",
      "Name": "Kiran",
      "Email": "kiran@xbattery.energy",
      "OrganizationId": 1,
      "Role": "Admin",
      "CreatedAt": "20241217T084034.083Z",
      "UpdatedAt": "20250218T060642.352Z"
    }
  ]
}

Get User By ID

Endpoint

GET /users/{userId}

Response Structure

Response Fields:

  • UserId: Unique identifier for the user
  • Name: User's name
  • Email: User's email address
  • OrganizationId: Organization identifier
  • Role: User's role
  • CreatedAt: Account creation timestamp
  • UpdatedAt: Last update timestamp

REQUEST EXAMPLE

curl --location 'https://apidev.xbattery.energy/v1/users/{userId}' \
--header 'ApiKey: '

RESPONSE EXAMPLE

{
  "success": true,
  "data": [
    {
      "UserId": "75016f277a3e-4b7c-8351866652ba3a41",
      "Name": "sonu",
      "Email": "sonu@xbattery.energy",
      "OrganizationId": 1,
      "Role": "Admin",
      "CreatedAt": "20250103T092322.214Z",
      "UpdatedAt": "20250103T092322.214Z"
    }
  ]
}