Skip to content

Team Members 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 Team Members endpoint.


RetrieveListOfTeamMembers

Get information about all the team members of your business.

The results are paginated and sorted by the created_at date in reverse chronological order.

Note

This feature is available in the UK, US and the EEA.

This feature is not available in Sandbox.

Source code in pyrevolut/api/team_members/get/retrieve_list_of_team_members.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
class RetrieveListOfTeamMembers:
    """
    Get information about all the team members of your business.

    The results are paginated and sorted by the created_at date in reverse chronological order.

    Note
    ----
    This feature is available in the UK, US and the EEA.

    This feature is not available in Sandbox.
    """

    ROUTE = "/1.0/team-members"

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

        created_before: Annotated[
            DateTime | None,
            Field(
                description="""
                Retrieves team members with created_at < created_before. 
                The default value is the current date and time at which you are calling the endpoint.
                Provided in ISO 8601 format.
                """
            ),
        ] = None
        limit: Annotated[
            int | None,
            Field(
                description="""
                The maximum number of team members returned per page.
                To get to the next page, make a new request and use the 
                created_at date of the last team member returned in the previous 
                response as the value for created_before.              

                If not provided, the default value is 100.  
                """,
                ge=1,
                le=100,
            ),
        ] = None

    class Response(BaseModel):
        """The response model."""

        id: Annotated[UUID, Field(description="The ID of the team member.")]
        email: Annotated[
            EmailStr, Field(description="The email address of the team member.")
        ]
        first_name: Annotated[
            str | None, Field(description="The team member's first name.")
        ] = None
        last_name: Annotated[
            str | None, Field(description="The team member's last name.")
        ] = None
        state: Annotated[
            EnumTeamMemberState,
            Field(description="The state that the team member is in."),
        ]
        role_id: Annotated[
            UUID | str,
            Field(
                description="The ID of the team member's role. This can be a UUID or other default role such as Owner."
            ),
        ]
        created_at: Annotated[
            DateTime,
            Field(
                description="The date and time the team member was created in ISO 8601 format."
            ),
        ]
        updated_at: Annotated[
            DateTime,
            Field(
                description="The date and time the team member was last updated in ISO 8601 format."
            ),
        ]

Params

Bases: BaseModel

The parameters of the request.

Source code in pyrevolut/api/team_members/get/retrieve_list_of_team_members.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
class Params(BaseModel):
    """The parameters of the request."""

    created_before: Annotated[
        DateTime | None,
        Field(
            description="""
            Retrieves team members with created_at < created_before. 
            The default value is the current date and time at which you are calling the endpoint.
            Provided in ISO 8601 format.
            """
        ),
    ] = None
    limit: Annotated[
        int | None,
        Field(
            description="""
            The maximum number of team members returned per page.
            To get to the next page, make a new request and use the 
            created_at date of the last team member returned in the previous 
            response as the value for created_before.              

            If not provided, the default value is 100.  
            """,
            ge=1,
            le=100,
        ),
    ] = None

Response

Bases: BaseModel

The response model.

Source code in pyrevolut/api/team_members/get/retrieve_list_of_team_members.py
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
class Response(BaseModel):
    """The response model."""

    id: Annotated[UUID, Field(description="The ID of the team member.")]
    email: Annotated[
        EmailStr, Field(description="The email address of the team member.")
    ]
    first_name: Annotated[
        str | None, Field(description="The team member's first name.")
    ] = None
    last_name: Annotated[
        str | None, Field(description="The team member's last name.")
    ] = None
    state: Annotated[
        EnumTeamMemberState,
        Field(description="The state that the team member is in."),
    ]
    role_id: Annotated[
        UUID | str,
        Field(
            description="The ID of the team member's role. This can be a UUID or other default role such as Owner."
        ),
    ]
    created_at: Annotated[
        DateTime,
        Field(
            description="The date and time the team member was created in ISO 8601 format."
        ),
    ]
    updated_at: Annotated[
        DateTime,
        Field(
            description="The date and time the team member was last updated in ISO 8601 format."
        ),
    ]

RetrieveTeamRoles

Get the list of roles for your business.

The results are paginated and sorted by the created_at date in reverse chronological order.

This feature is available in the UK, US and the EEA.

This feature is not available in Sandbox.

Source code in pyrevolut/api/team_members/get/retrieve_team_roles.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
class RetrieveTeamRoles:
    """
    Get the list of roles for your business.

    The results are paginated and sorted by the created_at date in reverse chronological order.

    This feature is available in the UK, US and the EEA.

    This feature is not available in Sandbox.
    """

    ROUTE = "/1.0/roles"

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

        created_before: Annotated[
            DateTime | None,
            Field(
                description="""
                Retrieves roles with created_at < created_before. 
                The default value is the current date and time at which you are calling the endpoint.
                Provided in ISO 8601 format.
                """
            ),
        ] = None
        limit: Annotated[
            int | None,
            Field(
                description="""
                The maximum number of roles returned per page.
                To get to the next page, make a new request and use the 
                created_at date of the last role returned in the previous 
                response as the value for created_before.              

                If not provided, the default value is 100.  
                """,
                ge=1,
                le=100,
            ),
        ] = None

    class Response(BaseModel):
        """
        The response model.
        """

        id: Annotated[
            UUID | str,
            Field(
                description="The ID of the role. This can be a UUID or other default role such as OWNER."
            ),
        ]
        name: Annotated[str, Field(description="The name of the role.")]
        created_at: Annotated[
            DateTime,
            Field(
                description="The date and time the role was created in ISO 8601 format."
            ),
        ]
        updated_at: Annotated[
            DateTime,
            Field(
                description="The date and time the role was last updated in ISO 8601 format."
            ),
        ]

Params

Bases: BaseModel

The query parameters of the request.

Source code in pyrevolut/api/team_members/get/retrieve_team_roles.py
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
class Params(BaseModel):
    """
    The query parameters of the request.
    """

    created_before: Annotated[
        DateTime | None,
        Field(
            description="""
            Retrieves roles with created_at < created_before. 
            The default value is the current date and time at which you are calling the endpoint.
            Provided in ISO 8601 format.
            """
        ),
    ] = None
    limit: Annotated[
        int | None,
        Field(
            description="""
            The maximum number of roles returned per page.
            To get to the next page, make a new request and use the 
            created_at date of the last role returned in the previous 
            response as the value for created_before.              

            If not provided, the default value is 100.  
            """,
            ge=1,
            le=100,
        ),
    ] = None

Response

Bases: BaseModel

The response model.

Source code in pyrevolut/api/team_members/get/retrieve_team_roles.py
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
class Response(BaseModel):
    """
    The response model.
    """

    id: Annotated[
        UUID | str,
        Field(
            description="The ID of the role. This can be a UUID or other default role such as OWNER."
        ),
    ]
    name: Annotated[str, Field(description="The name of the role.")]
    created_at: Annotated[
        DateTime,
        Field(
            description="The date and time the role was created in ISO 8601 format."
        ),
    ]
    updated_at: Annotated[
        DateTime,
        Field(
            description="The date and time the role was last updated in ISO 8601 format."
        ),
    ]

InviteTeamMember

Invite a new member to your business account.

When you invite a new team member to your business account, an invitation is sent to their email address that you provided in this request. To join your business account, the new team member has to accept this invitation.

Note

This feature is available in the UK, US and the EEA.

This feature is not available in Sandbox.

Source code in pyrevolut/api/team_members/post/invite_team_member.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
57
class InviteTeamMember:
    """
    Invite a new member to your business account.

    When you invite a new team member to your business account,
    an invitation is sent to their email address that you provided in this request.
    To join your business account, the new team member has to accept this invitation.

    Note
    ----
    This feature is available in the UK, US and the EEA.

    This feature is not available in Sandbox.
    """

    ROUTE = "/1.0/team-members"

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

        email: Annotated[
            EmailStr, Field(description="The email address of the invited member.")
        ]
        role_id: Annotated[
            UUID | str,
            Field(description="The ID of the role to assign to the new member."),
        ]

    class Response(BaseModel):
        """The response model."""

        email: Annotated[
            EmailStr, Field(description="The email address of the invited member.")
        ]
        id: Annotated[UUID, Field(description="The ID of the invited member.")]
        role_id: Annotated[
            UUID | str,
            Field(description="The ID of the role assigned to the member."),
        ]
        created_at: Annotated[
            DateTime,
            Field(description="The date and time when the member was created."),
        ]
        updated_at: Annotated[
            DateTime,
            Field(description="The date and time when the member was last updated."),
        ]

Body

Bases: BaseModel

The body of the request.

Source code in pyrevolut/api/team_members/post/invite_team_member.py
26
27
28
29
30
31
32
33
34
35
36
37
class Body(BaseModel):
    """
    The body of the request.
    """

    email: Annotated[
        EmailStr, Field(description="The email address of the invited member.")
    ]
    role_id: Annotated[
        UUID | str,
        Field(description="The ID of the role to assign to the new member."),
    ]

Response

Bases: BaseModel

The response model.

Source code in pyrevolut/api/team_members/post/invite_team_member.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class Response(BaseModel):
    """The response model."""

    email: Annotated[
        EmailStr, Field(description="The email address of the invited member.")
    ]
    id: Annotated[UUID, Field(description="The ID of the invited member.")]
    role_id: Annotated[
        UUID | str,
        Field(description="The ID of the role assigned to the member."),
    ]
    created_at: Annotated[
        DateTime,
        Field(description="The date and time when the member was created."),
    ]
    updated_at: Annotated[
        DateTime,
        Field(description="The date and time when the member was last updated."),
    ]