This endpoint lets you create a candidate under one of your tasks.
There are 2 kinds of candidates you can create under a task: temporary and internal. Internal candidates are created from the users under your organization.
There are some common properties between the two kinds of candidates:
// Common properties - all optional
{
group?: string;
labels?: string[];
tags?: Record;
externalId?: string;
externalData?: Record;
lang?: "tr" | "en" | "es" | "fr" | "nl" | "it" | "sr" | "sv" | "de" | "no" | "ru" | "pt";
programIds?: string[];
extraEmails?: string[];
dates?: {
before?: number;// seconds
after?: number;// seconds
};
price?: {
amount: number;
currency: "USD" | "EUR" | "TRY";
};
customizedSteps?: {
stepId: string;
customization: {
activeAfter?: number; //seconds;
activeBefore?: number; //seconds
};
}[];
inviteByEmail?: {
emailTemplateName: string
dateToSend?: number; // seconds
};
callback?: {
url: string;
params?: Record;
resource: "basic" | "detailed";
};
}
The expected body for Temporary Candidate:
Common & {
kind: "temporary-candidate";
fullname?: string;
email?: string;
credential1?: string;
credential2?: string;
tracking?: {
uniqId: string;
scope?: "task" | "group" | "labels" | "programs";// default: task
};
}
By providing the tracking property with a uniqId, the uniqueness of this candidate within the provided scope can be ensured. Within the given scope, Testinvite does not allow the creation of a candidate with a duplicate uniqId.
The expected body for Internal Candidate:
Common & {
kind: "internal-candidate";
id: string; // userId
}
The full name and email information will copied over from the user. The tags of the candidate will be the sum of the tags from the user and the ones provided in the request body.
The username of the user will be assigned as the uniqId of the candidate in order to ensure that user is assigned to the task only once. The username will be assigned also as the first credential of the candidate. The candidate will be able to access the their assessment using their username as their credential.
If the request is successful, the response payload will be as follows:
// "basic" candidate object
{
candidateId: string;
kind: "user" | "temp"; // internal or temporary candidate
taskId: string;
loggedIn: false;
fullname?: string;
email?: string;
invitationCode: string;
}