|
86 | 86 | - [Get an AI Integration](#get-an-ai-integration) |
87 | 87 | - [Update an AI Integration](#update-an-ai-integration) |
88 | 88 | - [Delete an AI Integration](#delete-an-ai-integration) |
| 89 | + - [Operations on Organizations](#operations-on-organizations) |
| 90 | + - [List Organizations](#list-organizations) |
| 91 | + - [Get an Organization](#get-an-organization) |
| 92 | + - [Create an Organization](#create-an-organization) |
| 93 | + - [Update an Organization](#update-an-organization) |
| 94 | + - [Delete an Organization](#delete-an-organization) |
| 95 | + - [Add a User to an Organization](#add-a-user-to-an-organization) |
| 96 | + - [Remove a User from an Organization](#remove-a-user-from-an-organization) |
| 97 | + - [Operations on Spaces](#operations-on-spaces) |
| 98 | + - [Add a User to a Space](#add-a-user-to-a-space) |
| 99 | + - [Remove a User from a Space](#remove-a-user-from-a-space) |
| 100 | + - [Operations on Users](#operations-on-users) |
| 101 | + - [List Users](#list-users) |
| 102 | + - [Get a User](#get-a-user) |
| 103 | + - [Create a User](#create-a-user) |
| 104 | + - [Update a User](#update-a-user) |
| 105 | + - [Delete a User](#delete-a-user) |
| 106 | + - [Resend a User Invitation](#resend-a-user-invitation) |
| 107 | + - [Reset a User's Password](#reset-a-users-password) |
89 | 108 | - [SDK Configuration](#sdk-configuration) |
90 | 109 | - [Logging](#logging) |
91 | 110 | - [In Code](#in-code) |
@@ -1092,6 +1111,154 @@ client.organizations.delete( |
1092 | 1111 | ) |
1093 | 1112 | ``` |
1094 | 1113 |
|
| 1114 | +### Add a User to an Organization |
| 1115 | + |
| 1116 | +Add a user to an organization (or update their role if already a member). The user must already exist in the account. |
| 1117 | + |
| 1118 | +```python |
| 1119 | +from arize.organizations.types import CustomOrgRole, PredefinedOrgRole |
| 1120 | + |
| 1121 | +# Predefined role (admin, member, read-only, or annotator) |
| 1122 | +membership = client.organizations.add_user( |
| 1123 | + organization="<organization-id-or-name>", |
| 1124 | + user_id="<user-id>", |
| 1125 | + role=PredefinedOrgRole(name="member"), |
| 1126 | +) |
| 1127 | + |
| 1128 | +# Custom RBAC role |
| 1129 | +membership = client.organizations.add_user( |
| 1130 | + organization="<organization-id-or-name>", |
| 1131 | + user_id="<user-id>", |
| 1132 | + role=CustomOrgRole(id="<role-id>"), |
| 1133 | +) |
| 1134 | +``` |
| 1135 | + |
| 1136 | +### Remove a User from an Organization |
| 1137 | + |
| 1138 | +Removes the user from the organization and all its child spaces. |
| 1139 | + |
| 1140 | +```python |
| 1141 | +client.organizations.remove_user( |
| 1142 | + organization="<organization-id-or-name>", |
| 1143 | + user_id="<user-id>", |
| 1144 | +) |
| 1145 | +``` |
| 1146 | + |
| 1147 | +## Operations on Spaces |
| 1148 | + |
| 1149 | +Use `client.spaces` to manage space memberships. |
| 1150 | + |
| 1151 | +### Add a User to a Space |
| 1152 | + |
| 1153 | +Add a user to a space (or update their role if already a member). The user must already be a member of the space's parent organization. |
| 1154 | + |
| 1155 | +```python |
| 1156 | +from arize.spaces.types import CustomSpaceRole, PredefinedSpaceRole |
| 1157 | + |
| 1158 | +# Predefined role (admin, member, read-only, or annotator) |
| 1159 | +membership = client.spaces.add_user( |
| 1160 | + space="<space-id-or-name>", |
| 1161 | + user_id="<user-id>", |
| 1162 | + role=PredefinedSpaceRole(name="member"), |
| 1163 | +) |
| 1164 | + |
| 1165 | +# Custom RBAC role |
| 1166 | +membership = client.spaces.add_user( |
| 1167 | + space="<space-id-or-name>", |
| 1168 | + user_id="<user-id>", |
| 1169 | + role=CustomSpaceRole(id="<role-id>"), |
| 1170 | +) |
| 1171 | +``` |
| 1172 | + |
| 1173 | +### Remove a User from a Space |
| 1174 | + |
| 1175 | +```python |
| 1176 | +client.spaces.remove_user( |
| 1177 | + space="<space-id-or-name>", |
| 1178 | + user_id="<user-id>", |
| 1179 | +) |
| 1180 | +``` |
| 1181 | + |
| 1182 | +## Operations on Users |
| 1183 | + |
| 1184 | +Use `client.users` to manage users in the Arize platform. |
| 1185 | + |
| 1186 | +> **Note:** Unlike organizations, users are identified by opaque ID only — not by |
| 1187 | +> name. User display names are not unique within an account, so all methods require |
| 1188 | +> the user's ID. |
| 1189 | +
|
| 1190 | +### List Users |
| 1191 | + |
| 1192 | +```python |
| 1193 | +resp = client.users.list( |
| 1194 | + email=..., # Optional, case-insensitive partial match on email |
| 1195 | + status=..., # Optional, list of statuses: "active", "invited", "expired" |
| 1196 | + limit=..., # Optional, defaults to 50 (max 100) |
| 1197 | + cursor=..., # Optional, pagination cursor from a previous response |
| 1198 | +) |
| 1199 | +user_list = resp.users |
| 1200 | +``` |
| 1201 | + |
| 1202 | +### Get a User |
| 1203 | + |
| 1204 | +```python |
| 1205 | +user = client.users.get( |
| 1206 | + user_id="<user-id>", |
| 1207 | +) |
| 1208 | +``` |
| 1209 | + |
| 1210 | +### Create a User |
| 1211 | + |
| 1212 | +```python |
| 1213 | +from arize.users.types import BuiltinUserRoleAssignment |
| 1214 | + |
| 1215 | +user = client.users.create( |
| 1216 | + name="Jane Smith", |
| 1217 | + email="jane.smith@example.com", |
| 1218 | + role=BuiltinUserRoleAssignment(type="builtin", name="member"), # "admin", "member", or "annotator" |
| 1219 | + invite_mode="email_link", # "none", "email_link", or "temporary_password" |
| 1220 | +) |
| 1221 | +``` |
| 1222 | + |
| 1223 | +### Update a User |
| 1224 | + |
| 1225 | +```python |
| 1226 | +user = client.users.update( |
| 1227 | + user_id="<user-id>", |
| 1228 | + name=..., # Optional updated display name |
| 1229 | + is_developer=..., # Optional, grant or revoke developer permissions |
| 1230 | +) |
| 1231 | +``` |
| 1232 | + |
| 1233 | +### Delete a User |
| 1234 | + |
| 1235 | +> **Warning:** This operation soft-deletes the user and cascades to |
| 1236 | +> organization memberships, space memberships, API keys, and role bindings. |
| 1237 | +
|
| 1238 | +```python |
| 1239 | +client.users.delete( |
| 1240 | + user_id="<user-id>", |
| 1241 | +) |
| 1242 | +``` |
| 1243 | + |
| 1244 | +### Resend a User Invitation |
| 1245 | + |
| 1246 | +```python |
| 1247 | +client.users.resend_invitation( |
| 1248 | + user_id="<user-id>", # Must be in "invited" status |
| 1249 | +) |
| 1250 | +``` |
| 1251 | + |
| 1252 | +### Reset a User's Password |
| 1253 | + |
| 1254 | +Triggers a password-reset email. The user must authenticate via password (not SSO/SAML) and must have already verified their account. |
| 1255 | + |
| 1256 | +```python |
| 1257 | +client.users.reset_password( |
| 1258 | + user_id="<user-id>", |
| 1259 | +) |
| 1260 | +``` |
| 1261 | + |
1095 | 1262 | ## Operations on Annotation Configs |
1096 | 1263 |
|
1097 | 1264 | Use `client.annotation_configs` to manage annotation configurations that define scoring schemas for human feedback. |
|
0 commit comments