---
title: Delete a relay
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[MoQ](https://developers.cloudflare.com/api/go/resources/moq)

[Relays](https://developers.cloudflare.com/api/go/resources/moq/subresources/relays)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Delete a relay

client.MoQ.Relays.Delete(ctx, relayID, body) (\*[RelayDeleteResponse](<https://developers.cloudflare.com/api/go/resources/moq#(resource)%20moq.relays%20%3E%20(model)%20RelayDeleteResponse%20%3E%20(schema)>), error)

DELETE/accounts/{account\_id}/moq/relays/{relay\_id}

Soft-deletes a MoQ relay. The relay ID goes in the URL path — `DELETE /accounts/{account_id}/moq/relays/{relay_id}` — not the request body; there is no collection-level delete endpoint.

##### Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).

**Example:**`Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY`

##### ParametersExpand Collapse

relayID string

[Link to this property](<#(resource)%20moq.relays%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20relay_id%20%3E%20(schema)>)

<details>

<summary>

body RelayDeleteParams

</summary>

AccountID param.Field\[string]

Cloudflare account identifier.

<a href="#(resource)%20moq.relays%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20moq.relays%20%3E%20(method)%20delete%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

type RelayDeleteResponse interface{…}

[Link to this property](<#(resource)%20moq.relays%20%3E%20(model)%20RelayDeleteResponse%20%3E%20(schema)>)

### Delete a relay

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/moq"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  relay, err := client.MoQ.Relays.Delete(
    context.TODO(),
    "a1b2c3d4e5f67890a1b2c3d4e5f67890",
    moq.RelayDeleteParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", relay)
}
```

200 example

```
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "success": true,
  "result": {}
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "success": true,
  "result": {}
}
```