Skip to main content
Resend Docs

Search documentation

Type to search this documentation.

On this pageOverview

Delete Template

DELETE

/

templates

/

:template_id

Node.js
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.templates.remove(
  '34a080c9-b17d-4187-ad80-5af20266e535',
);
PHP
$resend = Resend::client('re_xxxxxxxxx');

$resend->templates->remove('34a080c9-b17d-4187-ad80-5af20266e535');
Python
import resend

resend.api_key = "re_xxxxxxxxx"

resend.Templates.remove("34a080c9-b17d-4187-ad80-5af20266e535")
Ruby
require "resend"

Resend.api_key = "re_xxxxxxxxx"

Resend::Templates.remove("34a080c9-b17d-4187-ad80-5af20266e535")
Go
package main

import (
	"context"

	"github.com/resend/resend-go/v4"
)

func main() {
	client := resend.NewClient("re_xxxxxxxxx")

	client.Templates.RemoveWithContext(
		context.TODO(),
		"34a080c9-b17d-4187-ad80-5af20266e535",
	)
}
Rust
use resend_rs::{Resend, Result};

#[tokio::main]
async fn main() -> Result<()> {
  let resend = Resend::new("re_xxxxxxxxx");

  let _deleted = resend
    .templates
    .delete("34a080c9-b17d-4187-ad80-5af20266e535")
    .await?;

  Ok(())
}
Java
import com.resend.Resend;
import com.resend.core.exception.ResendException;
import com.resend.services.templates.model.DeleteTemplateResponseSuccess;

public class Main {
    public static void main(String[] args) throws ResendException {
        Resend resend = new Resend("re_xxxxxxxxx");

        DeleteTemplateResponseSuccess data = resend.templates().remove("34a080c9-b17d-4187-ad80-5af20266e535");
    }
}
.NET
using Resend;

IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI

await resend.TemplateDeleteAsync( new Guid( "34a080c9-b17d-4187-ad80-5af20266e535" ) );
cURL
curl -X DELETE 'https://api.resend.com/templates/34a080c9-b17d-4187-ad80-5af20266e535' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json'
CLI
resend templates delete 34a080c9-b17d-4187-ad80-5af20266e535
Response
{
  "object": "template",
  "id": "34a080c9-b17d-4187-ad80-5af20266e535",
  "deleted": true
}

string

The ID or alias of the template to delete.

Node.js
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.templates.remove(
  '34a080c9-b17d-4187-ad80-5af20266e535',
);
PHP
$resend = Resend::client('re_xxxxxxxxx');

$resend->templates->remove('34a080c9-b17d-4187-ad80-5af20266e535');
Python
import resend

resend.api_key = "re_xxxxxxxxx"

resend.Templates.remove("34a080c9-b17d-4187-ad80-5af20266e535")
Ruby
require "resend"

Resend.api_key = "re_xxxxxxxxx"

Resend::Templates.remove("34a080c9-b17d-4187-ad80-5af20266e535")
Go
package main

import (
	"context"

	"github.com/resend/resend-go/v4"
)

func main() {
	client := resend.NewClient("re_xxxxxxxxx")

	client.Templates.RemoveWithContext(
		context.TODO(),
		"34a080c9-b17d-4187-ad80-5af20266e535",
	)
}
Rust
use resend_rs::{Resend, Result};

#[tokio::main]
async fn main() -> Result<()> {
  let resend = Resend::new("re_xxxxxxxxx");

  let _deleted = resend
    .templates
    .delete("34a080c9-b17d-4187-ad80-5af20266e535")
    .await?;

  Ok(())
}
Java
import com.resend.Resend;
import com.resend.core.exception.ResendException;
import com.resend.services.templates.model.DeleteTemplateResponseSuccess;

public class Main {
    public static void main(String[] args) throws ResendException {
        Resend resend = new Resend("re_xxxxxxxxx");

        DeleteTemplateResponseSuccess data = resend.templates().remove("34a080c9-b17d-4187-ad80-5af20266e535");
    }
}
.NET
using Resend;

IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI

await resend.TemplateDeleteAsync( new Guid( "34a080c9-b17d-4187-ad80-5af20266e535" ) );
cURL
curl -X DELETE 'https://api.resend.com/templates/34a080c9-b17d-4187-ad80-5af20266e535' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json'
CLI
resend templates delete 34a080c9-b17d-4187-ad80-5af20266e535
JSON
{
  "object": "template",
  "id": "34a080c9-b17d-4187-ad80-5af20266e535",
  "deleted": true
}

Was this page helpful?

⌘I

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu