Adding more contacts in a Sendgrid list

Viewed 2362

I have created a new list using Sendgrid's Python module, but I am confused about how to add emails to that list using the API. According to Sendgrid's documentation I have to send a POST request with parameters 'list_id' and 'recipient_id.' What I don't understand is, where am I going to find this recipient_id when I am trying to add the email addresses for the first time?

I was successful in adding single recipients following this documentation and code example from Github:

response = sg.client.contactdb.recipients.post(request_body=[{'email': 'test@email.com'}])

This adds the email address to what seems to be a full list of email addresses ever saved in my Sendgrid account. I am probably facing this problem because I am new to using APIs, although the documentation is really very poor.

1 Answers
Related