# Setting custom user id via script

**URL:** <https://forum.seatable.com/t/setting-custom-user-id-via-script/7608>\
**Category:** User Talk\
**Created:** [October 31, 2026, 8:33am UTC](https://forum.seatable.com/t/setting-custom-user-id-via-script/7608 "2026-10-31T08:33:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TOMO](https://forum.seatable.com/user_avatar/forum.seatable.com/tomo/32/1848_2.png) [@TOMO](https://forum.seatable.com/u/TOMO)\
**Post date:** [October 31, 2026, 8:33am UTC](https://forum.seatable.com/t/setting-custom-user-id-via-script/7608/1 "2026-10-31T08:33:42Z")

</div>

## My Setup:

- SeaTable Dedicated

## My Problem:

I want to create a user with data from a table. I use a user API token and can set email, name and password. But I did not found anything to set the field “ID” from the user record (custom id). I tried to reference it as `id` and `user_id` but both did not work.

 ![image](https://forum.seatable.com/uploads/default/original/2X/4/4badc7dbe72d9c2fa9764413534e2f08e0d86755.png)

Any ideas how I can set it?

## Code snippet:

Here is a snippet from my script:

```auto
        # Die aktuell ausgewählte Zeile aus dem Kontext holen
        current_row = getattr(context, "current_row", None)
        
        if current_row:
            # Daten für den neuen Benutzer vorbereiten
            # Passe die Feldnamen ("Email", "Name", "Initial PW") ggf. an deine Tabelle an
            email = current_row.get("Email")
            name = current_row.get("Name")
            custom_id = current_row.get("User ID")
            password = current_row.get("Initial PW")
            
            if not email:
                print("Fehler: Keine E-Mail-Adresse in der Zeile gefunden.")
                return

            # API-Endpunkt für die Erstellung von Benutzern in SeaTable Admin
            url = f"{SERVER_URL}/api/v2.1/admin/users/"
            
            headers = {
                "Authorization": f"Token {ADMIN_API_TOKEN}",
                "Content-Type": "application/json"
            }
            
            # Nutzlast (Payload) für den neuen Benutzer
            payload = {
                "email": email,
                "name": name,
                "custom_id": custom_id, # only 'id' does not work
                "password": password
            }
            
            # Anfrage an SeaTable senden
            response = requests.post(url, json=payload, headers=headers)

[...]

```

---

<div class="post-metadata">

**Author:** ![rdb](https://forum.seatable.com/user_avatar/forum.seatable.com/rdb/32/1869_2.png) [@rdb](https://forum.seatable.com/u/rdb)\
**Post date:** [October 31, 2026, 8:58am UTC](https://forum.seatable.com/t/setting-custom-user-id-via-script/7608/2 "2026-10-31T08:58:52Z")

</div>

What you are looking for is the `id_in_org`.

> **[Update User](https://api.seatable.com/reference/updateuser)**
>
> Update a user's details. See the parameter list for the detailed description of each entry.

---

<div class="post-metadata">

**Author:** ![TOMO](https://forum.seatable.com/user_avatar/forum.seatable.com/tomo/32/1848_2.png) [@TOMO](https://forum.seatable.com/u/TOMO)\
**Post date:** [October 31, 2026, 1:18pm UTC](https://forum.seatable.com/t/setting-custom-user-id-via-script/7608/3 "2026-10-31T13:18:41Z")

</div>

I was close to this help page. 😁

I just tried `id_in_org` instead of `custom_id` but no success. So I tried the `Get User` method (as described in [Get User](https://api.seatable.com/reference/getuser)) and could see `id_in_org` in the response (from the current logged-in user).

 ![image](https://forum.seatable.com/uploads/default/original/2X/2/2d3b1815152ad63a3c6918de6e23ec68ea87ec4a.png)

I do not understand why I can use it (see it) when I read the record but cannot use it to set it.

BTW: I cannot set a phone number via script or the browser as well. All types of phone numbers are flagged as “phone invalid”. I tried multiple formats.

 ![image](https://forum.seatable.com/uploads/default/original/2X/f/f3244f4811b86001422083e43f85caba55335718.png)

---

<div class="post-metadata">

**Author:** ![rdb](https://forum.seatable.com/user_avatar/forum.seatable.com/rdb/32/1869_2.png) [@rdb](https://forum.seatable.com/u/rdb)\
**Post date:** [October 31, 2026, 1:31pm UTC](https://forum.seatable.com/t/setting-custom-user-id-via-script/7608/4 "2026-10-31T13:31:41Z")

</div>

> [@TOMO](#):
>
> I do not understand why I can use it (see it) when I read the record but cannot use it to set it.

That’d be way too easy 😉

Ok, now seriously, I have created an internal ticket. We’ll improve the `addnewuser` endpoint.

> **[Add New User](https://api.seatable.com/reference/addnewuser)**
>
> Add a new user with desired details.

---

<div class="post-metadata">

**Author:** ![TOMO](https://forum.seatable.com/user_avatar/forum.seatable.com/tomo/32/1848_2.png) [@TOMO](https://forum.seatable.com/u/TOMO)\
**Post date:** [October 31, 2026, 1:44pm UTC](https://forum.seatable.com/t/setting-custom-user-id-via-script/7608/5 "2026-10-31T13:44:42Z")

</div>

This is my actual script (snippet):

```auto
[...]

if current_row:
# Daten für den neuen Benutzer vorbereiten
# Passe die Feldnamen ("Email", "Name", "Initial PW") ggf. an deine Tabelle an
email = current_row.get("Email")
name = current_row.get("Name")
id_in_org = current_row.get("User ID")
phone = "+4912345678"
password = current_row.get("Initial PW")

# API-Endpunkt für die Erstellung von Benutzern in SeaTable Admin
url = f"{SERVER_URL}/api/v2.1/admin/users/"

headers = {
	"Authorization": f"Token {ADMIN_API_TOKEN}",
	"Content-Type": "application/json"
}

# Nutzlast (Payload) für den neuen Benutzer
payload = {
	"email": email,
	"name": name,
	"id_in_org": id_in_org,
	"phone": phone,
	"password": password
}

# Anfrage an SeaTable senden
response = requests.post(url, json=payload, headers=headers)

[...]

```

And this is what I get when I query the user above:

 ![image](https://forum.seatable.com/uploads/default/original/2X/2/217d64fb3135f74f7f412eec545559759eb0a36d.png)

Both, `id_in_org` and `phone` are empty. And when I check the Scriptlog (I added the variables to the log) I can see that the variables are set:

 ![image](https://forum.seatable.com/uploads/default/original/2X/0/0664c366927ddb0551a3153d34ac8807d2415bc7.png)
