Skip to main content

Delete API Token

Revoke access by deleting API tokens using the delete_api_token() method. Pass the token value (the sk-mira-... string), not the token’s id.

Example

from mira_network import MiraClient

async def delete_token():
    async with MiraClient(api_key="your-api-key") as client:
        # Pass the full token string (from create_api_token / list_api_tokens)
        await client.delete_api_token("sk-mira-xxxx...")
        print("Token successfully deleted")

Error Handling

try:
    await client.delete_api_token("sk-mira-xxxx...")
except Exception as e:
    print(f"Error deleting token: {e}")

Usage Notes

  • Pass the token value (sk-mira-...), not the id — deleting by id returns 404
  • Deletion is permanent and cannot be undone
  • Plan for service disruption if deleting active tokens