Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/subratomandal/dyeink/llms.txt

Use this file to discover all available pages before exploring further.

DELETE /api/auth/delete

Permanently deletes the authenticated user’s account, including their Auth0 profile and all associated data from the database.

Authentication

Requires Auth0 JWT token in the Authorization header.
Authorization: Bearer <auth0_jwt_token>

Response

success
boolean
Indicates whether the deletion was successful

Example Request

cURL
curl -X DELETE https://api.dyeink.com/api/auth/delete \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Response

{
  "success": true
}

Error Responses

401 Unauthorized
object
Authentication token is missing or invalid
{
  "error": "Unauthorized"
}
405 Method Not Allowed
object
Request method is not DELETE or POST
{
  "error": "Method not allowed"
}
500 Internal Server Error
object
Server encountered an error processing the request
{
  "error": "Failed to delete user"
}

Data Deletion

This endpoint performs the following deletions:
  1. Auth0 Profile: Removes the user from Auth0 (if AUTH0_MANAGEMENT_API_TOKEN is configured)
  2. User Record: Deletes the user document from the database
  3. Site Settings: Removes the user’s site configuration
  4. Posts: Deletes all posts created by the user

Important Notes

This action is irreversible. All user data, including posts and site settings, will be permanently deleted.
  • The operation attempts to delete the Auth0 user profile, but continues even if this fails
  • All database records associated with the user are deleted in parallel
  • The user’s JWT token will be invalidated after deletion
  • This endpoint accepts both DELETE and POST methods for compatibility

Environment Requirements

For complete account deletion including Auth0:
  • AUTH0_DOMAIN: Your Auth0 domain
  • AUTH0_MANAGEMENT_API_TOKEN: Auth0 Management API token with delete:users scope

Build docs developers (and LLMs) love