//native
type Segment = {
token: string;
baseUrl: string;
};
/**
* Remove Filter from Destination
* Deletes a Destination filter.
• When called, this endpoint may generate the `Destination Filter Deleted` event in the audit trail.
*/
export async function main(
auth: Segment,
destinationId: string,
filterId: string,
) {
const url = new URL(
`${auth.baseUrl}/destination/${destinationId}/filters/${filterId}`,
);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago