Kartra Documentation TECHNICAL DOCUMENTATION

Action: Subscribe a lead to a list

This will allow you to subscribe a lead to any specific mailing list. Note that you must have previously created your list within your Kartra account (https://app.kartra.com/communication/lists).

The API call will fail if it doesn’t find the specified list within your Kartra account.

 

Type Parameters Values
POST cmd* subscribe_lead_to_list
POST list_name* string

* Required fields

Here is an example:

'lead' => [
    'email' => 'example@email.com'
],
'actions' => [
    '0' => [
        'cmd' => 'subscribe_lead_to_list',
        'list_name' => 'List name'
    ]
]

Success message:

{
  "status": "Success",
  "message": "The lead will be subscribed in list {list_name} in a few moments",
  "type": "101"
}

Error Cases:

Type Number Message Cause
207 list_name cannot be empty. Nothing done
  • ‘list_name’ parameter it is mandatory and cannot be empty.
231 list does not exist. Nothing done
  • The list is not in our database.

An example of an error message:

{
  "status": "Error",
  "message": "list does not exist. Nothing done",
  "type": "207"
}

© 2021 Kartra All Rights Reserved