I am using civix tool to create an extension. I created an API using civix tool.I want to create API v4. How to create API v4?

  • The documentation* shows '--api-version=' in an example for generate:entity, but when I tried to apply it to generate:api it errors with 'The "--api-version" option does not exist.' I'm running civix version v21.04.1. *docs.civicrm.org/dev/en/latest/step-by-step/create-entity
    – wil_SRQ
    Commented Sep 1, 2021 at 11:31

1 Answer 1


For api4 the instructions are at https://docs.civicrm.org/dev/en/latest/api/v4/architecture/#api-entity-classes

  • Thanks. Those instructions don't mention civix, hence my interest in this question. It appears that civix does not facilitate extensions that add api v4 entities. The other conclusion I'm drawing is that Scheduled Jobs only looks at api v3 entities. If either of these conclusions is off, I'd appreciate corrections.
    – wil_SRQ
    Commented Sep 22, 2021 at 13:26
  • For scheduled jobs, I haven't tried it but I think it uses any mgd.php file where the entity inside the file is "Job", so you could copy/paste an mgd.php file for a v3 scheduled job and then just edit the params in there to match your v4 class and see what happens.
    – Demerit
    Commented Sep 22, 2021 at 13:36

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.