---
title: Delete Token
slug: api/delete-token
docTags: 
createdAt: 2025-06-24T08:28:24.373Z
---

{
  "id": "te4BQ7f9lmgCRblv5yE4_",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://api.mpay.com.au/token/v1/delete/{token}",
    "servers": [
      {
        "url": "https://api.mpay.com.au/token/v1/delete/{token}",
        "description": "Production URL"
      },
      {
        "url": "https://api.m-pay.com.au/token/v1/delete/{token}",
        "description": "Sandbox URL"
      }
    ],
    "name": "Delete Token",
    "description": "This API will delete the payload attached to the specified token.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "token",
          "type": "string",
          "description": "<p>The text (GUID) that identifies the token.</p>"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "basicAuth",
          "name": "basicAuth",
          "kind": "optional",
          "type": "http",
          "scheme": "basic"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "successful validation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "tokenDeleteResponse_V1",
            "schema": [
              {
                "name": "status",
                "kind": "optional",
                "type": "string",
                "description": "This is the status of the request. A code of 'Ok' indicates no errors.",
                "example": ""
              },
              {
                "name": "statusDescription",
                "kind": "optional",
                "type": "string",
                "description": "This is a description of the status. If an 'Ok' status is returned, then this will be 'Operation completed successfully'.",
                "example": ""
              },
              {
                "name": "durationMs",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "This value represents the total time in milliseconds that the Platform took to process the request.",
                "example": 0
              }
            ],
            "modelRef": "#/components/schemas/tokenDeleteResponse_V1",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "pzecg02XomPR_C-GZGfB_",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url https://api.mpay.com.au/token/v1/delete/{token} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "k348CDYTEWMjeM1jtajHB",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.mpay.com.au/token/v1/delete/{token}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "uHmMXdUBddWKcLzAQJW69",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.mpay.com.au/token/v1/delete/{token}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "7SXQlGFuVNRZlfAKny6CE",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.mpay.com.au/token/v1/delete/{token}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "pzecg02XomPR_C-GZGfB_"
    },
    "results": {
      "languages": [
        {
          "id": "3UX71FPZnunye8QAXn_Vt",
          "language": "200",
          "code": "// successful validation\n{\n  \"status\": \"\",\n  \"statusDescription\": \"\",\n  \"durationMs\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "3UX71FPZnunye8QAXn_Vt"
    }
  },
  "children": [
    {
      "id": "UrHonCf4lEWMfZL53lTIg",
      "type": "paragraph",
      "children": [
        {
          "text": "This API will delete the payload attached to the specified token."
        }
      ]
    }
  ]
}