No. Scheduled Apex does not allow synchronous callouts directly. If you try HttpRequest inside execute(SchedulableContext), you get a CalloutException: Callout from scheduled Apex not supported.
Why the restriction exists
Scheduled Apex runs on Salesforce’s internal job queue, kicked off by the cron timer. At the moment the job fires, there’s no user-initiated HTTP context — and Salesforce’s policy is that callouts must run in a context where they can be retried or queued without blocking the scheduled-job worker. So the platform refuses callouts in execute() on a Schedulable.
The same rule applies to triggers for the same reason — triggers can’t call out synchronously either.
What you can do inside execute()
- SOQL / SOSL queries
- DML (insert/update/delete/upsert)
- Logging, Limits inspection, basic Apex logic
- Enqueue a Queueable, call a
@future(callout=true)method, or kick off a Batch that does the callout
How to work around it
The pattern is “schedule → enqueue → callout”:
public class NightlySyncSchedule implements Schedulable {
public void execute(SchedulableContext sc) {
System.enqueueJob(new SyncQueueable());
}
}
public class SyncQueueable implements Queueable, Database.AllowsCallouts {
public void execute(QueueableContext qc) {
HttpRequest req = new HttpRequest();
req.setEndpoint('https://api.example.com/sync');
req.setMethod('GET');
HttpResponse res = new Http().send(req);
// process response...
}
}
Note the Database.AllowsCallouts marker on the Queueable — it’s required when a Queueable does HTTP.
See the next question in this set for the full alternate-route discussion.
Common follow-ups
- Can a future method do the callout instead? — Yes, mark it
@future(callout=true). - Why is Queueable usually preferred? — Job chaining, parameter-typed inputs, better visibility in
AsyncApexJob. - Does Batch Apex have the same restriction? — No. Batch Apex implementing
Database.AllowsCalloutscan call out fromexecute().
Verified against: Apex Developer Guide — Invoking Callouts Using Apex, Scheduled Apex limitations. Last reviewed 2026-05-17 for Spring ‘26.