In order to migrate customer data, your user first has to be added as a Customer in Thred.
// Create a customer
export async function createCustomer(
data: {
name: string;
email: string;
},
apiKey: string
) {
return axios.post(`https://dashboard.thred.ai/api/create-customer`, data, {
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
});
}
//RETURNS:
//{
//"message": "Customer created",
//"customer": {
//"id": "CUSTOMER ID",
//"email": "EMAIL",
//"name": "NAME"
//}
//}