Users
Invite a learner
Creates or refreshes a pending learner invitation. Email failure does not roll back the invitation.
POST
https://dash.trainertwin.com/api/v1
/
users
Invite a learner
curl --request POST \
--url https://dash.trainertwin.com/api/v1/users \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"email": "learner@example.com"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'learner@example.com'})
};
fetch('https://dash.trainertwin.com/api/v1/users', 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"
payload = { "email": "learner@example.com" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"invitation": {
"id": "invitation_123",
"email": "learner@example.com",
"status": "pending",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
},
"emailSent": true
}{
"invitation": {
"id": "invitation_123",
"email": "learner@example.com",
"status": "pending",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
},
"emailSent": true
}{
"error": "Resource not found"
}{
"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).
Body
application/json
Maximum string length:
320Example:
"learner@example.com"
⌘I
Invite a learner
curl --request POST \
--url https://dash.trainertwin.com/api/v1/users \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"email": "learner@example.com"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'learner@example.com'})
};
fetch('https://dash.trainertwin.com/api/v1/users', 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"
payload = { "email": "learner@example.com" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"invitation": {
"id": "invitation_123",
"email": "learner@example.com",
"status": "pending",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
},
"emailSent": true
}{
"invitation": {
"id": "invitation_123",
"email": "learner@example.com",
"status": "pending",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
},
"emailSent": true
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}