Skip to content

Adding an API Subscription Deletion Workflow

Subscription Deletion provides the capability to remove an already existing subscription. Attaching a custom workflow to the API subscription deletion, enables an admin to approve/reject the subscription deletion request made for an existing subscription. Note that only an admin is able to approve/reject a subscription deletion request.

When the API subscription deletion workflow is enabled, when the subscription deletion request is made, the subscription status is changed to the DELETE_PENDING state. In this state, a consumer can still invoke the API with the same subscription, using its production or sandbox keys, until the subscription deletion is approved. Once the subscription deletion request is approved the subscription will be deleted.

Engaging the Approval Workflow Executor in the API Manager

  1. Sign in to the API Manager Management Console (https://<Server Host>:9443/carbon) and go to Browse under Registry.

    Workflow Extensions Browse

  2. Open the /_system/governance/apimgt/applicationdata/workflow-extensions.xml resource and click Edit as text. Disable the SubscriptionDeletionSimpleWorkflowExecutor and enable SubscriptionDeletionApprovalWorkflowExecutor.

        <WorkFlowExtensions>
        ...
            <!--SubscriptionDeletion executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionDeletionSimpleWorkflowExecutor"/-->
            <SubscriptionDeletion executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionDeletionApprovalWorkflowExecutor"/>
        ...
        </WorkFlowExtensions>
    

    The subscription deletion approval workflow executor is now engaged.

  3. Sign in to the WSO2 API Developer Portal (https://<hostname>:<port>/devportal) and click Applications. Select the application which has the subscriptions you need to delete.

    Applications Overview Tab

  4. Click Subscriptions to list the subscriptions of the application.

    Subscriptions Overview Tab

  5. Select the subscription which needs to be deleted and click the DELETE icon to open the Subscription Delete popup.

    Subscription Delete Popup

  6. Click DELETE to continue. You will see the subscription status as DELETE_PENDING.

    Subscription Delete Before Approval

  7. Sign in to the Admin Portal (https://<Server Host>:9443/admin), list all the tasks for API subscription delete from TasksSubscription Deletion and click on approve (or reject) to approve (or reject) the workflow pending request.

    Subscription Delete Admin

  8. After approving go back to the API Developer Portal Application Subscriptions tab. The subscription will be removed.