Users
Update a learner
Updates the learner’s display name. Email and role changes are not supported.
PATCH
https://dash.trainertwin.com/api/v1
/
users
/
{userId}
Update a learner
curl --request PATCH \
--url https://dash.trainertwin.com/api/v1/users/{userId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Avery Patel"
}
'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Avery Patel'})
};
fetch('https://dash.trainertwin.com/api/v1/users/{userId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dash.trainertwin.com/api/v1/users/{userId}"
payload = { "name": "Avery Patel" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"user": {
"id": "user_123",
"memberId": "member_123",
"name": "Avery Patel",
"email": "avery@example.com",
"emailVerified": true,
"role": "member",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}Authorizations
Organization API key generated in Dashboard → account menu → Developer API (dash.trainertwin.com/developer).
Path Parameters
Learner user ID.
Body
application/json
Required string length:
1 - 100Example:
"Avery Patel"
Response
Updated learner.
Show child attributes
Show child attributes
⌘I
Update a learner
curl --request PATCH \
--url https://dash.trainertwin.com/api/v1/users/{userId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Avery Patel"
}
'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Avery Patel'})
};
fetch('https://dash.trainertwin.com/api/v1/users/{userId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dash.trainertwin.com/api/v1/users/{userId}"
payload = { "name": "Avery Patel" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"user": {
"id": "user_123",
"memberId": "member_123",
"name": "Avery Patel",
"email": "avery@example.com",
"emailVerified": true,
"role": "member",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}