One approach would be to have a script that, when triggered by a specific rule, adds the agent to the exclusion group and schedules a task (for example with cron or at) to remove it from that group one hour later.
Depending on your environment, you could implement this in two ways:
From the manager → using the server option in Active Response. In this case, you can reuse the service token already generated by the manager (no need to create a dedicated user), usually available at:
From another server with an agent → using the defined-agent option, so that host acts as a scheduler and executes the API calls.
In both approaches, if you prefer to use dedicated credentials instead of the local service token, you can rely on secret management tools to avoid storing them in plain text. Two well-known open source options are: