I am trying to register event participants from code. I have created a custom field group for "Participants".

Using the API, how can I create a value for the custom fields and have them associated with the event that a contact is registered for?


1 Answer 1


Okay, I just figured it out. I just need to chain the API call with CustomValue create:

CRM.api3('Participant', 'create', {
  "debug": 1,
  "sequential": 1,
  "event_id": 145,
  "contact_id": 2,
  "role_id": "Attendee",
  "api.CustomValue.create": {"custom_223":3}
}).done(function(result) {
  // do something
  • 2
    More simply, just add "custom_223": 3 The API explorer can help with the syntax and with figuring out which custom_N you need
    – Aidan
    Nov 30, 2016 at 20:17
  • HI could anyone let me know step by step api developement guide. Apr 1, 2019 at 8:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.