Create a bulk action job
client.EmailSecurity.Investigate.Bulk.New(ctx, params) (*InvestigateBulkNewResponse, error)
POST/accounts/{account_id}/email-security/investigate/bulk
Create a bulk action job
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Create a bulk action job
package main
import (
"context"
"fmt"
"github.com/stainless-sdks/cloudflare-go"
"github.com/stainless-sdks/cloudflare-go/email_security"
"github.com/stainless-sdks/cloudflare-go/option"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
bulk, err := client.EmailSecurity.Investigate.Bulk.New(context.TODO(), email_security.InvestigateBulkNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Action: cloudflare.F(email_security.InvestigateBulkNewParamsActionMove),
SearchParams: cloudflare.F(email_security.InvestigateBulkNewParamsSearchParams{
}),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", bulk.JobID)
}
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"action_params": {
"destination": "Inbox",
"type": "MOVE",
"expected_disposition": "MALICIOUS"
},
"action_type": "MOVE",
"created_at": "2019-12-27T18:11:19.117Z",
"job_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"messages_failed": 0,
"messages_pending": 0,
"messages_successful": 0,
"search_params": {
"action_log": true,
"alert_id": "alert_id",
"delivery_status": "delivered",
"detections_only": true,
"domain": "domain",
"end": "2022-07-25T14:30:00Z",
"exact_subject": "exact_subject",
"final_disposition": "MALICIOUS",
"message_action": "PREVIEW",
"message_id": "message_id",
"metric": "metric",
"query": "query",
"recipient": "recipient",
"sender": "sender",
"start": "2022-06-25T14:30:00Z",
"subject": "subject",
"submissions": true
},
"status": "PENDING",
"total_messages_discovered": 0,
"comment": "comment",
"completed_at": "2019-12-27T18:11:19.117Z",
"started_at": "2019-12-27T18:11:19.117Z",
"status_message": "status_message"
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"action_params": {
"destination": "Inbox",
"type": "MOVE",
"expected_disposition": "MALICIOUS"
},
"action_type": "MOVE",
"created_at": "2019-12-27T18:11:19.117Z",
"job_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"messages_failed": 0,
"messages_pending": 0,
"messages_successful": 0,
"search_params": {
"action_log": true,
"alert_id": "alert_id",
"delivery_status": "delivered",
"detections_only": true,
"domain": "domain",
"end": "2022-07-25T14:30:00Z",
"exact_subject": "exact_subject",
"final_disposition": "MALICIOUS",
"message_action": "PREVIEW",
"message_id": "message_id",
"metric": "metric",
"query": "query",
"recipient": "recipient",
"sender": "sender",
"start": "2022-06-25T14:30:00Z",
"subject": "subject",
"submissions": true
},
"status": "PENDING",
"total_messages_discovered": 0,
"comment": "comment",
"completed_at": "2019-12-27T18:11:19.117Z",
"started_at": "2019-12-27T18:11:19.117Z",
"status_message": "status_message"
},
"success": true
}