---
updatedAt: 2025-04-25T09:45:37.000Z
agentTools:
  projectIndex: https://partner-docs.gupshup.io/llms.txt
---

# Delete flow

Use this API to delete the flow.

## Request Parameters

| Key           | Description                      | Value                     | Data type | Required/Optional | Constraints                                |
| :------------ | :------------------------------- | :------------------------ | :-------- | :---------------- | :----------------------------------------- |
| Authorization | Access Token for the application | \{\{PARTNER\_APP\_TOKEN}} | String    | Required          | Should be a valid Partner App Access Token |
| appId         | App ID to fetch the access token | \{\{APP\_ID}}             | String    | Required          | The Id should be a valid app Id of Gupshup |
| flowId        | Flow Id                          | \{\{FLOW\_ID}}            | String    | Required          | Flow ID generated by Meta                  |

## Sample Request

```curl
curl --location --request DELETE 'https://partner.gupshup.io/partner/app/{{APP_ID}}/flow/{{FLOW_ID}}' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/json'
```

## Sample Response

```
{
    "status": "success",
    "success": true
}
```

## Status Codes

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Status Code
      </th>

      <th>
        Response
      </th>

      <th>
        Comments
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **Success**
      </td>

      <td>

      </td>

      <td>

      </td>
    </tr>

    <tr>
      <td>
        200
      </td>

      <td>
        \{

        "status": "success", "success": true}
      </td>

      <td>
        Successfully delete a flow
      </td>
    </tr>

    <tr>
      <td>
        **Error**
      </td>

      <td>

      </td>

      <td>

      </td>
    </tr>

    <tr>
      <td>
        400
      </td>

      <td>
        \{

        "status": "error", "message": "After a flow has been published, it cannot be deleted. Please deprecate instead"}
      </td>

      <td>
        For deleting a published flow
      </td>
    </tr>
  </tbody>
</Table>

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Partner Portal API",
    "description": "Partner Portal API documentation",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.gupshup.io"
    },
    "version": "3.0.0-SNAPSHOT"
  },
  "externalDocs": {
    "description": "Gupshup Wiki Documentation",
    "url": "https://www.gupshup.io/partner/docs"
  },
  "servers": [
    {
      "url": "https://partner.gupshup.io/partner",
      "description": "Generated server url"
    }
  ],
  "tags": [
    {
      "name": "Flow management",
      "description": "API's for partners flow management"
    }
  ],
  "paths": {
    "/app/{appId}/flows/{flowId}": {
      "delete": {
        "tags": [
          "Flow management"
        ],
        "summary": "Delete flow",
        "operationId": "deleteflow",
        "parameters": [
          {
            "name": "token",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Your app token, please refer [**Get access token api**](https://partner-docs.gupshup.io/reference/get_partner-app-appid-token#/) to get the token from partner documentation.",
            "example": "sk_345095d735c64a8ab2f97a92e953xxxx"
          },
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier of the app.",
            "example": "a41b30f4-d202-4fdb-911e-3a8fbfbfxxxx"
          },
          {
            "name": "flowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Flow Id generated by Meta",
            "example": "90381197123xxxx"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteFlowJsonResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - no permissions to access resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "required": [
          "entity",
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "Status Code",
            "format": "int32"
          },
          "message": {
            "type": "string",
            "description": "Error message describing the reason "
          },
          "details": {
            "type": "string",
            "description": "Developer specific error details "
          },
          "code": {
            "type": "string",
            "description": "Internal Error Code",
            "default": "PP-ERR-XXX"
          },
          "entity": {
            "type": "object",
            "description": "Response Object"
          }
        },
        "description": "Error"
      },
      "DeleteFlowJsonResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
```