Is there is a way to access api level middleware in strapi v4.5

Tbh this sounds like a Strapi bug to me. I would expect field validation to happen every time I create / update an entity, not just on publish. You might want to create an issue on GitHub for that.

AFAIK a workaround for you could be to use the beforeCreate / beforeUpdate lifecycle hooks. Do your field validation there and throw errors if it fails. IIRC the errors will be displayed in the admin panel.

1 Like