sendora 2.6.2__tar.gz → 2.7.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.
Files changed (40) hide show
  1. {sendora-2.6.2 → sendora-2.7.0}/CHANGELOG.md +12 -0
  2. {sendora-2.6.2 → sendora-2.7.0}/PKG-INFO +68 -66
  3. {sendora-2.6.2 → sendora-2.7.0}/README.md +67 -65
  4. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_errors.py +11 -6
  5. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_version.py +1 -1
  6. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/types.py +20 -13
  7. {sendora-2.6.2 → sendora-2.7.0}/.gitignore +0 -0
  8. {sendora-2.6.2 → sendora-2.7.0}/LICENSE +0 -0
  9. {sendora-2.6.2 → sendora-2.7.0}/pyproject.toml +0 -0
  10. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/__init__.py +0 -0
  11. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_account.py +0 -0
  12. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_answers.py +0 -0
  13. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_client.py +0 -0
  14. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_json.py +0 -0
  15. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_keys.py +0 -0
  16. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_model.py +0 -0
  17. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_options.py +0 -0
  18. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_pages.py +0 -0
  19. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_retry.py +0 -0
  20. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_transport.py +0 -0
  21. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_webhooks.py +0 -0
  22. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/_wire.py +0 -0
  23. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/py.typed +0 -0
  24. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/__init__.py +0 -0
  25. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/broadcasts.py +0 -0
  26. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/domains.py +0 -0
  27. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/email.py +0 -0
  28. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/erasures.py +0 -0
  29. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/inbound.py +0 -0
  30. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/inbound_domains.py +0 -0
  31. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/messages.py +0 -0
  32. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/server.py +0 -0
  33. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/servers.py +0 -0
  34. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/streams.py +0 -0
  35. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/suppressions.py +0 -0
  36. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/tokens.py +0 -0
  37. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/tracking_domains.py +0 -0
  38. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/tracking_opt_outs.py +0 -0
  39. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/resources/webhooks.py +0 -0
  40. {sendora-2.6.2 → sendora-2.7.0}/src/sendora/skills/sendora/SKILL.md +0 -0
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.7.0
4
+
5
+ - A new error code, `daily_cap_reached`. An account can have a daily cap,
6
+ and the code means that its live servers have sent all of the day's
7
+ emails. It is a `RateLimitError`, with `scope`, `cap`, `used` and
8
+ `resets_at`, and is not retried.
9
+ - A `ServerLimit`'s `period` can be `day`, the calendar day in UTC.
10
+ - `payment_required` also means that the account's plan does not include
11
+ broadcasts.
12
+ - `OwnServer.inbound_cap` is also `None` for an account whose plan includes
13
+ no received mail.
14
+
3
15
  ## 2.6.2
4
16
 
5
17
  - The README says that an administrator creates an account key under
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: sendora
3
- Version: 2.6.2
3
+ Version: 2.7.0
4
4
  Summary: The Python client for Sendora's email API.
5
5
  Project-URL: Homepage, https://sendora.se/docs
6
6
  License-Expression: MIT
@@ -305,14 +305,15 @@ not print it; read it from `.token`.
305
305
  ## The server
306
306
 
307
307
  The key's own server: its name and id, whether it is live or a test
308
- server, every limit a send on it is held to with how much of it this
309
- minute and this month have used, and the account's sending domains a From
310
- address may use.
308
+ server, every limit a send on it is held to, and the account's sending
309
+ domains a From address may use. Each limit counts its `period`, a
310
+ `minute`, a `day` or a `month`, and says what that period has used. An
311
+ account can have a daily cap beside its monthly cap.
311
312
 
312
313
  `inbound_cap` is the account's monthly cap on received mail, apart from the
313
314
  limits on sending, with its `limit`, `used` and `resets_at`. Past it,
314
315
  mail to the account is refused for now, so senders retry. It is `None` on
315
- a test server, which receives no mail.
316
+ a test server, and for an account whose plan includes no received mail.
316
317
 
317
318
  | Call | Answers |
318
319
  | ---------------------- | ---------------------------------------------------------------------------------------------------------------------- |
@@ -538,7 +539,7 @@ and whose `code` says why:
538
539
  | `NotFoundError` | 404 |
539
540
  | `ConflictError` | 409 |
540
541
  | `UnprocessableEntityError` | 422 |
541
- | `RateLimitError` | 429, `rate_limited` and `monthly_cap_reached` alike |
542
+ | `RateLimitError` | 429, `rate_limited` and a used-up cap alike |
542
543
  | `InternalServerError` | 500 or more |
543
544
  | `APIStatusError` | Any other status, and the base of the classes for a status |
544
545
  | `ResponseValidationError` | An answer the SDK could not read; the call took effect |
@@ -560,66 +561,67 @@ except SendoraError as error:
560
561
  print([(entry.address, entry.reason) for entry in error.suppressed])
561
562
  ```
562
563
 
563
- | Code | Status | Meaning |
564
- | --------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------- |
565
- | `invalid_request` | 400 | A field is wrong; `issues` says which. |
566
- | `idempotency_key_required` | 400 | A batch was sent without a key. |
567
- | `unauthorized` | 401 | The key is missing, malformed or revoked. |
568
- | `wrong_token_kind` | 403 | A server key where an account key is needed, or the reverse; `message` names the kind. |
569
- | `payment_required` | 402 | The first payment has not arrived, an invoice is unpaid, payment is paused, or the subscription has ended. |
570
- | `account_paused` | 403 | Sendora has paused the account. |
571
- | `account_not_active` | 403 | The account is not approved to send, or not active for an inbound stream. |
572
- | `tracking_unavailable` | 403 | A message asked for tracking, and tracking is not open to the account. |
573
- | `tracking_not_confirmed` | 409 | A message asked for tracking before an administrator first switched it on in the dashboard. |
574
- | `spam_complaint_locked` | 403 | Only support can lift a spam-complaint suppression. |
575
- | `unsubscribe_locked` | 403 | Only support can lift a recipient's own unsubscribe. |
576
- | `not_found` | 404 | No such id on this server, or no such suppressed or not-tracked address. |
577
- | `domain_exists` | 409 | The account already has the domain; `existing_id` names it. |
578
- | `domain_reserved` | 400 | The name is Sendora's own; no account can receive on it. |
579
- | `tracking_domain_exists` | 409 | The account already has the host, or one on that sending domain; `existing_id` names it. |
580
- | `tracking_domain_limit` | 409 | The account has as many tracking domains as it may. |
581
- | `tracking_host_is_sending_domain` | 422 | The host is a sending domain itself; choose a subdomain. |
582
- | `tracking_host_not_verified` | 422 | The host is not under a verified sending domain of the account. |
583
- | `tracking_host_taken` | 409 | Another account holds the host. |
584
- | `inbound_domain_exists` | 409 | The stream already has a domain (`existing_id` names it), or another account holds the name verified. |
585
- | `webhook_exists` | 409 | The server already has a webhook for that URL; `existing_id` names it. |
586
- | `stream_exists` | 409 | The server already has a stream with that name; `existing_id` names it. |
587
- | `inbound_stream_exists` | 409 | The server already has a live inbound stream; `existing_id` names it. |
588
- | `default_stream` | 409 | The default stream cannot be archived. |
589
- | `last_token` | 409 | The only live key cannot be revoked. |
590
- | `last_secret` | 409 | The only live secret of a webhook cannot be deleted. |
591
- | `secret_limit` | 409 | The webhook already holds two live secrets; `max` says how many. |
592
- | `token_limit` | 409 | The server or the account already holds two live keys; `max` says how many. |
593
- | `server_exists` | 409 | The account already has a server with that name. |
594
- | `server_limit` | 409 | The account has as many servers as it may; `max` says how many. |
595
- | `server_reserved` | 409 | The server sends Sendora's own sign-in mail and cannot be renamed or removed. |
596
- | `server_in_flight` | 409 | Messages of the server are still being delivered; delete it later. |
597
- | `request_too_large` | 413 | The body exceeds 10 MB, or 64 MB for a broadcast. |
598
- | `from_domain_not_verified` | 422 | The From domain is not a verified sending domain. |
599
- | `stream_not_found` | 422 | `stream_id` names no stream of this server. |
600
- | `stream_archived` | 422 | The stream is archived and takes no new messages. |
601
- | `stream_paused` | 422 | Sendora paused the stream after complaints; support resumes it. |
602
- | `stream_not_sendable` | 422 | An inbound stream receives mail; it takes no messages and has no list. |
603
- | `stream_not_broadcast` | 422 | A broadcast goes on a broadcast stream; this one is transactional. |
604
- | `substitution_missing` | 422 | The content names a `{{ key }}` a message does not give; `index` and `keys` say which. |
605
- | `broadcast_not_open` | 409 | The broadcast is completed or cancelled; nothing is left to cancel. |
606
- | `unsubscribe_placeholder_missing` | 422 | A broadcast message lacks `{{ unsubscribe_url }}` in a part. |
607
- | `list_unsubscribe_reserved` | 422 | Sendora writes List-Unsubscribe on broadcast streams; leave it out. |
608
- | `recipient_suppressed` | 422 | Recipients on the suppression list; `suppressed` lists them. |
609
- | `test_address_on_live_server` | 422 | Addresses at simulator.sendora.se are for test servers; `addresses` lists them. |
610
- | `stream_kind_not_allowed` | 422 | A test server has no inbound stream; receive on a live server. |
611
- | `mode_immutable` | 400 | A server's mode is fixed at creation; create a new server for the other mode. |
612
- | `idempotency_key_mismatch` | 422 | The key was used before with a different body. |
613
- | `content_expired` | 410 | The received message's content window has passed; the message itself stays. |
614
- | `content_unreadable` | 409 | The received message's stored content cannot be opened; Sendora has been told. |
615
- | `rate_limited` | 429 | Per-minute limit; `retry_after`, `scope`, `limit`. From the edge, too many requests at once. |
616
- | `monthly_cap_reached` | 429 | The monthly cap is used up; `scope`, `cap`, `used`, `resets_at`. |
617
- | `sending_disabled` | 503 | Sending is paused for everyone; `retry_after`. |
618
- | `connection_failed` | none | The request did not reach the API, or its answer was lost; `__cause__` says why. |
619
- | `timeout` | none | A step of the request took longer than `timeout`. |
620
- | `unexpected_response` | any | An answer without a JSON error body, such as from a proxy. |
621
- | `invalid_signature` | none | A webhook's signature is missing, malformed or wrong. |
622
- | `stale_signature` | none | A webhook's signature is older than the tolerance. |
564
+ | Code | Status | Meaning |
565
+ | --------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
566
+ | `invalid_request` | 400 | A field is wrong; `issues` says which. |
567
+ | `idempotency_key_required` | 400 | A batch was sent without a key. |
568
+ | `unauthorized` | 401 | The key is missing, malformed or revoked. |
569
+ | `wrong_token_kind` | 403 | A server key where an account key is needed, or the reverse; `message` names the kind. |
570
+ | `payment_required` | 402 | The first payment has not arrived, an invoice is unpaid, payment is paused, the subscription has ended, or the account's plan does not include broadcasts. |
571
+ | `account_paused` | 403 | Sendora has paused the account. |
572
+ | `account_not_active` | 403 | The account is not approved to send, or not active for an inbound stream. |
573
+ | `tracking_unavailable` | 403 | A message asked for tracking, and tracking is not open to the account. |
574
+ | `tracking_not_confirmed` | 409 | A message asked for tracking before an administrator first switched it on in the dashboard. |
575
+ | `spam_complaint_locked` | 403 | Only support can lift a spam-complaint suppression. |
576
+ | `unsubscribe_locked` | 403 | Only support can lift a recipient's own unsubscribe. |
577
+ | `not_found` | 404 | No such id on this server, or no such suppressed or not-tracked address. |
578
+ | `domain_exists` | 409 | The account already has the domain; `existing_id` names it. |
579
+ | `domain_reserved` | 400 | The name is Sendora's own; no account can receive on it. |
580
+ | `tracking_domain_exists` | 409 | The account already has the host, or one on that sending domain; `existing_id` names it. |
581
+ | `tracking_domain_limit` | 409 | The account has as many tracking domains as it may. |
582
+ | `tracking_host_is_sending_domain` | 422 | The host is a sending domain itself; choose a subdomain. |
583
+ | `tracking_host_not_verified` | 422 | The host is not under a verified sending domain of the account. |
584
+ | `tracking_host_taken` | 409 | Another account holds the host. |
585
+ | `inbound_domain_exists` | 409 | The stream already has a domain (`existing_id` names it), or another account holds the name verified. |
586
+ | `webhook_exists` | 409 | The server already has a webhook for that URL; `existing_id` names it. |
587
+ | `stream_exists` | 409 | The server already has a stream with that name; `existing_id` names it. |
588
+ | `inbound_stream_exists` | 409 | The server already has a live inbound stream; `existing_id` names it. |
589
+ | `default_stream` | 409 | The default stream cannot be archived. |
590
+ | `last_token` | 409 | The only live key cannot be revoked. |
591
+ | `last_secret` | 409 | The only live secret of a webhook cannot be deleted. |
592
+ | `secret_limit` | 409 | The webhook already holds two live secrets; `max` says how many. |
593
+ | `token_limit` | 409 | The server or the account already holds two live keys; `max` says how many. |
594
+ | `server_exists` | 409 | The account already has a server with that name. |
595
+ | `server_limit` | 409 | The account has as many servers as it may; `max` says how many. |
596
+ | `server_reserved` | 409 | The server sends Sendora's own sign-in mail and cannot be renamed or removed. |
597
+ | `server_in_flight` | 409 | Messages of the server are still being delivered; delete it later. |
598
+ | `request_too_large` | 413 | The body exceeds 10 MB, or 64 MB for a broadcast. |
599
+ | `from_domain_not_verified` | 422 | The From domain is not a verified sending domain. |
600
+ | `stream_not_found` | 422 | `stream_id` names no stream of this server. |
601
+ | `stream_archived` | 422 | The stream is archived and takes no new messages. |
602
+ | `stream_paused` | 422 | Sendora paused the stream after complaints; support resumes it. |
603
+ | `stream_not_sendable` | 422 | An inbound stream receives mail; it takes no messages and has no list. |
604
+ | `stream_not_broadcast` | 422 | A broadcast goes on a broadcast stream; this one is transactional. |
605
+ | `substitution_missing` | 422 | The content names a `{{ key }}` a message does not give; `index` and `keys` say which. |
606
+ | `broadcast_not_open` | 409 | The broadcast is completed or cancelled; nothing is left to cancel. |
607
+ | `unsubscribe_placeholder_missing` | 422 | A broadcast message lacks `{{ unsubscribe_url }}` in a part. |
608
+ | `list_unsubscribe_reserved` | 422 | Sendora writes List-Unsubscribe on broadcast streams; leave it out. |
609
+ | `recipient_suppressed` | 422 | Recipients on the suppression list; `suppressed` lists them. |
610
+ | `test_address_on_live_server` | 422 | Addresses at simulator.sendora.se are for test servers; `addresses` lists them. |
611
+ | `stream_kind_not_allowed` | 422 | A test server has no inbound stream; receive on a live server. |
612
+ | `mode_immutable` | 400 | A server's mode is fixed at creation; create a new server for the other mode. |
613
+ | `idempotency_key_mismatch` | 422 | The key was used before with a different body. |
614
+ | `content_expired` | 410 | The received message's content window has passed; the message itself stays. |
615
+ | `content_unreadable` | 409 | The received message's stored content cannot be opened; Sendora has been told. |
616
+ | `rate_limited` | 429 | Per-minute limit; `retry_after`, `scope`, `limit`. From the edge, too many requests at once. |
617
+ | `daily_cap_reached` | 429 | The account's daily cap is used up; `scope`, `cap`, `used`, `resets_at`. |
618
+ | `monthly_cap_reached` | 429 | The monthly cap is used up; `scope`, `cap`, `used`, `resets_at`. |
619
+ | `sending_disabled` | 503 | Sending is paused for everyone; `retry_after`. |
620
+ | `connection_failed` | none | The request did not reach the API, or its answer was lost; `__cause__` says why. |
621
+ | `timeout` | none | A step of the request took longer than `timeout`. |
622
+ | `unexpected_response` | any | An answer without a JSON error body, such as from a proxy. |
623
+ | `invalid_signature` | none | A webhook's signature is missing, malformed or wrong. |
624
+ | `stale_signature` | none | A webhook's signature is older than the tolerance. |
623
625
 
624
626
  `error.retryable` is true when waiting and calling again could succeed.
625
627
  Neither the key nor a request's subject, text, HTML or attachments is ever
@@ -283,14 +283,15 @@ not print it; read it from `.token`.
283
283
  ## The server
284
284
 
285
285
  The key's own server: its name and id, whether it is live or a test
286
- server, every limit a send on it is held to with how much of it this
287
- minute and this month have used, and the account's sending domains a From
288
- address may use.
286
+ server, every limit a send on it is held to, and the account's sending
287
+ domains a From address may use. Each limit counts its `period`, a
288
+ `minute`, a `day` or a `month`, and says what that period has used. An
289
+ account can have a daily cap beside its monthly cap.
289
290
 
290
291
  `inbound_cap` is the account's monthly cap on received mail, apart from the
291
292
  limits on sending, with its `limit`, `used` and `resets_at`. Past it,
292
293
  mail to the account is refused for now, so senders retry. It is `None` on
293
- a test server, which receives no mail.
294
+ a test server, and for an account whose plan includes no received mail.
294
295
 
295
296
  | Call | Answers |
296
297
  | ---------------------- | ---------------------------------------------------------------------------------------------------------------------- |
@@ -516,7 +517,7 @@ and whose `code` says why:
516
517
  | `NotFoundError` | 404 |
517
518
  | `ConflictError` | 409 |
518
519
  | `UnprocessableEntityError` | 422 |
519
- | `RateLimitError` | 429, `rate_limited` and `monthly_cap_reached` alike |
520
+ | `RateLimitError` | 429, `rate_limited` and a used-up cap alike |
520
521
  | `InternalServerError` | 500 or more |
521
522
  | `APIStatusError` | Any other status, and the base of the classes for a status |
522
523
  | `ResponseValidationError` | An answer the SDK could not read; the call took effect |
@@ -538,66 +539,67 @@ except SendoraError as error:
538
539
  print([(entry.address, entry.reason) for entry in error.suppressed])
539
540
  ```
540
541
 
541
- | Code | Status | Meaning |
542
- | --------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------- |
543
- | `invalid_request` | 400 | A field is wrong; `issues` says which. |
544
- | `idempotency_key_required` | 400 | A batch was sent without a key. |
545
- | `unauthorized` | 401 | The key is missing, malformed or revoked. |
546
- | `wrong_token_kind` | 403 | A server key where an account key is needed, or the reverse; `message` names the kind. |
547
- | `payment_required` | 402 | The first payment has not arrived, an invoice is unpaid, payment is paused, or the subscription has ended. |
548
- | `account_paused` | 403 | Sendora has paused the account. |
549
- | `account_not_active` | 403 | The account is not approved to send, or not active for an inbound stream. |
550
- | `tracking_unavailable` | 403 | A message asked for tracking, and tracking is not open to the account. |
551
- | `tracking_not_confirmed` | 409 | A message asked for tracking before an administrator first switched it on in the dashboard. |
552
- | `spam_complaint_locked` | 403 | Only support can lift a spam-complaint suppression. |
553
- | `unsubscribe_locked` | 403 | Only support can lift a recipient's own unsubscribe. |
554
- | `not_found` | 404 | No such id on this server, or no such suppressed or not-tracked address. |
555
- | `domain_exists` | 409 | The account already has the domain; `existing_id` names it. |
556
- | `domain_reserved` | 400 | The name is Sendora's own; no account can receive on it. |
557
- | `tracking_domain_exists` | 409 | The account already has the host, or one on that sending domain; `existing_id` names it. |
558
- | `tracking_domain_limit` | 409 | The account has as many tracking domains as it may. |
559
- | `tracking_host_is_sending_domain` | 422 | The host is a sending domain itself; choose a subdomain. |
560
- | `tracking_host_not_verified` | 422 | The host is not under a verified sending domain of the account. |
561
- | `tracking_host_taken` | 409 | Another account holds the host. |
562
- | `inbound_domain_exists` | 409 | The stream already has a domain (`existing_id` names it), or another account holds the name verified. |
563
- | `webhook_exists` | 409 | The server already has a webhook for that URL; `existing_id` names it. |
564
- | `stream_exists` | 409 | The server already has a stream with that name; `existing_id` names it. |
565
- | `inbound_stream_exists` | 409 | The server already has a live inbound stream; `existing_id` names it. |
566
- | `default_stream` | 409 | The default stream cannot be archived. |
567
- | `last_token` | 409 | The only live key cannot be revoked. |
568
- | `last_secret` | 409 | The only live secret of a webhook cannot be deleted. |
569
- | `secret_limit` | 409 | The webhook already holds two live secrets; `max` says how many. |
570
- | `token_limit` | 409 | The server or the account already holds two live keys; `max` says how many. |
571
- | `server_exists` | 409 | The account already has a server with that name. |
572
- | `server_limit` | 409 | The account has as many servers as it may; `max` says how many. |
573
- | `server_reserved` | 409 | The server sends Sendora's own sign-in mail and cannot be renamed or removed. |
574
- | `server_in_flight` | 409 | Messages of the server are still being delivered; delete it later. |
575
- | `request_too_large` | 413 | The body exceeds 10 MB, or 64 MB for a broadcast. |
576
- | `from_domain_not_verified` | 422 | The From domain is not a verified sending domain. |
577
- | `stream_not_found` | 422 | `stream_id` names no stream of this server. |
578
- | `stream_archived` | 422 | The stream is archived and takes no new messages. |
579
- | `stream_paused` | 422 | Sendora paused the stream after complaints; support resumes it. |
580
- | `stream_not_sendable` | 422 | An inbound stream receives mail; it takes no messages and has no list. |
581
- | `stream_not_broadcast` | 422 | A broadcast goes on a broadcast stream; this one is transactional. |
582
- | `substitution_missing` | 422 | The content names a `{{ key }}` a message does not give; `index` and `keys` say which. |
583
- | `broadcast_not_open` | 409 | The broadcast is completed or cancelled; nothing is left to cancel. |
584
- | `unsubscribe_placeholder_missing` | 422 | A broadcast message lacks `{{ unsubscribe_url }}` in a part. |
585
- | `list_unsubscribe_reserved` | 422 | Sendora writes List-Unsubscribe on broadcast streams; leave it out. |
586
- | `recipient_suppressed` | 422 | Recipients on the suppression list; `suppressed` lists them. |
587
- | `test_address_on_live_server` | 422 | Addresses at simulator.sendora.se are for test servers; `addresses` lists them. |
588
- | `stream_kind_not_allowed` | 422 | A test server has no inbound stream; receive on a live server. |
589
- | `mode_immutable` | 400 | A server's mode is fixed at creation; create a new server for the other mode. |
590
- | `idempotency_key_mismatch` | 422 | The key was used before with a different body. |
591
- | `content_expired` | 410 | The received message's content window has passed; the message itself stays. |
592
- | `content_unreadable` | 409 | The received message's stored content cannot be opened; Sendora has been told. |
593
- | `rate_limited` | 429 | Per-minute limit; `retry_after`, `scope`, `limit`. From the edge, too many requests at once. |
594
- | `monthly_cap_reached` | 429 | The monthly cap is used up; `scope`, `cap`, `used`, `resets_at`. |
595
- | `sending_disabled` | 503 | Sending is paused for everyone; `retry_after`. |
596
- | `connection_failed` | none | The request did not reach the API, or its answer was lost; `__cause__` says why. |
597
- | `timeout` | none | A step of the request took longer than `timeout`. |
598
- | `unexpected_response` | any | An answer without a JSON error body, such as from a proxy. |
599
- | `invalid_signature` | none | A webhook's signature is missing, malformed or wrong. |
600
- | `stale_signature` | none | A webhook's signature is older than the tolerance. |
542
+ | Code | Status | Meaning |
543
+ | --------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
544
+ | `invalid_request` | 400 | A field is wrong; `issues` says which. |
545
+ | `idempotency_key_required` | 400 | A batch was sent without a key. |
546
+ | `unauthorized` | 401 | The key is missing, malformed or revoked. |
547
+ | `wrong_token_kind` | 403 | A server key where an account key is needed, or the reverse; `message` names the kind. |
548
+ | `payment_required` | 402 | The first payment has not arrived, an invoice is unpaid, payment is paused, the subscription has ended, or the account's plan does not include broadcasts. |
549
+ | `account_paused` | 403 | Sendora has paused the account. |
550
+ | `account_not_active` | 403 | The account is not approved to send, or not active for an inbound stream. |
551
+ | `tracking_unavailable` | 403 | A message asked for tracking, and tracking is not open to the account. |
552
+ | `tracking_not_confirmed` | 409 | A message asked for tracking before an administrator first switched it on in the dashboard. |
553
+ | `spam_complaint_locked` | 403 | Only support can lift a spam-complaint suppression. |
554
+ | `unsubscribe_locked` | 403 | Only support can lift a recipient's own unsubscribe. |
555
+ | `not_found` | 404 | No such id on this server, or no such suppressed or not-tracked address. |
556
+ | `domain_exists` | 409 | The account already has the domain; `existing_id` names it. |
557
+ | `domain_reserved` | 400 | The name is Sendora's own; no account can receive on it. |
558
+ | `tracking_domain_exists` | 409 | The account already has the host, or one on that sending domain; `existing_id` names it. |
559
+ | `tracking_domain_limit` | 409 | The account has as many tracking domains as it may. |
560
+ | `tracking_host_is_sending_domain` | 422 | The host is a sending domain itself; choose a subdomain. |
561
+ | `tracking_host_not_verified` | 422 | The host is not under a verified sending domain of the account. |
562
+ | `tracking_host_taken` | 409 | Another account holds the host. |
563
+ | `inbound_domain_exists` | 409 | The stream already has a domain (`existing_id` names it), or another account holds the name verified. |
564
+ | `webhook_exists` | 409 | The server already has a webhook for that URL; `existing_id` names it. |
565
+ | `stream_exists` | 409 | The server already has a stream with that name; `existing_id` names it. |
566
+ | `inbound_stream_exists` | 409 | The server already has a live inbound stream; `existing_id` names it. |
567
+ | `default_stream` | 409 | The default stream cannot be archived. |
568
+ | `last_token` | 409 | The only live key cannot be revoked. |
569
+ | `last_secret` | 409 | The only live secret of a webhook cannot be deleted. |
570
+ | `secret_limit` | 409 | The webhook already holds two live secrets; `max` says how many. |
571
+ | `token_limit` | 409 | The server or the account already holds two live keys; `max` says how many. |
572
+ | `server_exists` | 409 | The account already has a server with that name. |
573
+ | `server_limit` | 409 | The account has as many servers as it may; `max` says how many. |
574
+ | `server_reserved` | 409 | The server sends Sendora's own sign-in mail and cannot be renamed or removed. |
575
+ | `server_in_flight` | 409 | Messages of the server are still being delivered; delete it later. |
576
+ | `request_too_large` | 413 | The body exceeds 10 MB, or 64 MB for a broadcast. |
577
+ | `from_domain_not_verified` | 422 | The From domain is not a verified sending domain. |
578
+ | `stream_not_found` | 422 | `stream_id` names no stream of this server. |
579
+ | `stream_archived` | 422 | The stream is archived and takes no new messages. |
580
+ | `stream_paused` | 422 | Sendora paused the stream after complaints; support resumes it. |
581
+ | `stream_not_sendable` | 422 | An inbound stream receives mail; it takes no messages and has no list. |
582
+ | `stream_not_broadcast` | 422 | A broadcast goes on a broadcast stream; this one is transactional. |
583
+ | `substitution_missing` | 422 | The content names a `{{ key }}` a message does not give; `index` and `keys` say which. |
584
+ | `broadcast_not_open` | 409 | The broadcast is completed or cancelled; nothing is left to cancel. |
585
+ | `unsubscribe_placeholder_missing` | 422 | A broadcast message lacks `{{ unsubscribe_url }}` in a part. |
586
+ | `list_unsubscribe_reserved` | 422 | Sendora writes List-Unsubscribe on broadcast streams; leave it out. |
587
+ | `recipient_suppressed` | 422 | Recipients on the suppression list; `suppressed` lists them. |
588
+ | `test_address_on_live_server` | 422 | Addresses at simulator.sendora.se are for test servers; `addresses` lists them. |
589
+ | `stream_kind_not_allowed` | 422 | A test server has no inbound stream; receive on a live server. |
590
+ | `mode_immutable` | 400 | A server's mode is fixed at creation; create a new server for the other mode. |
591
+ | `idempotency_key_mismatch` | 422 | The key was used before with a different body. |
592
+ | `content_expired` | 410 | The received message's content window has passed; the message itself stays. |
593
+ | `content_unreadable` | 409 | The received message's stored content cannot be opened; Sendora has been told. |
594
+ | `rate_limited` | 429 | Per-minute limit; `retry_after`, `scope`, `limit`. From the edge, too many requests at once. |
595
+ | `daily_cap_reached` | 429 | The account's daily cap is used up; `scope`, `cap`, `used`, `resets_at`. |
596
+ | `monthly_cap_reached` | 429 | The monthly cap is used up; `scope`, `cap`, `used`, `resets_at`. |
597
+ | `sending_disabled` | 503 | Sending is paused for everyone; `retry_after`. |
598
+ | `connection_failed` | none | The request did not reach the API, or its answer was lost; `__cause__` says why. |
599
+ | `timeout` | none | A step of the request took longer than `timeout`. |
600
+ | `unexpected_response` | any | An answer without a JSON error body, such as from a proxy. |
601
+ | `invalid_signature` | none | A webhook's signature is missing, malformed or wrong. |
602
+ | `stale_signature` | none | A webhook's signature is older than the tolerance. |
601
603
 
602
604
  `error.retryable` is true when waiting and calling again could succeed.
603
605
  Neither the key nor a request's subject, text, HTML or attachments is ever
@@ -34,13 +34,15 @@ class SendoraError(Exception):
34
34
  message: A sentence for a person; also ``str(error)``.
35
35
  retry_after: Seconds to wait before trying again, when the API
36
36
  said so.
37
- scope: Whose limit or cap it is, on ``rate_limited`` and
38
- ``monthly_cap_reached``.
37
+ scope: Whose limit or cap it is, on ``rate_limited``,
38
+ ``daily_cap_reached`` and ``monthly_cap_reached``.
39
39
  limit: The emails a minute allowed, on ``rate_limited``.
40
- cap: The monthly cap, on ``monthly_cap_reached``.
41
- used: What was used of the cap, on ``monthly_cap_reached``.
42
- resets_at: When the month's count starts again, on
40
+ cap: The daily or the monthly cap, on ``daily_cap_reached`` and
41
+ ``monthly_cap_reached``.
42
+ used: What was used of the cap, on ``daily_cap_reached`` and
43
43
  ``monthly_cap_reached``.
44
+ resets_at: When the day's or the month's count starts again, on
45
+ ``daily_cap_reached`` and ``monthly_cap_reached``.
44
46
  max: How many keys, secrets or servers may exist, on
45
47
  ``token_limit``, ``secret_limit`` and ``server_limit``.
46
48
  issues: One entry per field, on ``invalid_request``.
@@ -194,7 +196,10 @@ class UnprocessableEntityError(APIStatusError):
194
196
 
195
197
 
196
198
  class RateLimitError(APIStatusError):
197
- """429: ``rate_limited``, retried within the budget, or ``monthly_cap_reached``."""
199
+ """429: ``rate_limited``, retried within the budget, or a used-up cap.
200
+
201
+ A used-up cap is ``daily_cap_reached`` or ``monthly_cap_reached``.
202
+ """
198
203
 
199
204
 
200
205
  class InternalServerError(APIStatusError):
@@ -1,3 +1,3 @@
1
1
  """The package's version: the build reads it, and every request names it."""
2
2
 
3
- __version__ = "2.6.2"
3
+ __version__ = "2.7.0"
@@ -241,6 +241,7 @@ SendoraErrorCode = Literal[
241
241
  "idempotency_key_mismatch",
242
242
  "idempotency_key_required",
243
243
  "rate_limited",
244
+ "daily_cap_reached",
244
245
  "monthly_cap_reached",
245
246
  "sending_disabled",
246
247
  "connection_failed",
@@ -437,13 +438,16 @@ class RefusedBatchItem(Answer):
437
438
  holds them.
438
439
  addresses: On ``test_address_on_live_server``, the simulator's
439
440
  addresses.
440
- scope: On ``rate_limited`` and ``monthly_cap_reached``, whose limit.
441
+ scope: On ``rate_limited``, ``daily_cap_reached`` and
442
+ ``monthly_cap_reached``, whose limit.
441
443
  limit: On ``rate_limited``, the messages allowed a minute.
442
444
  retry_after: On ``rate_limited``, the seconds to wait.
443
- cap: On ``monthly_cap_reached``, the messages allowed a month.
444
- used: On ``monthly_cap_reached``, the messages sent this month.
445
- resets_at: On ``monthly_cap_reached``, when the month ends and the
446
- count starts again.
445
+ cap: On ``daily_cap_reached`` and ``monthly_cap_reached``, the
446
+ messages allowed a day or a month.
447
+ used: On ``daily_cap_reached`` and ``monthly_cap_reached``, the
448
+ messages sent that day or month.
449
+ resets_at: On ``daily_cap_reached`` and ``monthly_cap_reached``,
450
+ when the day or the month ends and the count starts again.
447
451
  """
448
452
 
449
453
  index: int
@@ -1192,16 +1196,17 @@ class ServerLimit(Answer):
1192
1196
  Attributes:
1193
1197
  scope: Whose limit it is: the account's, the server's own, or the
1194
1198
  test cap the account's test servers share.
1195
- period: The UTC minute, or the month it counts over: from the day
1196
- and time of the first payment for a paying account's live
1197
- server, otherwise the calendar month in UTC.
1199
+ period: The span it counts over: the UTC minute, the calendar day
1200
+ in UTC, or the month. A paying account's live server counts
1201
+ its month from the day and time of the first payment, and any
1202
+ other server the calendar month in UTC.
1198
1203
  limit: The emails allowed in the period, one per recipient.
1199
1204
  used: The emails the period has taken so far.
1200
1205
  resets_at: When the period ends and the count starts again.
1201
1206
  """
1202
1207
 
1203
1208
  scope: LimitScope
1204
- period: Literal["minute", "month"]
1209
+ period: Literal["minute", "day", "month"]
1205
1210
  limit: int
1206
1211
  used: int
1207
1212
  resets_at: datetime
@@ -1246,11 +1251,13 @@ class OwnServer(Server):
1246
1251
  """The server a key belongs to, its limits and the domains it sends from.
1247
1252
 
1248
1253
  Attributes:
1249
- limits: On a live server the account's and the server's own, on a
1250
- test server the test cap, each with its use.
1254
+ limits: On a live server the account's, its daily cap among them
1255
+ if it has one, and the server's own; on a test server the
1256
+ test cap. Each comes with its use.
1251
1257
  inbound_cap: The account's monthly cap on received mail and its
1252
- use; None on a test server, which receives no mail. Past the
1253
- cap, mail to the account is refused for now, so senders retry.
1258
+ use; None on a test server, and for an account whose plan
1259
+ includes no received mail. Past the cap, mail to the account
1260
+ is refused for now, so senders retry.
1254
1261
  sending_domains: The account's sending domains a From address on
1255
1262
  this server may use now: every verified one, one in its
1256
1263
  24-hour warning with ``failing_since`` set. Sending domains
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes