# đź› technical-support
YFS
YFS·20 replies

Hey guys, I'm currently setting up a create contact action in studio.

This is my edited script: const token = CONFIG.BREVO_API_KEY; let list_id = CONFIG.BREVO_LIST_ID; list_id = Number(list_id);

const API_ENDPOINT = https://api.brevo.com/v3/contacts; const HEADERS = { 'content-type': 'application/json', 'accept': 'application/json', 'api-key': token };

let email = CONTACT.email ""; let first_name = CONTACT.name ? CONTACT.name : (CONTACT.email ? CONTACT.email.split("@")[0] : CONTACT.phone); let last_name = CONTACT.name "";

let raw = JSON.stringify({ "email": email, "attributes": { "FNAME": first_name, "LNAME": last_name }, "listIds": [list_id] })

const OPTIONS = { method: "POST", headers: HEADERS, body: raw, redirect: "follow" };

async function createContact() { const response = await fetch(API_ENDPOINT, OPTIONS).then(res=>res.text()); return response; }

try { let contact = await createContact(); return console.log("Contact Data", contact); } catch (error) { return console.log("Error Occured", error.message); }

What variables do I need to enter for email and name to create the contact? I've tried several options, none of them worked. Thanks for any help

YFS
YFS31/07/2025 07:32

i saw that. but i can not create a new attribute in the backend - right?

Ankur | YourGPT
Ankur | YourGPT31/07/2025 07:38

Could you please share more details on this.

YFS
YFS31/07/2025 07:54

I would like to collect email, name and last name as i did in the leadgen flow.

after i used the Brevo Create Contact Flow to collect the contacts in Brevo

If i add the custom attribute lastname to the form, i only receive name in contacts.

Is it possible to add the custom last name attribute to the contact (CRM) in yourgpt?

also can you please check the brevo flow that should be triggered by the lead gen flow?

Ankur | YourGPT
Ankur | YourGPT31/07/2025 08:07

Is it possible to add the custom last name attribute to the contact (CRM) in yourgpt?

You can share this to Feature Request.

YFS
YFS31/07/2025 08:17

ok.

YFS
YFS31/07/2025 08:17

@Ankur can you please check my brevo intergration flow? i would to get this running as well

YFS
YFS31/07/2025 08:18

therefore the name and last name would be great

Ankur | YourGPT
Ankur | YourGPT31/07/2025 08:18

Yes, I’m on it—checking the Brevo integration flow now.

standard1
Ankur | YourGPT
Ankur | YourGPT31/07/2025 10:07

I checked your Brevo Create Contact flow. Can you confirm if you've added your authorized IP in Brevo?

YFS
YFS31/07/2025 10:58

ah no i havent

YFS
YFS31/07/2025 11:05

But i have entered the API key in your GPT

that all the tutorial says i have to do.

can you tell what i have to do exactly? or share a link?

Ankur | YourGPT
Ankur | YourGPT31/07/2025 11:11

You need to add your IP address to Brevo for it to work properly.

YFS
YFS31/07/2025 11:39

okay. I have adde mine

YFS
YFS31/07/2025 11:55

i have changed the script to name and email only.

can you please check it again if everything is right?

YFS
YFS31/07/2025 11:55
YFS
YFS31/07/2025 13:42

@Ankur any news?

Ankur | YourGPT
Ankur | YourGPT31/07/2025 13:55

Please check if the contact was successfully created.

Ankur | YourGPT
Ankur | YourGPT31/07/2025 13:55

After adding the IP in Brevo.

YFS
YFS31/07/2025 14:32

Yes the contact is successfully created in yourGPT

YFS
YFS31/07/2025 14:33

which IP do you mean?