> ## Documentation Index
> Fetch the complete documentation index at: https://developers.podero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# User Management

> Manage end-users, their devices, and data from the partner back-office

# Partner Back-Office: User Management

Running a complex energy optimization over large device fleets requires good tooling. Our utility back-office web app is designed to help Partners manage the connected fleet of their end-users' devices, provide customer support, and coordinate within their team.

<Note>
  Administrative functions like Partner user account management are largely done via the Podero utility back-office web app.
</Note>

## List All Users

Get a dashboard overview of all users in your organization:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    'https://app.podero.com/api/partners/v2.0/org/{org_id}/users' \
    -H 'accept: application/json' \
    -H 'Authorization: Bearer {auth_token}'
  ```

  ```python Python theme={null}
  response = requests.get(
      f'https://app.podero.com/api/partners/v2.0/org/{org_id}/users',
      headers={
          'accept': 'application/json',
          'Authorization': f'Bearer {auth_token}'
      }
  )

  users = response.json()
  ```
</CodeGroup>

## Create New User

Add a new end-user to your organization:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    'https://app.podero.com/api/partners/v2.0/org/{org_id}/users' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer {auth_token}' \
    -d '{
      "role": "user",
      "email": "newuser@gmail.com",
      "external_user_id": "customer_12345",
      "first_name": "John",
      "last_name": "Doe"
    }'
  ```

  ```python Python theme={null}
  response = requests.post(
      f'https://app.podero.com/api/partners/v2.0/org/{org_id}/users',
      headers={
          'accept': 'application/json',
          'Content-Type': 'application/json',
          'Authorization': f'Bearer {auth_token}'
      },
      json={
          'role': 'user',
          'email': 'newuser@gmail.com',
          'external_user_id': 'customer_12345',
          'first_name': 'John',
          'last_name': 'Doe'
      }
  )

  new_user = response.json()
  user_id = new_user['id']
  ```
</CodeGroup>

<Tip>
  Use the `external_user_id` field to link Podero users with your internal customer IDs.
</Tip>

## Update User Data

Modify existing user information:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT \
    'https://app.podero.com/api/partners/v2.0/org/{org_id}/users/{user_id}' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer {auth_token}' \
    -d '{
      "first_name": "Peter",
      "last_name": "Schmidt",
      "street_and_number": "Main Street 123",
      "zip_code": "10115",
      "town": "Berlin",
      "country": "DE"
    }'
  ```

  ```python Python theme={null}
  response = requests.put(
      f'https://app.podero.com/api/partners/v2.0/org/{org_id}/users/{user_id}',
      headers={
          'accept': 'application/json',
          'Content-Type': 'application/json',
          'Authorization': f'Bearer {auth_token}'
      },
      json={
          'first_name': 'Peter',
          'last_name': 'Schmidt',
          'street_and_number': 'Main Street 123',
          'zip_code': '10115',
          'town': 'Berlin',
          'country': 'DE'
      }
  )

  updated_user = response.json()
  ```
</CodeGroup>

## Get User Details

Retrieve complete information for a specific user:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET \
    'https://app.podero.com/api/partners/v2.0/org/{org_id}/users/{user_id}' \
    -H 'accept: application/json' \
    -H 'Authorization: Bearer {auth_token}'
  ```

  ```python Python theme={null}
  response = requests.get(
      f'https://app.podero.com/api/partners/v2.0/org/{org_id}/users/{user_id}',
      headers={
          'accept': 'application/json',
          'Authorization': f'Bearer {auth_token}'
      }
  )

  user = response.json()
  ```
</CodeGroup>

## Get User's Devices

Retrieve all devices associated with a user:

<CodeGroup>
  ```bash Heat Pumps theme={null}
  curl -X GET \
    'https://app.podero.com/api/partners/v2.0/org/{org_id}/users/{user_id}/heat-pumps' \
    -H 'Authorization: Bearer {auth_token}'
  ```

  ```bash Electric Vehicles theme={null}
  curl -X GET \
    'https://app.podero.com/api/partners/v2.0/org/{org_id}/users/{user_id}/electric-vehicles' \
    -H 'Authorization: Bearer {auth_token}'
  ```

  ```bash Solar Inverters theme={null}
  curl -X GET \
    'https://app.podero.com/api/partners/v2.0/org/{org_id}/users/{user_id}/inverters' \
    -H 'Authorization: Bearer {auth_token}'
  ```
</CodeGroup>

## Best Practices

<AccordionGroup>
  <Accordion title="Data Management">
    * Regularly sync external\_user\_id with your internal systems
    * Maintain up-to-date contact information for support
    * Use consistent location data for accurate optimization
    * Archive or flag inactive users appropriately
  </Accordion>

  <Accordion title="Support Operations">
    * Create support tickets linked to user\_id
    * Log all API operations for audit trails
    * Implement alerts for device disconnections
    * Provide self-service reconnection options
  </Accordion>

  <Accordion title="Security">
    * Restrict user management to authorized staff only
    * Log all user data modifications
    * Implement role-based access control
    * Never expose user credentials or sensitive data
  </Accordion>
</AccordionGroup>

## Common Support Scenarios

<Tabs>
  <Tab title="Device Not Connecting">
    **Steps:**

    1. Check `is_authenticated` status in device response
    2. If `false`, check the `actions` array for an entry with a `resolution_link`
    3. Redirect the user to the `resolution_link` URL to reconnect their device
    4. Verify `is_authenticated` returns `true` after the user completes the flow
  </Tab>

  <Tab title="Optimization Not Working">
    **Steps:**

    1. Verify `is_smart_optimization_active` is true
    2. Check device authentication status
    3. Review temperature/charge limits are set correctly
    4. Ensure energy contract data is up-to-date
  </Tab>

  <Tab title="User Migration">
    **Steps:**

    1. Create new user in Podero
    2. Update `external_user_id` with old system ID
    3. Migrate all devices
    4. Verify data integrity
    5. Archive old user record (if needed)
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="Team Administration" icon="user-shield" href="/partner-api/user-journeys/back-office/team-administration">
    Manage staff and admin users
  </Card>

  <Card title="User Parameters" icon="book" href="/partner-api/reference/users">
    Complete user parameter reference
  </Card>
</CardGroup>
