Skip to main content
Install the v4-compatible package from PyPI:
Use the newest compatible stable release when one is available. The source and examples live in MythicMeta/Mythic_Scripting.

Log in with an API token

Create the token in Mythic first and give it only the scopes used by the script. The package sends API and access tokens through Authorization: Bearer <token>.

Log in with a password

Password login produces a refreshable session. Pass create_apitoken=True only when the script intentionally needs to mint and retain a long-lived token; by default that helper requests broad access, so creating a named token with explicit scopes is safer for production automation.

Run a custom GraphQL query

The Python package also exposes async subscription generators for callbacks, tasks, responses, files, and operational events. Prefer the supplied helpers for stable workflows; use execute_custom_query when you need a field that is not yet wrapped.