communityId in the request body.password and confirmPassword, set joinServer: true, and set sendEmail: false / emailPassword: false.createUserAuthorization header using Bearer <apiKey>.communityId in the body.createUser permission.password or confirmPassword.joinServer: true when the user should immediately become a full community member.sendEmail: false and emailPassword: false because the broker or identity provider owns sign-in.customerid.{
"firstname": "Ada",
"lastname": "Lovelace",
"username": "ada_lovelace_123",
"displayname": "Ada Lovelace",
"email": "ada@example.com",
"accessLevel": 1,
"joinServer": true,
"sendEmail": false,
"emailPassword": false,
"customFields": [
{
"fieldIdorName": "customerid",
"value": "<brokerCustomerId-or-cognitoSub>"
}
]
}password or confirmPassword.customerid; the exact field name is community-specific.{
"firstname": "Grace",
"lastname": "Hopper",
"username": "grace_hopper_123",
"displayname": "Grace Hopper",
"email": "grace@example.com",
"accessLevel": 1,
"joinServer": true,
"sendEmail": false,
"emailPassword": false,
"customFields": [
{
"fieldIdorName": "customerid",
"value": "<newUserBrokerCustomerId>"
}
],
"referral": "<referrerReferralValue>"
}referral should contain the value used by the community's custom referral-link mapping. For example, if the referral link maps referral_id to customerid, pass the referrer's customerid value.{
"firstname": "John",
"lastname": "Doe",
"username": "john_doe_123",
"displayname": "John Doe",
"email": "john@example.com",
"password": "StrongPass1!",
"confirmPassword": "StrongPass1!",
"accessLevel": 1,
"joinServer": true,
"sendEmail": true,
"emailPassword": true,
"emailTemplate": "0"
}externalId as a shortcut for the active user identifier field. This only works when the community has an active user identifier field configured. If the community does not have that configuration, use customFields instead.{
"firstname": "Ada",
"lastname": "Lovelace",
"username": "ada_lovelace_123",
"displayname": "Ada Lovelace",
"email": "ada@example.com",
"accessLevel": 1,
"joinServer": true,
"sendEmail": false,
"emailPassword": false,
"externalId": "<brokerCustomerId-or-cognitoSub>"
}externalId is sent for a community without an active identifier field, the API returns:{
"status": "fail",
"code": "EXTERNAL_IDENTIFIER_NOT_CONFIGURED",
"message": "externalId requires an active user identifier field",
"data": {
"externalId": "<brokerCustomerId-or-cognitoSub>",
"created": false
}
}data.userId as the created Returning.AI user ID for follow-up reads.communityMemberId is the community membership record created for this user.identifierKey and externalId are included when the create request resolved an active external identifier.POST /v1/users/filter.POST /v1/users.data.userId from the create response to confirm the user with POST /v1/users/info.{
"filter": {
"customerid": {
"eq": "<brokerCustomerId-or-cognitoSub>"
}
},
"fields": ["username", "email", "customerid", "join_date"]
}{
"idOrEmail": "123456",
"customFields": ["customerid"]
}{
"status": "success",
"data": {
"userId": "123456",
"username": "ada_lovelace_123",
"roles": ["@all"],
"customFields": {
"customerid": "<brokerCustomerId-or-cognitoSub>"
}
}
}POST /v1/users/filter - check whether a user already exists by custom field before creating.POST /v1/users/info - confirm the created user and custom fields before issuing a widget/embed token.curl --location 'https://api.returning.ai/v1/users' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstname": "Ada",
"lastname": "Lovelace",
"username": "ada_lovelace_123",
"displayname": "Ada Lovelace",
"email": "ada@example.com",
"accessLevel": 1,
"joinServer": true,
"sendEmail": false,
"emailPassword": false,
"customFields": [
{
"fieldIdorName": "customerid",
"value": "<brokerCustomerId-or-cognitoSub>"
}
]
}'{
"status": "success",
"code": "USER_CREATED",
"message": "User created successfully",
"data": {
"userId": 123456,
"username": "ada_lovelace_123",
"email": "ada@example.com",
"communityMemberId": "66f000000000000000000001",
"identifierKey": "customerid",
"externalId": "<brokerCustomerId-or-cognitoSub>",
"created": true
}
}