(messages)
A message in Novu represents a notification delivered to a recipient on a particular channel. Messages contain information about the request that triggered its delivery, a view of the data sent to the recipient, and a timeline of its lifecycle events. Learn more about messages. https://docs.novu.co/workflows/messages
- retrieve - Get messages
- delete - Delete message
- delete_by_transaction_id - Delete messages by transactionId
Returns a list of messages, could paginate using the page
query parameter
from novu_py import Novu
import os
with Novu(
api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:
res = novu.messages.retrieve()
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.MessagesControllerGetMessagesRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.MessagesControllerGetMessagesResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorDto | 400, 404, 409 | application/json |
models.ValidationErrorDto | 422 | application/json |
models.APIError | 4XX, 5XX | */* |
Deletes a message entity from the Novu platform
from novu_py import Novu
import os
with Novu(
api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:
res = novu.messages.delete(message_id="<id>")
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
message_id |
str | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.MessagesControllerDeleteMessageResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorDto | 400, 404, 409 | application/json |
models.ValidationErrorDto | 422 | application/json |
models.APIError | 4XX, 5XX | */* |
Deletes messages entity from the Novu platform using TransactionId of message
from novu_py import Novu
import os
with Novu(
api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:
res = novu.messages.delete_by_transaction_id(transaction_id="<id>")
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
transaction_id |
str | ✔️ | N/A |
channel |
Optional[models.QueryParamChannel] | ➖ | The channel of the message to be deleted |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.MessagesControllerDeleteMessagesByTransactionIDResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorDto | 400, 404, 409 | application/json |
models.ValidationErrorDto | 422 | application/json |
models.APIError | 4XX, 5XX | */* |