Events
Delete Event
Soft-deletes an event definition. Existing event logs for this name are retained but no new logs can be recorded against it.
DELETE
/
events
/
eventName
/
{eventName}
curl --request DELETE \
--url https://api.autosend.com/v1/events/eventName/order_completed \
--header 'Authorization: Bearer AS_your-project-api-key'
import requests
url = "https://api.autosend.com/v1/events/eventName/order_completed"
headers = {
"Authorization": "Bearer AS_your-project-api-key"
}
response = requests.delete(url, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/events/eventName/order_completed', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer AS_your-project-api-key'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/events/eventName/order_completed';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer AS_your-project-api-key'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/events/eventName/order_completed"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", "Bearer AS_your-project-api-key")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
import java.net.HttpURLConnection;
import java.net.URL;
public class DeleteEvent {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/events/eventName/order_completed");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer AS_your-project-api-key");
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
con.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'uri'
uri = URI('https://api.autosend.com/v1/events/eventName/order_completed')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'Bearer AS_your-project-api-key'
response = http.request(request)
puts response.body
{
"success": true,
"message": "Event deleted successfully"
}
Soft-deletes an event definition. Existing event logs recorded for this name are retained for analytics, but no new events can be sent against it.
curl --request DELETE \
--url https://api.autosend.com/v1/events/eventName/order_completed \
--header 'Authorization: Bearer AS_your-project-api-key'
import requests
url = "https://api.autosend.com/v1/events/eventName/order_completed"
headers = {
"Authorization": "Bearer AS_your-project-api-key"
}
response = requests.delete(url, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/events/eventName/order_completed', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer AS_your-project-api-key'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/events/eventName/order_completed';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer AS_your-project-api-key'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/events/eventName/order_completed"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", "Bearer AS_your-project-api-key")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
import java.net.HttpURLConnection;
import java.net.URL;
public class DeleteEvent {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/events/eventName/order_completed");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer AS_your-project-api-key");
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
con.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'uri'
uri = URI('https://api.autosend.com/v1/events/eventName/order_completed')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'Bearer AS_your-project-api-key'
response = http.request(request)
puts response.body
{
"success": true,
"message": "Event deleted successfully"
}
Authorizations
string | header
required
Project API key header of the form Bearer
AS_<key>.Path Parameters
string
required
Name of the event to delete.Example:
"order_completed"Response
Event deleted successfullyboolean
Example:
truestring
Confirmation message.Example:
"Event deleted successfully"Error Responses
object
{
"success": false,
"error": {
"message": "Event not found",
"code": "EVENT_NOT_FOUND"
}
}
Was this page helpful?
⌘I
curl --request DELETE \
--url https://api.autosend.com/v1/events/eventName/order_completed \
--header 'Authorization: Bearer AS_your-project-api-key'
import requests
url = "https://api.autosend.com/v1/events/eventName/order_completed"
headers = {
"Authorization": "Bearer AS_your-project-api-key"
}
response = requests.delete(url, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/events/eventName/order_completed', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer AS_your-project-api-key'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/events/eventName/order_completed';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer AS_your-project-api-key'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/events/eventName/order_completed"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", "Bearer AS_your-project-api-key")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
import java.net.HttpURLConnection;
import java.net.URL;
public class DeleteEvent {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/events/eventName/order_completed");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer AS_your-project-api-key");
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
con.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'uri'
uri = URI('https://api.autosend.com/v1/events/eventName/order_completed')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'Bearer AS_your-project-api-key'
response = http.request(request)
puts response.body
{
"success": true,
"message": "Event deleted successfully"
}