how to create custom periodic task in celery in django

I want to create a shedular while a API was getting hit after that i have to create the after that i have to stop the shedular in another api was get hitting

API1 → trigger the celery cron for 3 min periodic task

API2 → stop the celery periodic task how

Are you using celery beat for the periodic task?

Please clarify what you mean here.

This “periodic task” - does it run continuously for that time, or does it run for a short period of time every 3 minutes?

When you want the task to stop, does that mean you want to interrupt the task if it’s currently running, or just not allow it to start the next time it’s supposed to start?