Skip to main content
DELETE
/
organizations
/
{id}
Delete organization (owner only)
curl --request DELETE \
  --url http://sandbox.mintlify.com/organizations/{id} \
  --header 'Authorization: Bearer <token>'
Permanently deletes an organization and all associated data.

Authentication

This endpoint requires authentication via Bearer token:
  • Authorization: Bearer <token>

⚠️ Security Warning

Only the organization OWNER can delete the organization. This is a destructive action that cannot be undone. All data will be permanently removed.

Path Parameters

ParameterTypeRequiredDescription
idstringYesOrganization UUID

What Gets Deleted

When an organization is deleted, the following data is also permanently removed:

Organization Data

  • Organization profile and settings
  • All organization members
  • All pending invitations

API Resources

  • All OAuth applications and tokens
  • All webhooks and delivery history
  • All API keys

Billing Data

  • Stripe subscription (will be cancelled)
  • Billing history is preserved in Stripe
This is enforced through database CASCADE constraints to ensure data integrity.

Example Request

curl -X DELETE http://localhost:3001/api/organizations/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer <your_token>"

Example Response

Status: 204 No Content
A successful deletion returns no response body, only a 204 status code.

Common Errors

403 Forbidden

Only the owner can delete the organization.
{
  "statusCode": 403,
  "message": "Access denied. Only the organization owner can delete the organization"
}

404 Not Found

The organization with the specified ID does not exist.
{
  "statusCode": 404,
  "message": "Organization not found"
}

Before You Delete

Important considerations:
  1. Export your data - There is no way to recover deleted data
  2. Cancel subscriptions - Stripe subscription will be cancelled automatically
  3. Notify team members - Members will lose access immediately
  4. Backup API keys - All API keys will stop working
  5. Save webhooks - Webhook URLs and settings will be lost

Alternative: Archive Instead

Consider implementing an archive feature instead of permanent deletion:
  • Preserve historical data
  • Maintain audit trails
  • Allow potential restoration
  • Keep billing records
Contact support if you need to archive instead of delete.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Response

Organization deleted permanently. All associated data removed.