From b548c19374486dedd53cbe561d47a80c33578a72 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Tue, 30 Jul 2024 13:46:10 +0100 Subject: [PATCH] feat: improve persons creation API --- src/v1/persons.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/v1/persons.ts b/src/v1/persons.ts index f9bbf88..7704e79 100644 --- a/src/v1/persons.ts +++ b/src/v1/persons.ts @@ -145,7 +145,7 @@ export type CreatePersonRequest = { /** * The email addresses of the person. If there are no email addresses, please specify an empty array. */ - emails: string[] + emails?: string[] /** * An array of unique identifiers of organizations that the person is associated with. */ @@ -349,7 +349,10 @@ export class Persons { ): Promise { const response = await this.axios.post( personsUrl(), - data, + { + emails: [], // the API requires this field to be present + ...data, + }, ) return response.data }