Search code examples
marketo

How do use REST API in Marketo to add leads as members into Programs?


How do you use REST API in Marketo to add leads as members into programs?

I have created folders, programs and leads using REST API.

Now I want to add specific leads by using their ID into Programs as members.

How do I do it using REST API or do I need to use a different method?

Please let me know.


Solution

  • Use the "Change Lead Program Status" End point: http://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Leads/changeLeadProgramStatusUsingPOST

    Example call: POST /rest/v1/leads/programs/{programId}/status.json

    data={
        "status": "Registered",
        "input": [
            {"id": 123}
        ]
    }
    

    So you can add up to 300 Lead IDs, but only 1 status at a time (for 1 Program).