Skip to main content

Delete Workflow

Read the introduction to parsers to understand Parsers.

This guide explains how to delete a specific Workflow from your account.

API Endpoint

DELETE https://api.documentpro.ai/v1/templates/{template_id}

Path Parameters

  • template_id (required): The unique identifier of the Workflow you want to delete.

Example Implementation using Python

import requests

# Your API key
api_key = 'YOUR_API_KEY'

template_id = 'YOUR_TEMPLATE_ID'
url = f"https://api.documentpro.ai/v1/templates/{template_id}"

headers = {
'x-api-key': api_key
}

response = requests.delete(url, headers=headers)

if response.status_code == 200:
print('Workflow deleted successfully')
print(response.json())
else:
print('Failed to delete Workflow')
print(response.text)

Response

Successful Response (Status Code: 200)

A successful deletion will return a 200 status code and the following response body:

{
"success": true
}

Error Response (Status Codes: 400, 404, 500)

For errors, you will receive a response with the following structure:

{
"success": false,
"error": "error_code",
"message": "descriptive error message"
}

Possible error scenarios include:

  • 404 Not Found: If the specified Workflow doesn't exist.
  • 400 Bad Request: If the request is malformed.
  • 500 Internal Server Error: If there's a server-side issue.

Important Notes

  1. Deleting a Workflow is irreversible. Make sure you want to permanently remove the Workflow before making this API call.
  2. All documents associated with the deleted Workflow will remain in your account, but they will no longer be linked to any Workflow.
  3. If you accidentally delete a Workflow, you'll need to create a new one with the same configuration.
  4. It's a good practice to confirm the deletion by attempting to retrieve the Workflow details after deletion. This should return a 404 Not Found error if the deletion was successful.

Next Steps

After deleting a Workflow, you might want to:

  1. Create a new Workflow to replace the deleted one.
  2. List your existing Workflow to confirm the deletion and review your remaining Workflows.
  3. Update any applications or workflows that were using the deleted Workflow to prevent errors.