-
Login:
- Environment: Production or Sandbox
- API Version: Latest
- Check "I agree to the terms of service"
- Click "Login with Salesforce"
-
Get Apex Log IDs:
- Go to: Utilities → REST Explorer
- URI: /services/data/v61.0/tooling/query/?q=SELECT+Id+FROM+ApexLog
- Click "Execute"
- Copy the returned IDs
-
Delete Logs in Bulk:
- URI: /services/data/v61.0/tooling/composite
- Method: POST
- Request Body (replace with your IDs, up to 25/max):
{ "allOrNone": false, "compositeRequest": [ { "method": "DELETE", "url": "/services/data/v61.0/tooling/sobjects/ApexLog/NEXT_APEX_LOG_HERE1", "referenceId": "a1" }, { "method": "DELETE", "url": "/services/data/v61.0/tooling/sobjects/ApexLog/NEXT_APEX_LOG_HERE2", "referenceId": "a2" }, { "method": "DELETE", "url": "/services/data/v61.0/tooling/sobjects/ApexLog/NEXT_APEX_LOG_HERE3", "referenceId": "a3" }, { "method": "DELETE", "url": "/services/data/v61.0/tooling/sobjects/ApexLog/NEXT_APEX_LOG_HERE4", "referenceId": "a4" }, { "method": "DELETE", "url": "/services/data/v61.0/tooling/sobjects/ApexLog/NEXT_APEX_LOG_HERE5", "referenceId": "a5" } ] }
✅ Each successful deletion returns "httpStatusCode": 204
🔁 If you have more than 25 IDs, repeat in batches of 25.