import Conductor from "conductor-node";
const conductor = new Conductor("{{YOUR_SECRET_KEY}}");

const endUser = await conductor.endUsers.create({
  sourceId: "12345678-abcd-abcd-example-1234567890ab",
  email: "bob@bigconstruction.com",
  name: "Big Construction Co.",
});
{
  "id": "end_usr_1234567abcdefg",
  "sourceId": "12345678-abcd-abcd-example-1234567890ab",
  "email": "bob@bigconstruction.com",
  "name": "Big Construction Co.",
  "createdAt": "2022-11-16 23:51:08.996+00"
}

Parameters

sourceId
string
required

Your end-user’s unique ID in your database. Must be distinct from your other EndUsers.

email
string
required

Your end-user’s email address.

name
string
required

Your end-user’s company name that will be shown elsewhere in Conductor.

Returns

Returns the EndUser object after successful EndUser creation. Returns an error if the parameters were invalid (for example, specifying an invalid email address).