Skip to content

Webhooks Pydantic Models

In order to simplify and standardize the data that is passed between the client and the Revolut Business API, PyRevolut uses Pydantic models to define the structure of the data. Below are the Pydantic models used by the Webhooks endpoint.


ResourceWebhook

Bases: BaseModel

Webhook resource model.

Source code in pyrevolut/api/webhooks/resources/webhook.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class ResourceWebhook(BaseModel):
    """
    Webhook resource model.
    """

    id: Annotated[UUID, Field(description="The ID of the webhook.")]
    url: Annotated[
        HttpUrl,
        Field(
            description="The valid webhook URL that event notifications are sent to. The supported protocol is https."
        ),
    ]
    events: Annotated[
        list[EnumWebhookEvent],
        Field(description="The list of events that the webhook is subscribed to."),
    ]

ResourcePayoutLinkCreated

Bases: BaseModel

Payout Link Created resource model.

Source code in pyrevolut/api/webhooks/resources/payout_link_created.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class ResourcePayoutLinkCreated(BaseModel):
    """
    Payout Link Created resource model.
    """

    id: Annotated[
        UUID,
        Field(description="The ID of the payout link."),
    ]
    state: Annotated[
        EnumPayoutLinkState,
        Field(description="The state of the payout link."),
    ]
    request_id: Annotated[
        str | None,
        Field(description="The request ID provided by the client."),
    ] = None

ResourcePayoutLinkStateChanged

Bases: BaseModel

Payout Link State Changed resource model.

Source code in pyrevolut/api/webhooks/resources/payout_link_state_changed.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class ResourcePayoutLinkStateChanged(BaseModel):
    """
    Payout Link State Changed resource model.
    """

    id: Annotated[
        UUID,
        Field(description="The ID of the payout link."),
    ]
    request_id: Annotated[
        str | None,
        Field(description="The request ID provided by the client."),
    ] = None
    old_state: Annotated[
        EnumPayoutLinkState,
        Field(description="The previous state of the payout link."),
    ]
    new_state: Annotated[
        EnumPayoutLinkState,
        Field(description="The new state of the payout link."),
    ]

ResourceTransactionCreated

Bases: BaseModel

Transaction Created resource model.

Source code in pyrevolut/api/webhooks/resources/transaction_created.py
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
class ResourceTransactionCreated(BaseModel):
    """
    Transaction Created resource model.
    """

    class ModelLeg(BaseModel):
        """
        The legs of the transaction:

            - For transactions between your Revolut accounts,
            there can be 2 legs, for example, an internal transfer made out of
            the GBP account and into the EUR account.

            - For transactions in other cases, there is only 1 leg.
        """

        class ModelCounterparty(BaseModel):
            """The counterparty of the transaction."""

            account_id: Annotated[
                UUID | None,
                Field(description="The ID of the counterparty account."),
            ] = None
            account_type: Annotated[
                EnumAccountType,
                Field(description="Indicates the type of the account."),
            ]
            id: Annotated[
                UUID | None,
                Field(description="The ID of the counterparty."),
            ] = None

        leg_id: Annotated[UUID, Field(description="The ID of the leg.")]
        account_id: Annotated[
            UUID,
            Field(
                description="The ID of the account that the transaction leg is associated with."
            ),
        ]
        counterparty: Annotated[
            ModelCounterparty | None,
            Field(description="The counterparty of the transaction leg."),
        ] = None
        amount: Annotated[
            float,
            Field(description="The amount of the transaction leg."),
        ]
        fee: Annotated[
            float | None,
            Field(description="The amount of the transaction leg fee."),
        ] = None
        currency: Annotated[
            Currency,
            Field(description="ISO 4217 currency code in upper case."),
        ]
        bill_amount: Annotated[
            float | None,
            Field(description="The billing amount for cross-currency payments."),
        ] = None
        bill_currency: Annotated[
            Currency | None,
            Field(description="The billing currency for cross-currency payments."),
        ] = None
        description: Annotated[
            str | None,
            Field(description="The transaction leg purpose."),
        ] = None
        balance: Annotated[
            float | None,
            Field(
                description="The total balance of the account that the transaction is associated with."
            ),
        ] = None

    id: Annotated[UUID, Field(description="The ID of the transaction.")]
    type: Annotated[
        EnumTransactionType, Field(description="Indicates the transaction type.")
    ]
    state: Annotated[
        EnumTransactionState, Field(description="Indicates the transaction state.")
    ]
    request_id: Annotated[
        str | None,
        Field(
            description="The request ID that you provided previously.",
        ),
    ] = None
    reason_code: Annotated[
        str | None,
        Field(
            description="The reason code when the transaction state is declined or failed."
        ),
    ] = None
    created_at: Annotated[
        DateTime,
        Field(
            description="The date and time the transaction was created in ISO 8601 format."
        ),
    ]
    updated_at: Annotated[
        DateTime,
        Field(
            description="The date and time the transaction was last updated in ISO 8601 format."
        ),
    ]
    completed_at: Annotated[
        DateTime | None,
        Field(
            description="""
            The date and time the transaction was completed in ISO 8601 format. 
            This is required when the transaction state is completed.
            """
        ),
    ] = None
    scheduled_for: Annotated[
        Date | None,
        Field(
            description="""
            The scheduled date of the payment, if applicable. Provided in ISO 8601 format.
            """
        ),
    ] = None
    reference: Annotated[
        str | None,
        Field(description="The reference of the transaction."),
    ] = None
    related_transaction_id: Annotated[
        UUID | None,
        Field(description="The ID of the original transaction that has been refunded."),
    ] = None
    legs: Annotated[
        list[ModelLeg],
        Field(
            description="The legs of a transaction. There are 2 legs between your Revolut accounts and 1 leg in other cases."
        ),
    ]

ModelLeg

Bases: BaseModel

The legs of the transaction:

- For transactions between your Revolut accounts,
there can be 2 legs, for example, an internal transfer made out of
the GBP account and into the EUR account.

- For transactions in other cases, there is only 1 leg.
Source code in pyrevolut/api/webhooks/resources/transaction_created.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
class ModelLeg(BaseModel):
    """
    The legs of the transaction:

        - For transactions between your Revolut accounts,
        there can be 2 legs, for example, an internal transfer made out of
        the GBP account and into the EUR account.

        - For transactions in other cases, there is only 1 leg.
    """

    class ModelCounterparty(BaseModel):
        """The counterparty of the transaction."""

        account_id: Annotated[
            UUID | None,
            Field(description="The ID of the counterparty account."),
        ] = None
        account_type: Annotated[
            EnumAccountType,
            Field(description="Indicates the type of the account."),
        ]
        id: Annotated[
            UUID | None,
            Field(description="The ID of the counterparty."),
        ] = None

    leg_id: Annotated[UUID, Field(description="The ID of the leg.")]
    account_id: Annotated[
        UUID,
        Field(
            description="The ID of the account that the transaction leg is associated with."
        ),
    ]
    counterparty: Annotated[
        ModelCounterparty | None,
        Field(description="The counterparty of the transaction leg."),
    ] = None
    amount: Annotated[
        float,
        Field(description="The amount of the transaction leg."),
    ]
    fee: Annotated[
        float | None,
        Field(description="The amount of the transaction leg fee."),
    ] = None
    currency: Annotated[
        Currency,
        Field(description="ISO 4217 currency code in upper case."),
    ]
    bill_amount: Annotated[
        float | None,
        Field(description="The billing amount for cross-currency payments."),
    ] = None
    bill_currency: Annotated[
        Currency | None,
        Field(description="The billing currency for cross-currency payments."),
    ] = None
    description: Annotated[
        str | None,
        Field(description="The transaction leg purpose."),
    ] = None
    balance: Annotated[
        float | None,
        Field(
            description="The total balance of the account that the transaction is associated with."
        ),
    ] = None

ModelCounterparty

Bases: BaseModel

The counterparty of the transaction.

Source code in pyrevolut/api/webhooks/resources/transaction_created.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class ModelCounterparty(BaseModel):
    """The counterparty of the transaction."""

    account_id: Annotated[
        UUID | None,
        Field(description="The ID of the counterparty account."),
    ] = None
    account_type: Annotated[
        EnumAccountType,
        Field(description="Indicates the type of the account."),
    ]
    id: Annotated[
        UUID | None,
        Field(description="The ID of the counterparty."),
    ] = None

ResourceTransactionStateChanged

Bases: BaseModel

Transaction state changed resource model.

Source code in pyrevolut/api/webhooks/resources/transaction_state_changed.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class ResourceTransactionStateChanged(BaseModel):
    """
    Transaction state changed resource model.
    """

    id: Annotated[
        UUID,
        Field(description="The ID of the transaction."),
    ]
    request_id: Annotated[
        str | None,
        Field(description="The request ID provided by the client."),
    ] = None
    old_state: Annotated[
        EnumTransactionState,
        Field(description="The old state of the transaction."),
    ]
    new_state: Annotated[
        EnumTransactionState,
        Field(description="The new state of the transaction."),
    ]

ResourceWebhookPayload

Bases: BaseModel

Webhook payload resource model.

Source code in pyrevolut/api/webhooks/resources/webhook_payload.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class ResourceWebhookPayload(BaseModel):
    """
    Webhook payload resource model.
    """

    event: Annotated[
        EnumWebhookEvent,
        Field(description="The event type."),
    ]
    timestamp: Annotated[
        DateTime,
        Field(description="The event time."),
    ]
    data: Annotated[
        ResourcePayoutLinkCreated
        | ResourcePayoutLinkStateChanged
        | ResourceTransactionCreated
        | ResourceTransactionStateChanged,
        Field(description="The event data."),
    ]

RetrieveListOfWebhooks

Get the list of all your existing webhooks and their details.

Source code in pyrevolut/api/webhooks/get/retrieve_list_of_webhooks.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class RetrieveListOfWebhooks:
    """
    Get the list of all your existing webhooks and their details.
    """

    ROUTE = "/2.0/webhooks"

    class Params(BaseModel):
        """
        The query parameters for the request.
        """

        pass

    class Response(ResourceWebhook):
        """
        The response model for the request.
        """

        pass

Params

Bases: BaseModel

The query parameters for the request.

Source code in pyrevolut/api/webhooks/get/retrieve_list_of_webhooks.py
13
14
15
16
17
18
class Params(BaseModel):
    """
    The query parameters for the request.
    """

    pass

Response

Bases: ResourceWebhook

The response model for the request.

Source code in pyrevolut/api/webhooks/get/retrieve_list_of_webhooks.py
20
21
22
23
24
25
class Response(ResourceWebhook):
    """
    The response model for the request.
    """

    pass

RetrieveWebhook

Get the information about a specific webhook by ID.

Source code in pyrevolut/api/webhooks/get/retrieve_webhook.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class RetrieveWebhook:
    """
    Get the information about a specific webhook by ID.
    """

    ROUTE = "/2.0/webhooks/{webhook_id}"

    class Params(BaseModel):
        """
        The query parameters for the request.
        """

        pass

    class Response(ResourceWebhook):
        """
        The response model for the request.
        """

        signing_secret: Annotated[
            str,
            Field(
                description="""
                The signing secret for the webhook.
                """,
            ),
        ]

Params

Bases: BaseModel

The query parameters for the request.

Source code in pyrevolut/api/webhooks/get/retrieve_webhook.py
15
16
17
18
19
20
class Params(BaseModel):
    """
    The query parameters for the request.
    """

    pass

Response

Bases: ResourceWebhook

The response model for the request.

Source code in pyrevolut/api/webhooks/get/retrieve_webhook.py
22
23
24
25
26
27
28
29
30
31
32
33
34
class Response(ResourceWebhook):
    """
    The response model for the request.
    """

    signing_secret: Annotated[
        str,
        Field(
            description="""
            The signing secret for the webhook.
            """,
        ),
    ]

RetrieveListOfFailedWebhooks

Get the list of all your failed webhook events, or use the query parameters to filter the results.

The events are sorted by the created_at date in reverse chronological order.

The returned failed events are paginated. The maximum number of events returned per page is specified by the limit parameter. To get to the next page, make a new request and use the created_at date of the last event returned in the previous response.

Source code in pyrevolut/api/webhooks/get/retrieve_list_of_failed_webhooks.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
class RetrieveListOfFailedWebhooks:
    """
    Get the list of all your failed webhook events, or use the query
    parameters to filter the results.

    The events are sorted by the created_at date in reverse chronological order.

    The returned failed events are paginated. The maximum number of events returned
    per page is specified by the limit parameter.
    To get to the next page, make a new request and use the created_at date of the
    last event returned in the previous response.
    """

    ROUTE = "/2.0/webhooks/{webhook_id}/failed-events"

    class Params(BaseModel):
        """
        The query parameters for the request.
        """

        limit: Annotated[
            int | None,
            Field(
                description="""
                The maximum number of events returned per page.

                To get to the next page, make a new request and use the created_at date of 
                the last event returned in the previous response as value for created_before.

                If not specified, the default value is 100.
                """,
                ge=1,
                le=1000,
            ),
        ] = None
        created_before: Annotated[
            DateTime | None,
            Field(
                description="""
                Retrieves events with created_at < created_before. 
                Cannot be older than the current date minus 21 days. 
                The default value is the current date and time at which you are calling the endpoint.

                Provided in ISO 8601 format.
                """,
            ),
        ] = None

    class Response(BaseModel):
        """
        The response model for the request.
        """

        id: Annotated[UUID, Field(description="The ID of the webhook event.")]
        created_at: Annotated[
            DateTime,
            Field(
                description="The date and time the event was created in ISO 8601 format.",
            ),
        ]
        updated_at: Annotated[
            DateTime,
            Field(
                description="The date and time the event was last updated in ISO 8601 format.",
            ),
        ]
        webhook_id: Annotated[
            UUID,
            Field(description="The ID of the webhook for which the event failed."),
        ]
        webhook_url: Annotated[
            HttpUrl,
            Field(
                description="The valid webhook URL that event notifications are sent to. The supported protocol is https",
            ),
        ]
        payload: Annotated[
            ResourceWebhookPayload,
            Field(description="The details of the failed event."),
        ]
        last_sent_date: Annotated[
            DateTime,
            Field(
                description="The date and time the last attempt at the event delivery occurred in ISO 8601 format.",
            ),
        ]

Params

Bases: BaseModel

The query parameters for the request.

Source code in pyrevolut/api/webhooks/get/retrieve_list_of_failed_webhooks.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class Params(BaseModel):
    """
    The query parameters for the request.
    """

    limit: Annotated[
        int | None,
        Field(
            description="""
            The maximum number of events returned per page.

            To get to the next page, make a new request and use the created_at date of 
            the last event returned in the previous response as value for created_before.

            If not specified, the default value is 100.
            """,
            ge=1,
            le=1000,
        ),
    ] = None
    created_before: Annotated[
        DateTime | None,
        Field(
            description="""
            Retrieves events with created_at < created_before. 
            Cannot be older than the current date minus 21 days. 
            The default value is the current date and time at which you are calling the endpoint.

            Provided in ISO 8601 format.
            """,
        ),
    ] = None

Response

Bases: BaseModel

The response model for the request.

Source code in pyrevolut/api/webhooks/get/retrieve_list_of_failed_webhooks.py
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
class Response(BaseModel):
    """
    The response model for the request.
    """

    id: Annotated[UUID, Field(description="The ID of the webhook event.")]
    created_at: Annotated[
        DateTime,
        Field(
            description="The date and time the event was created in ISO 8601 format.",
        ),
    ]
    updated_at: Annotated[
        DateTime,
        Field(
            description="The date and time the event was last updated in ISO 8601 format.",
        ),
    ]
    webhook_id: Annotated[
        UUID,
        Field(description="The ID of the webhook for which the event failed."),
    ]
    webhook_url: Annotated[
        HttpUrl,
        Field(
            description="The valid webhook URL that event notifications are sent to. The supported protocol is https",
        ),
    ]
    payload: Annotated[
        ResourceWebhookPayload,
        Field(description="The details of the failed event."),
    ]
    last_sent_date: Annotated[
        DateTime,
        Field(
            description="The date and time the last attempt at the event delivery occurred in ISO 8601 format.",
        ),
    ]

CreateWebhook

Create a new webhook to receive event notifications to the specified URL. Provide a list of event types that you want to subscribe to and a URL for the webhook. Only HTTPS URLs are supported.

Source code in pyrevolut/api/webhooks/post/create_webhook.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class CreateWebhook:
    """
    Create a new webhook to receive event notifications to the specified URL.
    Provide a list of event types that you want to subscribe to and a URL for the webhook.
    Only HTTPS URLs are supported.
    """

    ROUTE = "/2.0/webhooks"

    class Body(BaseModel):
        """
        The body of the request.
        """

        url: Annotated[
            HttpUrl,
            Field(
                description="""
                A valid webhook URL to which to send event notifications. 
                The supported protocol is https.
                """,
            ),
        ]
        events: Annotated[
            list[EnumWebhookEvent] | None,
            Field(
                description="""
                A list of event types to subscribe to. 
                If you don't provide it, you're automatically subscribed to the default event types:
                - TransactionCreated
                - TransactionStateChanged
                """,
            ),
        ] = None

    class Response(ResourceWebhook):
        """
        The response model for the request.
        """

        signing_secret: Annotated[
            str,
            Field(
                description="""
                The signing secret for the webhook.
                """,
            ),
        ]

Body

Bases: BaseModel

The body of the request.

Source code in pyrevolut/api/webhooks/post/create_webhook.py
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class Body(BaseModel):
    """
    The body of the request.
    """

    url: Annotated[
        HttpUrl,
        Field(
            description="""
            A valid webhook URL to which to send event notifications. 
            The supported protocol is https.
            """,
        ),
    ]
    events: Annotated[
        list[EnumWebhookEvent] | None,
        Field(
            description="""
            A list of event types to subscribe to. 
            If you don't provide it, you're automatically subscribed to the default event types:
            - TransactionCreated
            - TransactionStateChanged
            """,
        ),
    ] = None

Response

Bases: ResourceWebhook

The response model for the request.

Source code in pyrevolut/api/webhooks/post/create_webhook.py
44
45
46
47
48
49
50
51
52
53
54
55
56
class Response(ResourceWebhook):
    """
    The response model for the request.
    """

    signing_secret: Annotated[
        str,
        Field(
            description="""
            The signing secret for the webhook.
            """,
        ),
    ]

RotateWebhookSecret

Rotate a signing secret for a specific webhook.

Source code in pyrevolut/api/webhooks/post/rotate_webhook_secret.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class RotateWebhookSecret:
    """
    Rotate a signing secret for a specific webhook.
    """

    ROUTE = "/2.0/webhooks/{webhook_id}/rotate-signing-secret"

    class Body(BaseModel):
        """
        The body of the request.
        """

        expiration_period: Annotated[
            Duration | None,
            Field(
                description="""
                The expiration period for the signing secret in ISO 8601 format. 
                If set, when you rotate the secret, it continues to be valid until the 
                expiration period has passed. Otherwise, on rotation, the secret is 
                invalidated immediately. 
                The maximum value is 7 days.
                """,
            ),
        ] = None

    class Response(ResourceWebhook):
        """
        The response model for the request.
        """

        signing_secret: Annotated[
            str,
            Field(
                description="""
                The signing secret for the webhook.
                """,
            ),
        ]

Body

Bases: BaseModel

The body of the request.

Source code in pyrevolut/api/webhooks/post/rotate_webhook_secret.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class Body(BaseModel):
    """
    The body of the request.
    """

    expiration_period: Annotated[
        Duration | None,
        Field(
            description="""
            The expiration period for the signing secret in ISO 8601 format. 
            If set, when you rotate the secret, it continues to be valid until the 
            expiration period has passed. Otherwise, on rotation, the secret is 
            invalidated immediately. 
            The maximum value is 7 days.
            """,
        ),
    ] = None

Response

Bases: ResourceWebhook

The response model for the request.

Source code in pyrevolut/api/webhooks/post/rotate_webhook_secret.py
34
35
36
37
38
39
40
41
42
43
44
45
46
class Response(ResourceWebhook):
    """
    The response model for the request.
    """

    signing_secret: Annotated[
        str,
        Field(
            description="""
            The signing secret for the webhook.
            """,
        ),
    ]

UpdateWebhook

Update an existing webhook. Change the URL to which event notifications are sent or the list of event types to be notified about.

You must specify at least one of these two. The fields that you don't specify are not updated.

Source code in pyrevolut/api/webhooks/patch/update_webhook.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
class UpdateWebhook:
    """
    Update an existing webhook. Change the URL to which event notifications are
    sent or the list of event types to be notified about.

    You must specify at least one of these two.
    The fields that you don't specify are not updated.
    """

    ROUTE = "/2.0/webhooks/{webhook_id}"

    class Body(BaseModel):
        """
        The body of the request.
        """

        url: Annotated[
            HttpUrl | None,
            Field(
                description="""
                A valid webhook URL to which to send event notifications. 
                The supported protocol is https.
                """,
            ),
        ] = None
        events: Annotated[
            list[EnumWebhookEvent] | None,
            Field(
                description="""
                A list of event types to subscribe to. 
                """,
            ),
        ] = None

    class Response(ResourceWebhook):
        """
        The response model for the request.
        """

        pass

Body

Bases: BaseModel

The body of the request.

Source code in pyrevolut/api/webhooks/patch/update_webhook.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class Body(BaseModel):
    """
    The body of the request.
    """

    url: Annotated[
        HttpUrl | None,
        Field(
            description="""
            A valid webhook URL to which to send event notifications. 
            The supported protocol is https.
            """,
        ),
    ] = None
    events: Annotated[
        list[EnumWebhookEvent] | None,
        Field(
            description="""
            A list of event types to subscribe to. 
            """,
        ),
    ] = None

Response

Bases: ResourceWebhook

The response model for the request.

Source code in pyrevolut/api/webhooks/patch/update_webhook.py
43
44
45
46
47
48
class Response(ResourceWebhook):
    """
    The response model for the request.
    """

    pass

DeleteWebhook

Delete a specific webhook.

A successful response does not get any content in return.

Source code in pyrevolut/api/webhooks/delete/delete_webhook.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class DeleteWebhook:
    """
    Delete a specific webhook.

    A successful response does not get any content in return.
    """

    ROUTE = "/2.0/webhooks/{webhook_id}"

    class Params(BaseModel):
        """
        The query params of the request.
        """

        pass

    class Response(BaseModel):
        """
        The response model for the request.
        """

        pass

Params

Bases: BaseModel

The query params of the request.

Source code in pyrevolut/api/webhooks/delete/delete_webhook.py
13
14
15
16
17
18
class Params(BaseModel):
    """
    The query params of the request.
    """

    pass

Response

Bases: BaseModel

The response model for the request.

Source code in pyrevolut/api/webhooks/delete/delete_webhook.py
20
21
22
23
24
25
class Response(BaseModel):
    """
    The response model for the request.
    """

    pass