(integrations)
With the help of the Integration Store, you can easily integrate your favorite delivery provider. During the runtime of the API, the Integrations Store is responsible for storing the configurations of all the providers. https://docs.novu.co/channels-and-providers/integration-store
- list - Get integrations
- create - Create integration
- list_active - Get active integrations
- update - Update integration
- delete - Delete integration
- set_as_primary - Set integration as primary
Return all the integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change
from novu_py import Novu
import os
with Novu(
api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:
res = novu.integrations.list()
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.IntegrationsControllerListIntegrationsResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorDto | 400, 404, 409 | application/json |
models.ValidationErrorDto | 422 | application/json |
models.APIError | 4XX, 5XX | */* |
Create an integration for the current environment the user is based on the API key provided
import novu_py
from novu_py import Novu
import os
with Novu(
api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:
res = novu.integrations.create(request={
"provider_id": "<id>",
"channel": novu_py.CreateIntegrationRequestDtoChannel.SMS,
})
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.CreateIntegrationRequestDto | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.IntegrationsControllerCreateIntegrationResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorDto | 400, 404, 409 | application/json |
models.ValidationErrorDto | 422 | application/json |
models.APIError | 4XX, 5XX | */* |
Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change
from novu_py import Novu
import os
with Novu(
api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:
res = novu.integrations.list_active()
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.IntegrationsControllerGetActiveIntegrationsResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorDto | 400, 404, 409 | application/json |
models.ValidationErrorDto | 422 | application/json |
models.APIError | 4XX, 5XX | */* |
Update integration
from novu_py import Novu
import os
with Novu(
api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:
res = novu.integrations.update(integration_id="<id>", update_integration_request_dto={})
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
integration_id |
str | ✔️ | N/A |
update_integration_request_dto |
models.UpdateIntegrationRequestDto | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.IntegrationsControllerUpdateIntegrationByIDResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorDto | 400, 409 | application/json |
models.ValidationErrorDto | 422 | application/json |
models.APIError | 4XX, 5XX | */* |
Delete integration
from novu_py import Novu
import os
with Novu(
api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:
res = novu.integrations.delete(integration_id="<id>")
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
integration_id |
str | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.IntegrationsControllerRemoveIntegrationResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorDto | 400, 404, 409 | application/json |
models.ValidationErrorDto | 422 | application/json |
models.APIError | 4XX, 5XX | */* |
Set integration as primary
from novu_py import Novu
import os
with Novu(
api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:
res = novu.integrations.set_as_primary(integration_id="<id>")
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
integration_id |
str | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.IntegrationsControllerSetIntegrationAsPrimaryResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorDto | 400, 409 | application/json |
models.ValidationErrorDto | 422 | application/json |
models.APIError | 4XX, 5XX | */* |