---
updatedAt: 2026-01-26T13:57:47.000Z
agentTools:
  projectIndex: https://docs.nextpertise.nl/llms.txt
---

# Creating and updating an end user

```shell Shell
import requests

# Configure the Nextpertise API
NEXTPERTISE_API = "https://api.nextpertise.nl"
NEXTPERTISE_TOKEN = "xxx"

# Before we can create the end user, we need to know to which organization it should be linked.
response = requests.get(
    f"{NEXTPERTISE_API}/organization/?page=1&page_size=50",
    headers={"authorization": f"Bearer {NEXTPERTISE_TOKEN}"},
)
response.raise_for_status()

# If your user has access to multiple organizations, select the correct one from the returned list.
# In most cases, only one organization will be returned.
organization_details = response.json()["results"][0]
organization_uuid = organization_details["uuid"]
print(organization_details)
# {
#   'uuid': '146848ab-a473-4c89-a403-d2e8f32a2742',
#   'debtor_code': 'DB100',
#   'company': 'Nextpertise B.V.',
# }

# Create a new end user for this organization
response = requests.post(
    f"{NEXTPERTISE_API}/enduser/",
    headers={"authorization": f"Bearer {NEXTPERTISE_TOKEN}"},
    json={
        "organization_uuid": organization_uuid,
        "company_name": "Nextpertise End User",
        "address": {
            "city": None,
            "street": None,
            "zipcode": "2408ZE",
            "house_number": 10,
            "house_number_extension": "",
        },
        "phone_number": "0887775200",
    },
)
response.raise_for_status()
new_end_user = response.json()
print(f"Created new end user {new_end_user['uuid']}.")
# Created new end user efae075b-49a8-428b-b864-e260112b7437.
print(response.json())
# {
#   'uuid': 'efae075b-49a8-428b-b864-e260112b7437',
#   'organization_uuid': '445848ab-a473-4c89-a403-d2e8f39c2741',
#   'company_name': 'Nextpertise End User',
#   'phone_number': '0887775200',
#   'address': {
#     'zipcode': '2408ZE',
#     'house_number': 10,
#     'house_number_extension': '',
#     'city': 'Alphen aan den Rijn',
#     'street': 'Zuidpoolsingel',
#     'province': 'Zuid-Holland',
#     'municipality': 'Alphen aan den Rijn',
#     'latitude': '52.1266051',
#     'longitude': '4.6533684'
#   },
#   'tags': [],
#   'archived': False
# }

# Let's use the UUID to change the end user's name
response = requests.patch(
    f"{NEXTPERTISE_API}/enduser/{new_end_user_uuid}",
    headers={"authorization": f"Bearer {NEXTPERTISE_TOKEN}"},
    json={
        "company_name": "Nextpertise End User Renamed",
    },
)
response.raise_for_status()
print(f"Updated end user {new_end_user_uuid}.")
# Updated end user efae075b-49a8-428b-b864-e260112b7437.
print(response.json())
# {
#   'uuid': 'efae075b-49a8-428b-b864-e260112b7437',
#   'organization_uuid': '445848ab-a473-4c89-a403-d2e8f39c2741',
#   'company_name': 'Nextpertise End User Renamed',
#   'phone_number': '0887775200',
#   'address': {
#     'zipcode': '2408ZE',
#     'house_number': 10,
#     'house_number_extension': '',
#     'city': 'Alphen aan den Rijn',
#     'street': 'Zuidpoolsingel',
#     'province': 'Zuid-Holland',
#     'municipality': 'Alphen aan den Rijn',
#     'latitude': '52.1266051',
#     'longitude': '4.6533684'
#   },
#   'tags': [],
#   'archived': False
# }


```

# Configure the API

<!-- shell@3-5 -->

Set the Nextpertise API location and your API token. More information about obtaining a new API token can be found on the [Authentication](https://docs.nextpertise.nl/reference/authentication) page.

# Get your organization UUID

<!-- shell@7-23 -->

While not the case for most, a single user can be part of multiple organizations. An end user must be linked to a single organization. We use the [Get Organizations](https://docs.nextpertise.nl/reference/get_organizations) endpoint to find our organization UUID.

# Create a new end user

<!-- shell@25-66 -->

Now that we have the organization UUID, we can create the new end user! The end user is a useful administrative entity to manage which connections belong to whom. Orders and connections can be found by searching on the end user, and, in case of hardware deliveries, you can send them directly to the end user's adres.

# Update the end user

<!-- shell@67-97 -->

Using the [Update Enduser](https://docs.nextpertise.nl/reference/update_enduser) endpoint it is easy to change the end user! In the example we have changed the name of the end user.