abusezero 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
abusezero-0.1.0/API.md ADDED
@@ -0,0 +1,188 @@
1
+ # API methods
2
+
3
+ Pass input fields in the method's input and path fields separately in `path`. Public methods belong to `AbuseZeroPublic` and `AsyncAbuseZeroPublic` and need no credentials. All other methods belong to `AbuseZero` and `AsyncAbuseZero`. Methods with the `operations:management` scope need an OAuth access token; an API key alone can't call them.
4
+
5
+ | Method | HTTP operation | Path fields | Idempotency key | Scope |
6
+ |---|---|---|---|---|
7
+ | `pricing()` | `GET /v1/public/pricing` | — | — | Public, no credentials |
8
+ | `price_quote()` | `GET /v1/public/pricing/quote` | — | — | Public, no credentials |
9
+ | `docs()` | `GET /v1/public/docs` | — | — | Public, no credentials |
10
+ | `search_docs()` | `GET /v1/public/docs/search` | — | — | Public, no credentials |
11
+ | `public_docs_page()` | `GET /v1/public/docs/{path}` | path | — | Public, no credentials |
12
+ | `help_articles()` | `GET /v1/public/help` | — | — | Public, no credentials |
13
+ | `search_help()` | `GET /v1/public/help/search` | — | — | Public, no credentials |
14
+ | `public_help_article()` | `GET /v1/public/help/{path}` | path | — | Public, no credentials |
15
+ | `openapi()` | `GET /v1/public/openapi` | — | — | Public, no credentials |
16
+ | `actions()` | `GET /v1/public/actions` | — | — | Public, no credentials |
17
+ | `error_codes()` | `GET /v1/public/errors` | — | — | Public, no credentials |
18
+ | `reason_codes()` | `GET /v1/public/reasons` | — | — | Public, no credentials |
19
+ | `webhook_event_types()` | `GET /v1/public/webhook-events` | — | — | Public, no credentials |
20
+ | `conditions()` | `GET /v1/public/conditions` | — | — | Public, no credentials |
21
+ | `glossary()` | `GET /v1/public/glossary` | — | — | Public, no credentials |
22
+ | `legal_documents()` | `GET /v1/public/legal` | — | — | Public, no credentials |
23
+ | `legal_document()` | `GET /v1/public/legal/{document}` | document | — | Public, no credentials |
24
+ | `changelog()` | `GET /v1/public/changelog` | — | — | Public, no credentials |
25
+ | `blog_posts()` | `GET /v1/public/blog` | — | — | Public, no credentials |
26
+ | `blog_post()` | `GET /v1/public/blog/{slug}` | slug | — | Public, no credentials |
27
+ | `versions()` | `GET /v1/public/versions` | — | — | Public, no credentials |
28
+ | `service_status()` | `GET /v1/public/status` | — | — | Public, no credentials |
29
+ | `contacts()` | `GET /v1/public/contacts` | — | — | Public, no credentials |
30
+ | `contact_sales()` | `POST /v1/public/contact/sales` | — | Required | Public, no credentials |
31
+ | `contact_support()` | `POST /v1/public/contact/support` | — | Required | Public, no credentials |
32
+ | `start_onboarding()` | `POST /v1/public/onboarding-sessions` | — | — | Public, no credentials |
33
+ | `onboarding_status()` | `POST /v1/public/onboarding-sessions/{id}/status` | id | — | Public, no credentials |
34
+ | `workspaces()` | `GET /v1/workspaces` | — | — | `operations:general` |
35
+ | `me()` | `GET /v1/me` | — | — | `operations:general` |
36
+ | `api_keys()` | `GET /v1/api-keys` | — | — | `operations:general` |
37
+ | `create_api_key()` | `POST /v1/api-keys` | — | Required | `operations:management` |
38
+ | `update_api_key()` | `PATCH /v1/api-keys/{id}` | id | Required | `operations:management` |
39
+ | `roll_api_key()` | `POST /v1/api-keys/{id}/roll` | id | Required | `operations:management` |
40
+ | `show_api_key_replacement()` | `POST /v1/api-keys/{id}/replacement` | id | Required | `operations:management` |
41
+ | `revoke_api_key()` | `POST /v1/api-keys/{id}/revoke` | id | Required | `operations:management` |
42
+ | `machine_clients()` | `GET /v1/machine-clients` | — | — | `operations:general` |
43
+ | `create_machine_client()` | `POST /v1/machine-clients` | — | Required | `operations:management` |
44
+ | `rotate_machine_client_secret()` | `POST /v1/machine-clients/{id}/rotate-secret` | id | Required | `operations:management` |
45
+ | `revoke_machine_client()` | `POST /v1/machine-clients/{id}/revoke` | id | Required | `operations:management` |
46
+ | `authorized_apps()` | `GET /v1/authorized-apps` | — | — | `operations:general` |
47
+ | `disconnect_authorized_app()` | `POST /v1/authorized-apps/{id}/disconnect` | id | Required | `operations:management` |
48
+ | `members()` | `GET /v1/members` | — | — | `operations:general` |
49
+ | `update_member()` | `PATCH /v1/members/{id}` | id | Required | `operations:management` |
50
+ | `remove_member()` | `DELETE /v1/members/{id}` | id | Required | `operations:management` |
51
+ | `invitations()` | `GET /v1/invitations` | — | — | `operations:general` |
52
+ | `invite_member()` | `POST /v1/invitations` | — | Required | `operations:management` |
53
+ | `resend_invitation()` | `POST /v1/invitations/{id}/resend` | id | Required | `operations:management` |
54
+ | `cancel_invitation()` | `POST /v1/invitations/{id}/cancel` | id | Required | `operations:management` |
55
+ | `workspace_settings()` | `GET /v1/workspace` | — | — | `operations:general` |
56
+ | `update_workspace_settings()` | `PATCH /v1/workspace` | — | Required | `operations:configuration` |
57
+ | `upload_workspace_icon()` | `PUT /v1/workspace/icon` | — | Required | `operations:configuration` |
58
+ | `remove_workspace_icon()` | `DELETE /v1/workspace/icon` | — | Required | `operations:configuration` |
59
+ | `workspace_icon_upload()` | `GET /v1/workspace/icon/uploads/{id}` | id | — | `operations:general` |
60
+ | `set_data_retention()` | `PUT /v1/workspace/data-retention` | — | Required | `operations:management` |
61
+ | `setup_progress()` | `GET /v1/workspace/setup` | — | — | `operations:general` |
62
+ | `finish_setup()` | `POST /v1/workspace/setup/finish` | — | Required | `operations:general` |
63
+ | `dismiss_setup_guide()` | `POST /v1/workspace/setup/dismiss` | — | Required | `operations:general` |
64
+ | `leave_workspace()` | `POST /v1/workspace/leave` | — | Required | `operations:general` |
65
+ | `evaluations()` | `GET /v1/evaluations` | — | — | `operations:general` |
66
+ | `evaluate()` | `POST /v1/evaluations` | — | Required | `operations:general` |
67
+ | `evaluation_filters()` | `GET /v1/evaluation-filters` | — | — | `operations:general` |
68
+ | `get_evaluation()` | `GET /v1/evaluations/{id}` | id | — | `operations:general` |
69
+ | `evaluation_graph()` | `GET /v1/evaluations/{id}/graph` | id | — | `operations:general` |
70
+ | `evaluation_evidence()` | `GET /v1/evaluations/{id}/evidence` | id | — | `operations:general` |
71
+ | `outcomes()` | `GET /v1/outcomes` | — | — | `operations:general` |
72
+ | `get_outcome()` | `GET /v1/outcomes/{id}` | id | — | `operations:general` |
73
+ | `outcome()` | `POST /v1/evaluations/{id}/outcome` | id | Required | `operations:general` |
74
+ | `dry_run_evaluation()` | `POST /v1/evaluations/dry-run` | — | Required | `operations:general` |
75
+ | `simulate()` | `POST /v1/simulations` | — | — | `operations:general` |
76
+ | `replay()` | `POST /v1/replays` | — | — | `operations:general` |
77
+ | `benefits()` | `GET /v1/benefits` | — | — | `operations:general` |
78
+ | `create_benefit()` | `POST /v1/benefits` | — | Required | `operations:configuration` |
79
+ | `get_benefit()` | `GET /v1/benefits/{id}` | id | — | `operations:general` |
80
+ | `update_benefit()` | `PATCH /v1/benefits/{id}` | id | Required | `operations:configuration` |
81
+ | `delete_benefit()` | `DELETE /v1/benefits/{id}` | id | Required | `operations:configuration` |
82
+ | `policies()` | `GET /v1/policies` | — | — | `operations:general` |
83
+ | `create_policy()` | `POST /v1/policies` | — | Required | `operations:configuration` |
84
+ | `get_policy()` | `GET /v1/policies/{id}` | id | — | `operations:general` |
85
+ | `update_policy()` | `PATCH /v1/policies/{id}` | id | Required | `operations:configuration` |
86
+ | `delete_policy()` | `DELETE /v1/policies/{id}` | id | Required | `operations:configuration` |
87
+ | `duplicate_policy()` | `POST /v1/policies/{id}/duplicate` | id | Required | `operations:configuration` |
88
+ | `policy_versions()` | `GET /v1/policies/{id}/versions` | id | — | `operations:general` |
89
+ | `get_policy_version()` | `GET /v1/policies/{id}/versions/{version}` | id, version | — | `operations:general` |
90
+ | `policy_signals()` | `GET /v1/policy-signals` | — | — | `operations:general` |
91
+ | `access_lists()` | `GET /v1/access-lists` | — | — | `operations:general` |
92
+ | `add_access_list_entries()` | `POST /v1/access-lists` | — | Required | `operations:configuration` |
93
+ | `get_access_list_entry()` | `GET /v1/access-lists/{id}` | id | — | `operations:general` |
94
+ | `delete_access_list_entry()` | `DELETE /v1/access-lists/{id}` | id | Required | `operations:configuration` |
95
+ | `update_access_list_entry()` | `PATCH /v1/access-lists/{id}` | id | Required | `operations:configuration` |
96
+ | `look_up_identifier()` | `POST /v1/identifiers/lookup` | — | — | `operations:general` |
97
+ | `custom_identifiers()` | `GET /v1/custom-identifiers` | — | — | `operations:general` |
98
+ | `register_custom_identifier()` | `POST /v1/custom-identifiers` | — | Required | `operations:configuration` |
99
+ | `get_custom_identifier()` | `GET /v1/custom-identifiers/{id}` | id | — | `operations:general` |
100
+ | `delete_custom_identifier()` | `DELETE /v1/custom-identifiers/{id}` | id | Required | `operations:configuration` |
101
+ | `imports()` | `GET /v1/imports` | — | — | `operations:general` |
102
+ | `import_claim_history()` | `POST /v1/imports` | — | Required | `operations:general` |
103
+ | `create_csv_import()` | `POST /v1/imports/csv` | — | Required | `operations:general` |
104
+ | `get_import()` | `GET /v1/imports/{id}` | id | — | `operations:general` |
105
+ | `list_import_problems()` | `GET /v1/imports/{id}/problems` | id | — | `operations:general` |
106
+ | `import_problems_download()` | `GET /v1/imports/{id}/problems/download` | id | — | `operations:general` |
107
+ | `confirm_import()` | `POST /v1/imports/{id}/confirm` | id | Required | `operations:general` |
108
+ | `discard_import()` | `POST /v1/imports/{id}/discard` | id | Required | `operations:general` |
109
+ | `fix_import_row()` | `POST /v1/imports/{id}/fix` | id | Required | `operations:general` |
110
+ | `skip_import_row()` | `POST /v1/imports/{id}/skip` | id | Required | `operations:general` |
111
+ | `exports()` | `GET /v1/exports` | — | — | `operations:general` |
112
+ | `request_export()` | `POST /v1/exports` | — | Required | `operations:general` |
113
+ | `get_export()` | `GET /v1/exports/{id}` | id | — | `operations:general` |
114
+ | `export_download()` | `GET /v1/exports/{id}/download` | id | — | `operations:general` |
115
+ | `request_workspace_export()` | `POST /v1/workspace-exports` | — | Required | `operations:general` |
116
+ | `workspace_export()` | `GET /v1/workspace-exports` | — | — | `operations:general` |
117
+ | `workspace_export_download()` | `GET /v1/workspace-exports/{id}/download` | id | — | `operations:general` |
118
+ | `delete_workspace_export()` | `DELETE /v1/workspace-exports/{id}` | id | Required | `operations:general` |
119
+ | `dry_run_data_deletion()` | `POST /v1/data-deletions/dry-run` | — | — | `operations:general` |
120
+ | `data_deletions()` | `GET /v1/data-deletions` | — | — | `operations:general` |
121
+ | `request_data_deletion()` | `POST /v1/data-deletions` | — | Required | `operations:general` |
122
+ | `get_data_deletion()` | `GET /v1/data-deletions/{id}` | id | — | `operations:general` |
123
+ | `analytics()` | `GET /v1/analytics` | — | — | `operations:general` |
124
+ | `overview()` | `GET /v1/overview` | — | — | `operations:general` |
125
+ | `benefit_value()` | `GET /v1/analytics/value` | — | — | `operations:general` |
126
+ | `denial_reasons()` | `GET /v1/analytics/denial-reasons` | — | — | `operations:general` |
127
+ | `request_logs()` | `GET /v1/request-logs` | — | — | `operations:general` |
128
+ | `get_request_log()` | `GET /v1/request-logs/{id}` | id | — | `operations:general` |
129
+ | `audit_logs()` | `GET /v1/audit-logs` | — | — | `operations:general` |
130
+ | `get_audit_log()` | `GET /v1/audit-logs/{id}` | id | — | `operations:general` |
131
+ | `account_status()` | `GET /v1/account-status` | — | — | `operations:general` |
132
+ | `integration_status()` | `GET /v1/integration-status` | — | — | `operations:general` |
133
+ | `events()` | `GET /v1/events` | — | — | `operations:general` |
134
+ | `browser_collection()` | `GET /v1/browser-collection` | — | — | `operations:general` |
135
+ | `update_browser_collection()` | `PATCH /v1/browser-collection` | — | Required | `operations:configuration` |
136
+ | `browser_script()` | `GET /v1/browser-collection/script` | — | — | `operations:general` |
137
+ | `webhook_endpoints()` | `GET /v1/webhook-endpoints` | — | — | `operations:general` |
138
+ | `create_webhook_endpoint()` | `POST /v1/webhook-endpoints` | — | Required | `operations:configuration` |
139
+ | `get_webhook_endpoint()` | `GET /v1/webhook-endpoints/{id}` | id | — | `operations:general` |
140
+ | `update_webhook_endpoint()` | `PATCH /v1/webhook-endpoints/{id}` | id | Required | `operations:configuration` |
141
+ | `delete_webhook_endpoint()` | `DELETE /v1/webhook-endpoints/{id}` | id | Required | `operations:configuration` |
142
+ | `send_webhook_test()` | `POST /v1/webhook-endpoints/{id}/test` | id | Required | `operations:general` |
143
+ | `enable_webhook_endpoint()` | `POST /v1/webhook-endpoints/{id}/enable` | id | Required | `operations:configuration` |
144
+ | `disable_webhook_endpoint()` | `POST /v1/webhook-endpoints/{id}/disable` | id | Required | `operations:configuration` |
145
+ | `webhook_signing_secret()` | `GET /v1/webhook-endpoints/{id}/secret` | id | — | `operations:management` |
146
+ | `rotate_webhook_signing_secret()` | `POST /v1/webhook-endpoints/{id}/rotate-secret` | id | Required | `operations:management` |
147
+ | `webhook_usage()` | `GET /v1/webhook-usage` | — | — | `operations:general` |
148
+ | `webhook_deliveries()` | `GET /v1/webhook-deliveries` | — | — | `operations:general` |
149
+ | `get_webhook_delivery()` | `GET /v1/webhook-deliveries/{id}` | id | — | `operations:general` |
150
+ | `resend_webhook_delivery()` | `POST /v1/webhook-deliveries/{id}/resend` | id | Required | `operations:general` |
151
+ | `plan()` | `GET /v1/billing/plan` | — | — | `operations:general` |
152
+ | `usage()` | `GET /v1/billing/usage` | — | — | `operations:general` |
153
+ | `credit_history()` | `GET /v1/billing/credit-history` | — | — | `operations:general` |
154
+ | `daily_usage()` | `GET /v1/billing/daily-usage` | — | — | `operations:general` |
155
+ | `enterprise_plans()` | `GET /v1/billing/enterprise-plans` | — | — | `operations:general` |
156
+ | `preview_enterprise_plan_code()` | `POST /v1/billing/enterprise-plan-codes/preview` | — | — | `operations:general` |
157
+ | `upcoming_charge()` | `GET /v1/billing/upcoming-charge` | — | — | `operations:general` |
158
+ | `invoices()` | `GET /v1/billing/invoices` | — | — | `operations:general` |
159
+ | `payment_methods()` | `GET /v1/billing/payment-methods` | — | — | `operations:general` |
160
+ | `billing_details()` | `GET /v1/billing/details` | — | — | `operations:general` |
161
+ | `update_billing_details()` | `PUT /v1/billing/details` | — | Required | `operations:configuration` |
162
+ | `get_payment()` | `GET /v1/billing/payments/{id}` | id | — | `operations:general` |
163
+ | `quote_plan_change()` | `POST /v1/billing/quotes` | — | — | `operations:general` |
164
+ | `set_low_credit_alert()` | `PUT /v1/billing/low-credit-alert` | — | Required | `operations:configuration` |
165
+ | `choose_what_stays_active()` | `POST /v1/billing/over-limit` | — | Required | `operations:configuration` |
166
+ | `set_auto_reload()` | `PUT /v1/billing/auto-reload` | — | Required | `operations:management` |
167
+ | `buy_credits()` | `POST /v1/billing/credit-purchases` | — | Required | `operations:management` |
168
+ | `retry_credit_purchase()` | `POST /v1/billing/credit-purchases/{id}/retry` | id | Required | `operations:management` |
169
+ | `confirm_plan_change()` | `POST /v1/billing/quotes/{id}/confirm` | id | Required | `operations:management` |
170
+ | `undo_scheduled_downgrade()` | `POST /v1/billing/scheduled-change/undo` | — | Required | `operations:management` |
171
+ | `resume_subscription()` | `POST /v1/billing/subscription/resume` | — | Required | `operations:management` |
172
+ | `pay_overdue_invoice()` | `POST /v1/billing/invoices/pay` | — | Required | `operations:management` |
173
+ | `set_default_payment_method()` | `POST /v1/billing/payment-methods/{id}/default` | id | Required | `operations:management` |
174
+ | `move_backup_payment_method()` | `POST /v1/billing/payment-methods/{id}/move` | id | Required | `operations:management` |
175
+ | `remove_payment_method()` | `DELETE /v1/billing/payment-methods/{id}` | id | Required | `operations:management` |
176
+ | `redeem_enterprise_plan_code()` | `POST /v1/billing/enterprise-plan-codes/redeem` | — | Required | `operations:management` |
177
+ | `create_billing_approval_link()` | `POST /v1/billing/approval-links` | — | Required | `operations:management` |
178
+ | `billing_approval_link()` | `GET /v1/billing/approval-links/{id}` | id | — | `operations:general` |
179
+ | `update_account_name()` | `PATCH /v1/account` | — | Required | `operations:general` |
180
+ | `email_preferences()` | `GET /v1/account/email-preferences` | — | — | `operations:general` |
181
+ | `update_email_preferences()` | `PATCH /v1/account/email-preferences` | — | Required | `operations:configuration` |
182
+ | `notifications()` | `GET /v1/notifications` | — | — | `operations:general` |
183
+ | `mark_notification()` | `PATCH /v1/notifications/{id}` | id | Required | `operations:general` |
184
+ | `mark_all_notifications_read()` | `POST /v1/notifications/read-all` | — | Required | `operations:general` |
185
+ | `run_notification_action()` | `POST /v1/notifications/{id}/run` | id | Required | `operations:general` |
186
+ | `contact_support()` | `POST /v1/support-tickets` | — | Required | `operations:general` |
187
+ | `support_tickets()` | `GET /v1/support-tickets` | — | — | `operations:general` |
188
+ | `send_feedback()` | `POST /v1/feedback` | — | Required | `operations:general` |
@@ -0,0 +1,279 @@
1
+ ABUSEZERO SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT
2
+
3
+ Copyright (c) 2026 AbuseZero. All rights reserved.
4
+
5
+ This AbuseZero Software Development Kit License Agreement (this "Agreement")
6
+ is a legal agreement between you and AbuseZero. If you accept this Agreement
7
+ on behalf of an organization, "you" means that organization, and you represent
8
+ that you have authority to bind it. By downloading, installing, copying,
9
+ accessing or using the Software, you agree to this Agreement. If you do not
10
+ agree, do not download, install, copy, access or use the Software.
11
+
12
+ 1. DEFINITIONS
13
+
14
+ 1.1 "AbuseZero", "we" and "us" mean the entity that operates the AbuseZero
15
+ service, as identified in the Terms.
16
+
17
+ 1.2 "Terms" means the AbuseZero Terms of Service published at
18
+ https://abusezero.com/terms, together with the documents they reference,
19
+ including the Acceptable Use Policy, Privacy Policy and Data Processing
20
+ Agreement, each as updated from time to time, or any other written
21
+ agreement between you and AbuseZero that governs your use of the Service.
22
+
23
+ 1.3 "Service" means the AbuseZero application programming interfaces, Model
24
+ Context Protocol endpoints, dashboard and related hosted services.
25
+
26
+ 1.4 "Software" means this software package, including its server, browser,
27
+ command-line and Model Context Protocol components, any standalone
28
+ browser script made available by AbuseZero, and all related files,
29
+ documentation, updates and copies, excluding Third-Party Components.
30
+
31
+ 1.5 "Browser Components" means the parts of the Software designed to run in
32
+ an end user's web browser.
33
+
34
+ 1.6 "Your Application" means a website, application or service that you
35
+ develop and operate and that uses the Service.
36
+
37
+ 1.7 "Third-Party Components" means software owned by third parties and
38
+ included in the Software, as listed in the THIRD-PARTY-NOTICES file.
39
+
40
+ 2. LICENSE GRANT
41
+
42
+ 2.1 Subject to your continued compliance with this Agreement and the Terms,
43
+ AbuseZero grants you a limited, non-exclusive, non-transferable,
44
+ non-sublicensable, revocable, royalty-free license, during the term of
45
+ this Agreement, to:
46
+
47
+ (a) install, run and use the Software solely to access and use the
48
+ Service in accordance with the Terms;
49
+
50
+ (b) incorporate the Software, in unmodified form, into Your Application
51
+ solely to enable Your Application to access the Service; and
52
+
53
+ (c) distribute the Browser Components, in unmodified object form and
54
+ solely as part of Your Application, to end users of Your Application,
55
+ including through bundling, minification or other automated build
56
+ processes that do not alter the functionality of the Browser
57
+ Components.
58
+
59
+ 2.2 You may make a reasonable number of copies of the Software for backup,
60
+ development, testing and deployment of Your Application.
61
+
62
+ 2.3 All rights not expressly granted in this Agreement are reserved by
63
+ AbuseZero and its licensors. No license is granted by implication,
64
+ estoppel or otherwise.
65
+
66
+ 3. RESTRICTIONS
67
+
68
+ Except as expressly permitted by this Agreement or by applicable law that
69
+ cannot be excluded by contract, you will not, and will not permit any
70
+ third party to:
71
+
72
+ (a) copy, modify, translate, adapt or create derivative works of the
73
+ Software;
74
+
75
+ (b) decompile, disassemble, reverse engineer or otherwise attempt to
76
+ derive the source code, algorithms, structure, signals or methods of
77
+ the Software or the Service;
78
+
79
+ (c) sell, resell, rent, lease, lend, sublicense, distribute, publish or
80
+ otherwise make the Software available to any third party, except the
81
+ Browser Components as permitted by Section 2.1(c);
82
+
83
+ (d) publish or distribute the Software, or any part of it, as a
84
+ standalone package, library, module or container image, in any
85
+ package registry, repository or other channel;
86
+
87
+ (e) use the Software to access any service other than the Service, or to
88
+ access the Service other than in accordance with the Terms;
89
+
90
+ (f) use the Software to build, train, benchmark or improve a product or
91
+ service that competes with the Service, or for competitive analysis;
92
+
93
+ (g) circumvent, disable or interfere with any security, authentication,
94
+ rate-limiting, usage-limiting or integrity mechanism of the Software
95
+ or the Service;
96
+
97
+ (h) remove, alter or obscure any copyright, trademark, license or other
98
+ proprietary notice in or on the Software;
99
+
100
+ (i) use the Software in violation of any applicable law, regulation or
101
+ third-party right, including laws on privacy, data protection,
102
+ consumer protection, electronic communications and export control;
103
+ or
104
+
105
+ (j) use the Software to transmit malicious code or data that you do not
106
+ have the right to transmit.
107
+
108
+ 4. YOUR RESPONSIBILITIES
109
+
110
+ 4.1 You are responsible for Your Application, for all use of the Software
111
+ under your credentials, and for your compliance and your end users'
112
+ compliance with this Agreement and the Terms.
113
+
114
+ 4.2 You are responsible for providing any notices to, and obtaining any
115
+ consents from, end users that are required by applicable law for the use
116
+ of the Software in Your Application, including for the Browser
117
+ Components.
118
+
119
+ 4.3 You are responsible for keeping credentials, access tokens and devices
120
+ on which the Software stores them secure, and for revoking access you no
121
+ longer need.
122
+
123
+ 5. DATA
124
+
125
+ The Software transmits data to the Service. AbuseZero processes that data
126
+ in accordance with the Terms. This Agreement does not change the
127
+ allocation of rights and responsibilities for data set out in the Terms.
128
+
129
+ 6. OWNERSHIP
130
+
131
+ The Software is licensed, not sold. AbuseZero and its licensors retain all
132
+ right, title and interest, including all intellectual property rights, in
133
+ and to the Software, the Service and all copies, modifications and
134
+ derivative works of them. This Agreement grants you no right to use the
135
+ names, trademarks, service marks, logos or trade dress of AbuseZero.
136
+
137
+ 7. THIRD-PARTY COMPONENTS
138
+
139
+ Third-Party Components are licensed to you under their own license terms,
140
+ which are reproduced in the THIRD-PARTY-NOTICES file. Nothing in this
141
+ Agreement limits your rights under, or grants you rights that supersede,
142
+ those license terms. To the extent those license terms require it,
143
+ they apply to the relevant Third-Party Components in place of this
144
+ Agreement.
145
+
146
+ 8. UPDATES AND SUPPORT
147
+
148
+ AbuseZero may, at its discretion, provide updates to the Software, change
149
+ or discontinue the Software or any of its features, and require you to
150
+ use a current version to continue accessing the Service. Updates are
151
+ governed by this Agreement unless they are accompanied by other terms.
152
+ AbuseZero has no obligation to provide maintenance or support for the
153
+ Software except as stated in the Terms.
154
+
155
+ 9. FEEDBACK
156
+
157
+ If you provide suggestions, comments or other feedback about the Software,
158
+ AbuseZero may use it for any purpose without restriction, compensation or
159
+ obligation to you.
160
+
161
+ 10. TERM AND TERMINATION
162
+
163
+ 10.1 This Agreement takes effect when you first download, install, copy,
164
+ access or use the Software and continues until terminated.
165
+
166
+ 10.2 This Agreement, and all licenses granted under it, terminate
167
+ automatically and without notice if you breach this Agreement, or if
168
+ your right to use the Service ends under the Terms. AbuseZero may also
169
+ terminate this Agreement at any time on notice to you.
170
+
171
+ 10.3 On termination, you must stop using the Software and destroy all copies
172
+ in your possession or control, including copies incorporated into Your
173
+ Application. Sections 1, 3, 4, 5, 6, 7, 9, 10.3 and 11 through 16
174
+ survive termination.
175
+
176
+ 11. DISCLAIMER OF WARRANTIES
177
+
178
+ TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS
179
+ PROVIDED "AS IS" AND "AS AVAILABLE", WITH ALL FAULTS AND WITHOUT WARRANTY
180
+ OF ANY KIND. ABUSEZERO AND ITS LICENSORS DISCLAIM ALL WARRANTIES, WHETHER
181
+ EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING ANY WARRANTIES OF
182
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE,
183
+ NON-INFRINGEMENT, ACCURACY, QUIET ENJOYMENT AND ANY WARRANTIES ARISING
184
+ FROM COURSE OF DEALING OR USAGE OF TRADE. ABUSEZERO DOES NOT WARRANT THAT
185
+ THE SOFTWARE WILL BE UNINTERRUPTED, SECURE OR ERROR-FREE, THAT DEFECTS
186
+ WILL BE CORRECTED, OR THAT THE SOFTWARE OR THE SERVICE WILL DETECT OR
187
+ PREVENT ANY PARTICULAR ABUSE.
188
+
189
+ 12. LIMITATION OF LIABILITY
190
+
191
+ 12.1 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL
192
+ ABUSEZERO OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
193
+ SPECIAL, CONSEQUENTIAL, EXEMPLARY OR PUNITIVE DAMAGES, OR FOR ANY LOSS
194
+ OF PROFITS, REVENUE, BUSINESS, GOODWILL, DATA OR USE, OR COSTS OF
195
+ SUBSTITUTE GOODS OR SERVICES, ARISING OUT OF OR RELATING TO THIS
196
+ AGREEMENT OR THE SOFTWARE, HOWEVER CAUSED AND UNDER ANY THEORY OF
197
+ LIABILITY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
198
+
199
+ 12.2 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE TOTAL LIABILITY
200
+ OF ABUSEZERO AND ITS LICENSORS ARISING OUT OF OR RELATING TO THIS
201
+ AGREEMENT OR THE SOFTWARE WILL NOT EXCEED ONE HUNDRED UNITED STATES
202
+ DOLLARS (USD 100). THE SOFTWARE IS LICENSED FREE OF CHARGE, AND ANY
203
+ LIABILITY RELATING TO THE SERVICE IS GOVERNED SOLELY BY THE TERMS.
204
+
205
+ 12.3 THE LIMITATIONS IN THIS SECTION APPLY EVEN IF A REMEDY FAILS OF ITS
206
+ ESSENTIAL PURPOSE, AND DO NOT APPLY TO LIABILITY THAT CANNOT BE LIMITED
207
+ OR EXCLUDED UNDER APPLICABLE LAW.
208
+
209
+ 13. INDEMNIFICATION
210
+
211
+ You will defend, indemnify and hold harmless AbuseZero, its affiliates
212
+ and their respective officers, directors, employees, agents and licensors
213
+ from and against any claims, damages, losses, liabilities, costs and
214
+ expenses, including reasonable legal fees, arising out of or relating to
215
+ (a) Your Application, (b) your use of the Software in breach of this
216
+ Agreement, the Terms or applicable law, or (c) your failure to provide
217
+ notices or obtain consents required by Section 4.2.
218
+
219
+ 14. EXPORT CONTROL AND SANCTIONS
220
+
221
+ You will comply with all applicable export control and economic
222
+ sanctions laws and regulations. You represent that you are not located
223
+ in, or organized under the laws of, any country or region subject to
224
+ comprehensive sanctions, and that you are not, and are not owned or
225
+ controlled by, a person identified on any applicable restricted-party
226
+ list. You will not export, re-export or transfer the Software in
227
+ violation of those laws.
228
+
229
+ 15. GOVERNMENT END USERS
230
+
231
+ The Software is "commercial computer software" and "commercial computer
232
+ software documentation", as those terms are used in the applicable
233
+ procurement regulations. Any use, duplication or disclosure by or for a
234
+ government is subject to the rights granted in this Agreement, which are
235
+ the only rights granted.
236
+
237
+ 16. GENERAL
238
+
239
+ 16.1 Relationship to the Terms. This Agreement governs the Software. The
240
+ Terms govern the Service. If this Agreement and the Terms conflict with
241
+ respect to the Software, this Agreement controls, except that any
242
+ provision of the Terms that gives AbuseZero greater protection controls.
243
+
244
+ 16.2 Governing law and disputes. This Agreement, and any dispute arising out
245
+ of or relating to it, is governed by the law, and subject to the
246
+ exclusive jurisdiction of the courts, specified in the Terms, without
247
+ regard to conflict of law rules. The United Nations Convention on
248
+ Contracts for the International Sale of Goods does not apply.
249
+
250
+ 16.3 Equitable relief. A breach of Section 3 or Section 6 may cause
251
+ AbuseZero irreparable harm for which damages would be an inadequate
252
+ remedy. AbuseZero may seek injunctive or other equitable relief in any
253
+ court of competent jurisdiction, in addition to any other remedy.
254
+
255
+ 16.4 Assignment. You may not assign or transfer this Agreement, by operation
256
+ of law or otherwise, without AbuseZero's prior written consent. Any
257
+ attempted assignment without consent is void. AbuseZero may assign this
258
+ Agreement without restriction.
259
+
260
+ 16.5 Changes. AbuseZero may update this Agreement by publishing a new
261
+ version with the Software. Each version of the Software is governed by
262
+ the version of this Agreement included with it.
263
+
264
+ 16.6 Severability and waiver. If any provision of this Agreement is held
265
+ unenforceable, it will be enforced to the maximum extent permissible
266
+ and the remaining provisions remain in full force and effect. A failure
267
+ or delay in enforcing any provision is not a waiver of it.
268
+
269
+ 16.7 Entire agreement. This Agreement, together with the Terms, is the
270
+ entire agreement between you and AbuseZero regarding the Software and
271
+ supersedes all prior or contemporaneous understandings regarding it.
272
+
273
+ 16.8 Notices. AbuseZero may give notices under this Agreement by email to
274
+ the address associated with your AbuseZero account, in the dashboard,
275
+ or by publishing them with the Software. You may give notices to
276
+ AbuseZero through the contact page at https://abusezero.com/contact.
277
+
278
+ 16.9 Interpretation. Headings are for convenience only. "Including" means
279
+ "including without limitation".
@@ -0,0 +1,158 @@
1
+ Metadata-Version: 2.5
2
+ Name: abusezero
3
+ Version: 0.1.0
4
+ Summary: The official AbuseZero Python SDK: abuse prevention API for SaaS.
5
+ Author: AbuseZero
6
+ Requires-Python: >=3.11
7
+ Description-Content-Type: text/markdown
8
+ License-Expression: LicenseRef-AbuseZero-SDK
9
+ License-File: LICENSE
10
+ Requires-Dist: httpx>=0.28,<1
11
+ Project-URL: Documentation, https://docs.abusezero.com/docs/tools/python-sdk
12
+ Project-URL: Homepage, https://abusezero.com
13
+ Project-URL: Source, https://github.com/abusezero/abusezero-python
14
+ Import-Name: abusezero
15
+
16
+ # AbuseZero Python SDK
17
+
18
+ Use the AbuseZero Python SDK to evaluate claims and manage your workspace from your server. AbuseZero is an abuse prevention API for SaaS.
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ python -m pip install abusezero
24
+ ```
25
+
26
+ The SDK supports Python 3.11 to 3.15. It requires HTTPX, which pip installs with it.
27
+
28
+ The package includes its SDK license as `LICENSE`. HTTPX and its dependencies are installed separately and keep their own licenses. [`API.md`](https://github.com/abusezero/abusezero-python/blob/main/API.md), the Django and FastAPI examples and an example script are in the [GitHub repository](https://github.com/abusezero/abusezero-python).
29
+
30
+ ## Evaluate and report a grant
31
+
32
+ Store your SECRET KEY or RESTRICTED KEY in `ABUSEZERO_SECRET_KEY` on the server. Use a stable claim ID and keep the same idempotency key when retrying the same action.
33
+
34
+ ```python
35
+ import os
36
+ from collections.abc import Callable
37
+ from abusezero import AbuseZero
38
+
39
+
40
+ def create_client() -> AbuseZero:
41
+ return AbuseZero(key=os.environ["ABUSEZERO_SECRET_KEY"], outage="throw")
42
+
43
+
44
+ def evaluate_and_grant(client: AbuseZero, claim_id: str, email: str,
45
+ grant: Callable[[str], None]):
46
+ result = client.evaluate({
47
+ "benefit": "pro_trial", "claim_id": claim_id,
48
+ "subject": {"email": email},
49
+ }, idempotency_key="evaluate:" + claim_id)
50
+ if "status" in result:
51
+ return result # No decision was made.
52
+ if result["source"] == "local_outage" or result["result"] != "allow":
53
+ return result
54
+ grant(claim_id) # Your transaction must finish successfully before returning.
55
+ client.outcome({"outcome": "granted"}, path={"id": result["id"]},
56
+ idempotency_key="grant:" + claim_id)
57
+ return result
58
+ ```
59
+
60
+ Create the client once at worker startup, reuse it across requests and close it at shutdown. Call this helper from your authenticated handler with your own stored claim ID, authenticated user email and transactional grant function. The grant function must be idempotent for that claim ID. The helper reports `granted` only after the grant function succeeds; if reporting fails afterward, retry with the same claim ID and keys. On `deny`, don't grant the benefit. A skipped result is neither allow nor deny, including when its reason is new to your application.
61
+
62
+ ## Clients and credentials
63
+
64
+ ```python
65
+ import os
66
+ from abusezero import AbuseZero, AbuseZeroPublic, AsyncAbuseZero
67
+
68
+ # An OAuth access token, from a sign-in or a machine client, acts in the selected workspace.
69
+ oauth = AbuseZero(access_token=os.environ["ABUSEZERO_ACCESS_TOKEN"],
70
+ workspace=os.environ["ABUSEZERO_WORKSPACE"], outage="throw")
71
+ keys = oauth.api_keys({"limit": 20})
72
+
73
+ # The public client reads public information and sends no credentials.
74
+ with AbuseZeroPublic() as public:
75
+ pricing = public.pricing()
76
+
77
+
78
+ async def list_benefits(client: AsyncAbuseZero):
79
+ # Create the async client once for your event loop and reuse it, like the synchronous client.
80
+ return await client.benefits({"limit": 20})
81
+ ```
82
+
83
+ Management operations need an OAuth access token, from a sign-in or a machine client. An API key alone can't perform them. The selected workspace and the approving member's permissions still apply. Some actions act for one member or follow what that member may do, such as notifications, support tickets and changes to members, and need that member's own sign-in; API keys and machine clients get `MEMBER_SIGN_IN_REQUIRED` for them. See [Actions that need a member's own sign-in](https://docs.abusezero.com/docs/api-reference/authentication#actions-that-need-a-members-own-sign-in).
84
+
85
+ Async methods support task cancellation. The synchronous client also works inside an async application, but use `AsyncAbuseZero` to avoid blocking its event loop. Pass an HTTPX transport with `transport=` to configure a proxy or a test service. The client owns and closes it. Custom synchronous transports must honor the request timeout; the built-in transport cancels requests when the total budget ends.
86
+
87
+ ## Webhooks
88
+
89
+ ```python
90
+ from abusezero import WebhookVerificationError, verify_webhook
91
+
92
+
93
+ def receive(raw_body: bytes, headers: dict[str, str], current_secret: str, previous_secret: str | None):
94
+ try:
95
+ # Use the original request bytes. Keep both secrets during rotation.
96
+ event = verify_webhook(payload=raw_body, headers=headers,
97
+ secret=[current_secret, previous_secret])
98
+ except WebhookVerificationError:
99
+ return 400
100
+ ... # Deduplicate by event["id"], then handle the event.
101
+ return 200
102
+ ```
103
+
104
+ `verify_webhook(payload=, headers=, secret=, tolerance_seconds=300)` checks the signature over the original request bytes and the timestamp within `tolerance_seconds`, accepts rotating secrets and rejects a modified body. It returns the event, or raises `WebhookVerificationError` when the signature or event body can't be verified. Deduplicate accepted events by their event ID in your application.
105
+
106
+ ## Errors, retries and results
107
+
108
+ Catch `AbuseZeroError`. Its fields are `code`, `status`, `request_id`, `retryable` and `docs_url`. `status` is the HTTP status, or `0` for `TRANSPORT_ERROR` and `DEADLINE_EXCEEDED`, which have no response. The SDK raises these before sending a request, each with a 4xx status: `CREDENTIAL_REQUIRED`, `INVALID_KEY`, `INVALID_TOKEN`, `WORKSPACE_REQUIRED`, `INVALID_WORKSPACE`, `OAUTH_REQUIRED`, `INVALID_IDEMPOTENCY_KEY` and `INVALID_REQUEST`. `INVALID_RESPONSE` means a response couldn't be read.
109
+
110
+ Set `outage` to `throw`, `allow` or `deny`. The default is `throw`. Only evaluation calls can return `source: local_outage`; other operations raise an error. Rate limits always remain errors. Skipped responses remain skips, including unknown skip reasons.
111
+
112
+ Within `v1`, responses can gain new fields and new values for codes and enums. The SDK returns them unchanged, so handle a value your code doesn't recognize as a generic case.
113
+
114
+ Calls make at most three attempts. Network errors, retryable API errors and HTTP 429, 502, 503 and 504 are retried. `Retry-After` sets the minimum wait. Every attempt uses identical serialized input and the same idempotency key. The entire call, including waits, has one budget: 1.8 seconds for `evaluate` and 5 seconds for other calls, dry runs included. An events long poll adds 5 seconds to its requested wait. The server's own operation deadline can be shorter.
115
+
116
+ ## Methods and pagination
117
+
118
+ Every public server operation has a method. Pass input fields in the method's input and path fields separately in `path`. Mutation methods require an idempotency key. [`API.md`](https://github.com/abusezero/abusezero-python/blob/main/API.md) lists every method; see the [AbuseZero REST API reference](https://docs.abusezero.com/docs/api-reference) for each operation's fields.
119
+
120
+ List methods accept `cursor` and `limit` where documented. Process the returned `data`, then pass the returned `next_cursor` to the same method until it is null. Keep IDs and cursors as strings. Send null only when the field allows it; omitting a field leaves it absent.
121
+
122
+ ## Incoming requests and identifiers
123
+
124
+ ```python
125
+ import os
126
+ from abusezero import AbuseZero, create_custom_identifier, create_phone_hash, incoming_request
127
+
128
+
129
+ def evaluate_with_identifiers(client: AbuseZero, claim_id: str, email: str,
130
+ method: str, url: str, headers: dict[str, str]):
131
+ secret = os.environ["IDENTIFIER_HASH_SECRET"]
132
+ phone_hash = create_phone_hash(secret=secret, key_version="v1", e164="+14155550123")
133
+ team = create_custom_identifier(secret=secret, key_version="v1", key="team_id", value="team_8812")
134
+ return client.evaluate({
135
+ "benefit": "pro_trial", "claim_id": claim_id, "subject": {"email": email},
136
+ "identifiers": {"phone_hash": phone_hash, "phone_verified": True, "custom": [team]},
137
+ "request": incoming_request(method, url, headers),
138
+ }, idempotency_key="evaluate:" + claim_id)
139
+ ```
140
+
141
+ `incoming_request(method, url, headers)` takes the incoming HTTP method, absolute URL and headers, and removes credential headers before you include the request in an evaluation. It doesn't infer a trusted client IP; use your application's trusted proxy configuration for that.
142
+
143
+ `create_phone_hash(secret=, key_version=, e164=)` needs a number in E.164 format. `create_custom_identifier(secret=, key_version=, key=, value=)` needs a [registered](https://docs.abusezero.com/docs/api-reference/custom-identifiers#register-a-custom-identifier) identifier key. Both return the public API's hash objects. Use the same secret and `key_version` everywhere the same value should match. See [Send identifiers](https://docs.abusezero.com/docs/guides/send-identifiers).
144
+
145
+ ## Frameworks and browser protection
146
+
147
+ The Django and FastAPI examples are in [`examples/frameworks.md`](https://github.com/abusezero/abusezero-python/blob/main/examples/frameworks.md); no framework dependency is required.
148
+
149
+ For browser protection, add the [standalone browser script](https://docs.abusezero.com/docs/tools/browser-sdk#standalone-browser-script) to your page and pass its device token to your server. Send the token unchanged in the evaluation input as `identifiers.device_token`. This SDK is the only package to install. See [Set up browser protection](https://docs.abusezero.com/docs/guides/set-up-browser-protection).
150
+
151
+ ## API origin and TLS
152
+
153
+ The default API origin is `https://api.abusezero.com`. Custom origins require HTTPS; HTTP is accepted only for explicit loopback testing. Built-in transports verify TLS and refuse redirects. Custom transports are responsible for equivalent behavior. Never log credentials or raw authenticated requests.
154
+
155
+ ## More documentation
156
+
157
+ See [authentication](https://docs.abusezero.com/docs/api-reference/authentication), [evaluation results](https://docs.abusezero.com/docs/concepts/evaluations) and [webhooks](https://docs.abusezero.com/docs/guides/receive-webhooks).
158
+