# Destroy Target via API call

**URL:** <https://discuss.hashicorp.com/t/destroy-target-via-api-call/55535>\
**Category:** HCP Terraform\
**Tags:** terraform-enterprise\
**Created:** [June 28, 2023, 10:52pm UTC](https://discuss.hashicorp.com/t/destroy-target-via-api-call/55535 "2023-06-28T22:52:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spkotti24](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@spkotti24](https://discuss.hashicorp.com/u/spkotti24)\
**Post date:** [June 28, 2023, 10:52pm UTC](https://discuss.hashicorp.com/t/destroy-target-via-api-call/55535/1 "2023-06-28T22:52:20Z")

</div>

I was trying to trigger Terraform destroy for specific target via API . I was used below payload .

> ```auto
> {
> "type": "runs",
> "data":{"attributes": {
> "is-destroy":true,
> "target-addrs": "module.mvdev-eks-xx",
> "message": "Triggered Destroy"
> },
> "relationships": {
> "workspace": {
> "data": {
> "type": "workspaces",
> "id": "ws-XXXXXXXXAJiw"
> }
> }
> }
> }
> }
> 
> ```

run this below curl call

```
      curl --request POST --url https://$TFE_HOST/api/v2/runs \
        --header 'Authorization: Bearer $TFE_TOKEN' \
        --header 'Content-Type: application/vnd.api+json' \
        --data @data.json

```

I see still see it trying to destroy all the resource instead of target mentioned . Is anything wrong here ?

Reference : [Runs - API Docs - Terraform Cloud | Terraform | HashiCorp Developer](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/run)

`data.attributes.target-addrs`
