user-management changedmanage-claude/user-management
Nearest release: v2.1.301, published 5 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+2,038added
Lines−120removed
From line
47
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits18to this page, all time
The whole hunk
from line 47, old and new numbered
/
The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.
from line 47
4747
4848## Quick start
4949
50Set the `ANTHROPIC_API_KEY` environment variable to your Admin API key. The examples on this page read the key from it. The SDK and the `ant` CLI send the `x-api-key` and `anthropic-version` headers for you.
51
5052List the organization's members, newest first:
5153
52```bash cURL
53curl "https://api.anthropic.com/v1/organizations/users?limit=20" \
54 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
55 -H "anthropic-version: 2023-06-01"
56```
54<CodeGroup>
55 ```bash cURL
56 curl "https://api.anthropic.com/v1/organizations/users?limit=20" \
57 -H "x-api-key: $ANTHROPIC_API_KEY" \
58 -H "anthropic-version: 2023-06-01"
59 ```
60
61 ```bash CLI
62 ant organization:users list --limit 20
63 ```
64
65 ```python Python
66 client = anthropic.Anthropic()
67
68 users = client.organization.users.list(limit=20)
69
70 for user in users:
71 print(f"{user.id}: {user.email} ({user.role})")
72 ```
73
74 ```typescript TypeScript
75 const client = new Anthropic();
76
77 const users = await client.organization.users.list({ limit: 20 });
78
79 for await (const user of users) {
80 console.log(`${user.id}: ${user.email} (${user.role})`);
81 }
82 ```
83
84 ```csharp C#
85 AnthropicClient client = new();
86
87 var page = await client.Organization.Users.List(new() { Limit = 20 });
88
89 await foreach (var user in page.Paginate())
90 {
91 Console.WriteLine($"{user.ID}: {user.Email} ({user.Role.Raw()})");
92 }
93 ```
94
95 ```go Go
96 client := anthropic.NewClient()
97
98 users := client.Organization.Users.ListAutoPaging(context.Background(), anthropic.OrganizationUserListParams{
99 Limit: anthropic.Int(20),
100 })
101
102 for users.Next() {
103 user := users.Current()
104 fmt.Printf("%s: %s (%s)\n", user.ID, user.Email, user.Role)
105 }
106 if err := users.Err(); err != nil {
107 log.Fatal(err)
108 }
109 ```
110
111 ```java Java
112 import com.anthropic.models.organization.users.UserListParams;
113
114 void main() {
115 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
116
117 var params = UserListParams.builder()
118 .limit(20)
119 .build();
120 var users = client.organization().users().list(params);
121
122 for (var user : users.autoPager()) {
123 IO.println(user.id() + ": " + user.email() + " (" + user.role().asString() + ")");
124 }
125 }
126 ```
127
128 ```php PHP
129 $client = new Client();
130
131 $users = $client->organization->users->list(limit: 20);
132
133 foreach ($users->pagingEachItem() as $user) {
134 echo "{$user->id}: {$user->email} ({$user->role})\n";
135 }
136 ```
137
138 ```ruby Ruby
139 client = Anthropic::Client.new
140
141 users = client.organization.users.list(limit: 20)
142
143 users.auto_paging_each do |user|
144 puts "#{user.id}: #{user.email} (#{user.role})"
145 end
146 ```
147</CodeGroup>
57148
58149```json
59150{
from line 202
111202
112203Member and invite lists use ID-based pagination: pass `limit` (default 20, max 1000) plus at most one of `before_id` or `after_id`, and page using the `first_id` and `last_id` fields of each response until `has_more` is `false`. Group and custom-role lists use an **opaque cursor** instead: the response's `next_page` value is passed unchanged as the `page` parameter on the next request, until `next_page` is `null`.
113204
205When you iterate over the results, the SDK fetches more pages for you, so `limit` sets the page size, not the total. In the CLI, `--limit` sets the total number of results for member and invite lists. For group and role lists, it sets the page size.
206
114207## Error responses
115208
116209Error responses follow the standard shape documented in [Errors](https://platform.claude.com/docs/en/api/errors).
from line 216
123216
124217For complete parameter details and response schemas, see [List users](https://platform.claude.com/docs/en/api/organization/users/list) in the API reference.
125218
126```bash cURL
127curl "https://api.anthropic.com/v1/organizations/[email protected]" \
128 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
129 -H "anthropic-version: 2023-06-01"
130```
219<CodeGroup>
220 ```bash cURL
221 curl "https://api.anthropic.com/v1/organizations/[email protected]" \
222 -H "x-api-key: $ANTHROPIC_API_KEY" \
223 -H "anthropic-version: 2023-06-01"
224 ```
225
226 ```bash CLI
227 ant organization:users list --email [email protected]
228 ```
229
230 ```python Python
231 client = anthropic.Anthropic()
232
233 users = client.organization.users.list(email="[email protected]")
234
235 for user in users:
236 print(f"{user.id}: {user.email} ({user.role})")
237 ```
238
239 ```typescript TypeScript
240 const client = new Anthropic();
241
242 const users = await client.organization.users.list({ email: "[email protected]" });
243
244 for await (const user of users) {
245 console.log(`${user.id}: ${user.email} (${user.role})`);
246 }
247 ```
248
249 ```csharp C#
250 AnthropicClient client = new();
251
252 var page = await client.Organization.Users.List(new() { Email = "[email protected]" });
253
254 await foreach (var user in page.Paginate())
255 {
256 Console.WriteLine($"{user.ID}: {user.Email} ({user.Role.Raw()})");
257 }
258 ```
259
260 ```go Go
261 client := anthropic.NewClient()
262
263 users := client.Organization.Users.ListAutoPaging(context.Background(), anthropic.OrganizationUserListParams{
264 Email: anthropic.String("[email protected]"),
265 })
266
267 for users.Next() {
268 user := users.Current()
269 fmt.Printf("%s: %s (%s)\n", user.ID, user.Email, user.Role)
270 }
271 if err := users.Err(); err != nil {
272 log.Fatal(err)
273 }
274 ```
275
276 ```java Java
277 import com.anthropic.models.organization.users.UserListParams;
278
279 void main() {
280 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
281
282 var params = UserListParams.builder()
283 .email("[email protected]")
284 .build();
285 var users = client.organization().users().list(params);
286
287 for (var user : users.autoPager()) {
288 IO.println(user.id() + ": " + user.email() + " (" + user.role().asString() + ")");
289 }
290 }
291 ```
292
293 ```php PHP
294 $client = new Client();
295
296 $users = $client->organization->users->list(email: '[email protected]');
297
298 foreach ($users->pagingEachItem() as $user) {
299 echo "{$user->id}: {$user->email} ({$user->role})\n";
300 }
301 ```
302
303 ```ruby Ruby
304 client = Anthropic::Client.new
305
306 users = client.organization.users.list(email: "[email protected]")
307
308 users.auto_paging_each do |user|
309 puts "#{user.id}: #{user.email} (#{user.role})"
310 end
311 ```
312</CodeGroup>
131313
132314### Get a member
133315
from line 317
135317
136318For complete parameter details and response schemas, see [Get user](https://platform.claude.com/docs/en/api/organization/users/retrieve) in the API reference.
137319
138```bash cURL
139curl "https://api.anthropic.com/v1/organizations/users/user_01AbCdEfGhIjKlMnOpQrSt" \
140 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
141 -H "anthropic-version: 2023-06-01"
142```
320<CodeGroup>
321 ```bash cURL
322 curl "https://api.anthropic.com/v1/organizations/users/user_01AbCdEfGhIjKlMnOpQrSt" \
323 -H "x-api-key: $ANTHROPIC_API_KEY" \
324 -H "anthropic-version: 2023-06-01"
325 ```
326
327 ```bash CLI
328 ant organization:users retrieve --user-id user_01AbCdEfGhIjKlMnOpQrSt
329 ```
330
331 ```python Python
332 client = anthropic.Anthropic()
333
334 user = client.organization.users.retrieve("user_01AbCdEfGhIjKlMnOpQrSt")
335
336 print(f"id: {user.id}")
337 print(f"email: {user.email}")
338 print(f"role: {user.role}")
339 ```
340
341 ```typescript TypeScript
342 const client = new Anthropic();
343
344 const user = await client.organization.users.retrieve("user_01AbCdEfGhIjKlMnOpQrSt");
345
346 console.log(`id: ${user.id}`);
347 console.log(`email: ${user.email}`);
348 console.log(`role: ${user.role}`);
349 ```
350
351 ```csharp C#
352 AnthropicClient client = new();
353
354 var user = await client.Organization.Users.Retrieve("user_01AbCdEfGhIjKlMnOpQrSt");
355
356 Console.WriteLine($"id: {user.ID}");
357 Console.WriteLine($"email: {user.Email}");
358 Console.WriteLine($"role: {user.Role.Raw()}");
359 ```
360
361 ```go Go
362 client := anthropic.NewClient()
363
364 user, err := client.Organization.Users.Get(context.Background(), "user_01AbCdEfGhIjKlMnOpQrSt")
365 if err != nil {
366 log.Fatal(err)
367 }
368
369 fmt.Printf("id: %s\n", user.ID)
370 fmt.Printf("email: %s\n", user.Email)
371 fmt.Printf("role: %s\n", user.Role)
372 ```
373
374 ```java Java
375 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
376
377 var user = client.organization().users()
378 .retrieve("user_01AbCdEfGhIjKlMnOpQrSt");
379
380 IO.println("id: " + user.id());
381 IO.println("email: " + user.email());
382 IO.println("role: " + user.role().asString());
383 ```
384
385 ```php PHP
386 $client = new Client();
387
388 $user = $client->organization->users->retrieve(
389 userID: 'user_01AbCdEfGhIjKlMnOpQrSt',
390 );
391
392 echo "id: {$user->id}\n";
393 echo "email: {$user->email}\n";
394 echo "role: {$user->role}\n";
395 ```
396
397 ```ruby Ruby
398 client = Anthropic::Client.new
399
400 user = client.organization.users.retrieve("user_01AbCdEfGhIjKlMnOpQrSt")
401
402 puts "id: #{user.id}"
403 puts "email: #{user.email}"
404 puts "role: #{user.role}"
405 ```
406</CodeGroup>
143407
144408### Change a member's role
145409
from line 411
147411
148412For complete parameter details and response schemas, see [Update user](https://platform.claude.com/docs/en/api/organization/users/update) in the API reference.
149413
150```bash cURL
151curl -X POST "https://api.anthropic.com/v1/organizations/users/user_01AbCdEfGhIjKlMnOpQrSt" \
152 -H "content-type: application/json" \
153 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
154 -H "anthropic-version: 2023-06-01" \
155 -d '{"role": "managed"}'
156```
414<CodeGroup>
415 ```bash cURL
416 curl -X POST "https://api.anthropic.com/v1/organizations/users/user_01AbCdEfGhIjKlMnOpQrSt" \
417 -H "content-type: application/json" \
418 -H "x-api-key: $ANTHROPIC_API_KEY" \
419 -H "anthropic-version: 2023-06-01" \
420 -d '{"role": "managed"}'
421 ```
422
423 ```bash CLI
424 ant organization:users update \
425 --user-id user_01AbCdEfGhIjKlMnOpQrSt \
426 --role managed
427 ```
428
429 ```python Python
430 client = anthropic.Anthropic()
431
432 user = client.organization.users.update("user_01AbCdEfGhIjKlMnOpQrSt", role="managed")
433
434 print(f"id: {user.id}")
435 print(f"role: {user.role}")
436 ```
437
438 ```typescript TypeScript
439 const client = new Anthropic();
440
441 const user = await client.organization.users.update("user_01AbCdEfGhIjKlMnOpQrSt", {
442 role: "managed"
443 });
444
445 console.log(`id: ${user.id}`);
446 console.log(`role: ${user.role}`);
447 ```
448
449 ```csharp C#
450 using Anthropic.Models.Organization.Users;
451 // ...
452
453 AnthropicClient client = new();
454
455 var user = await client.Organization.Users.Update(
456 "user_01AbCdEfGhIjKlMnOpQrSt",
457 new() { Role = Role.Managed }
458 );
459
460 Console.WriteLine($"id: {user.ID}");
461 Console.WriteLine($"role: {user.Role.Raw()}");
462 ```
463
464 ```go Go
465 client := anthropic.NewClient()
466
467 user, err := client.Organization.Users.Update(
468 context.Background(),
469 "user_01AbCdEfGhIjKlMnOpQrSt",
470 anthropic.OrganizationUserUpdateParams{
471 Role: anthropic.OrganizationUserUpdateParamsRoleManaged,
472 },
473 )
474 if err != nil {
475 log.Fatal(err)
476 }
477
478 fmt.Printf("id: %s\n", user.ID)
479 fmt.Printf("role: %s\n", user.Role)
480 ```
481
482 ```java Java
483 import com.anthropic.models.organization.users.UserUpdateParams;
484
485 void main() {
486 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
487
488 var params = UserUpdateParams.builder()
489 .role(UserUpdateParams.Role.MANAGED)
490 .build();
491 var user = client.organization().users()
492 .update("user_01AbCdEfGhIjKlMnOpQrSt", params);
493
494 IO.println("id: " + user.id());
495 IO.println("role: " + user.role().asString());
496 }
497 ```
498
499 ```php PHP
500 use Anthropic\Organization\Users\UserUpdateParams\Role;
501 // ...
502
503 $client = new Client();
504
505 $user = $client->organization->users->update(
506 userID: 'user_01AbCdEfGhIjKlMnOpQrSt',
507 role: Role::MANAGED,
508 );
509
510 echo "id: {$user->id}\n";
511 echo "role: {$user->role}\n";
512 ```
513
514 ```ruby Ruby
515 client = Anthropic::Client.new
516
517 user_id = "user_01AbCdEfGhIjKlMnOpQrSt"
518 user = client.organization.users.update(user_id, role: :managed)
519
520 puts "id: #{user.id}"
521 puts "role: #{user.role}"
522 ```
523</CodeGroup>
157524
158525### Remove a member
159526
from line 528
161528
162529For complete parameter details and response schemas, see [Remove user](https://platform.claude.com/docs/en/api/organization/users/remove) in the API reference.
163530
164```bash cURL
165curl -X DELETE "https://api.anthropic.com/v1/organizations/users/user_01AbCdEfGhIjKlMnOpQrSt" \
166 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
167 -H "anthropic-version: 2023-06-01"
168```
531<CodeGroup>
532 ```bash cURL
533 curl -X DELETE "https://api.anthropic.com/v1/organizations/users/user_01AbCdEfGhIjKlMnOpQrSt" \
534 -H "x-api-key: $ANTHROPIC_API_KEY" \
535 -H "anthropic-version: 2023-06-01"
536 ```
537
538 ```bash CLI
539 ant organization:users remove --user-id user_01AbCdEfGhIjKlMnOpQrSt
540 ```
541
542 ```python Python
543 client = anthropic.Anthropic()
544
545 removed_user = client.organization.users.remove("user_01AbCdEfGhIjKlMnOpQrSt")
546
547 print(f"id: {removed_user.id}")
548 ```
549
550 ```typescript TypeScript
551 const client = new Anthropic();
552
553 const removedUser = await client.organization.users.remove("user_01AbCdEfGhIjKlMnOpQrSt");
554
555 console.log(`id: ${removedUser.id}`);
556 ```
557
558 ```csharp C#
559 AnthropicClient client = new();
560
561 var removedUser = await client.Organization.Users.Remove("user_01AbCdEfGhIjKlMnOpQrSt");
562
563 Console.WriteLine($"id: {removedUser.ID}");
564 ```
565
566 ```go Go
567 client := anthropic.NewClient()
568
569 removedUser, err := client.Organization.Users.Remove(context.Background(), "user_01AbCdEfGhIjKlMnOpQrSt")
570 if err != nil {
571 log.Fatal(err)
572 }
573
574 fmt.Printf("id: %s\n", removedUser.ID)
575 ```
576
577 ```java Java
578 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
579
580 var removedUser = client.organization().users()
581 .remove("user_01AbCdEfGhIjKlMnOpQrSt");
582
583 IO.println("id: " + removedUser.id());
584 ```
585
586 ```php PHP
587 $client = new Client();
588
589 $removedUser = $client->organization->users->remove(
590 userID: 'user_01AbCdEfGhIjKlMnOpQrSt',
591 );
592
593 echo "id: {$removedUser->id}\n";
594 ```
595
596 ```ruby Ruby
597 client = Anthropic::Client.new
598
599 user_id = "user_01AbCdEfGhIjKlMnOpQrSt"
600 removed_user = client.organization.users.remove(user_id)
601
602 puts "id: #{removed_user.id}"
603 ```
604</CodeGroup>
169605
170606```json
171607{
from line 616
180616
181617`POST /v1/organizations/invites` sends an invitation email and returns the invite with a server-assigned `expires_at`. `role` must be `user` or `managed`. If a pending invite already exists for the email address, or the address already belongs to a member, the request returns 400 naming the existing resource. Organizations whose identity provider provisions users automatically (JIT or SCIM) cannot create invites through the API. Requires the `write:members` scope, plus `write:rbac_groups` when `role` is `managed`.
182618
183On plans that draw members from a finite seat pool, the invite automatically takes a seat from the lowest tier that has availability; the API does not take a tier parameter. If no seat is free, the request fails with a 400 error rather than purchasing a seat. Add seats through the organization's plan management and retry.
619On plans that draw members from a finite seat pool, the invite automatically takes a seat from the lowest tier that has availability. The API does not take a tier parameter. If no seat is free, the request fails with a 400 error rather than purchasing a seat. Add seats through the organization's plan management and retry.
184620
185621The optional `rbac_group_ids` field lists groups (by `rbac_group_`-prefixed ID) to assign to the member when they accept. Passing a non-empty `rbac_group_ids` additionally requires the key to carry the `write:rbac_groups` scope, because group assignment can grant the permissions attached to the group's roles.
186622
187623For complete parameter details and response schemas, see [Create invite](https://platform.claude.com/docs/en/api/organization/invites/create) in the API reference.
188624
189```bash cURL
190curl -X POST "https://api.anthropic.com/v1/organizations/invites" \
191 -H "content-type: application/json" \
192 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
193 -H "anthropic-version: 2023-06-01" \
194 -d '{
195 "email": "[email protected]",
196 "role": "managed",
197 "rbac_group_ids": ["rbac_group_01UvWxYzAbCdEfGhIjKlMn"]
198 }'
199```
625<CodeGroup>
626 ```bash cURL
627 curl -X POST "https://api.anthropic.com/v1/organizations/invites" \
628 -H "content-type: application/json" \
629 -H "x-api-key: $ANTHROPIC_API_KEY" \
630 -H "anthropic-version: 2023-06-01" \
631 -d '{
632 "email": "[email protected]",
633 "role": "managed",
634 "rbac_group_ids": ["rbac_group_01UvWxYzAbCdEfGhIjKlMn"]
635 }'
636 ```
637
638 ```bash CLI
639 ant organization:invites create \
640 --email [email protected] \
641 --role managed \
642 --rbac-group-id rbac_group_01UvWxYzAbCdEfGhIjKlMn
643 ```
644
645 ```python Python
646 client = anthropic.Anthropic()
647
648 invite = client.organization.invites.create(
649 email="[email protected]",
650 role="managed",
651 rbac_group_ids=["rbac_group_01UvWxYzAbCdEfGhIjKlMn"],
652 )
653
654 print(f"id: {invite.id}")
655 print(f"email: {invite.email}")
656 print(f"status: {invite.status}")
657 print(f"expires_at: {invite.expires_at}")
658 ```
659
660 ```typescript TypeScript
661 const client = new Anthropic();
662
663 const invite = await client.organization.invites.create({
664 email: "[email protected]",
665 role: "managed",
666 rbac_group_ids: ["rbac_group_01UvWxYzAbCdEfGhIjKlMn"]
667 });
668
669 console.log(`id: ${invite.id}`);
670 console.log(`email: ${invite.email}`);
671 console.log(`status: ${invite.status}`);
672 console.log(`expires_at: ${invite.expires_at}`);
673 ```
674
675 ```csharp C#
676 using Anthropic.Models.Organization.Invites;
677 // ...
678
679 AnthropicClient client = new();
680
681 var invite = await client.Organization.Invites.Create(new()
682 {
683 Email = "[email protected]",
684 Role = Role.Managed,
685 RbacGroupIds = ["rbac_group_01UvWxYzAbCdEfGhIjKlMn"]
686 });
687
688 Console.WriteLine($"id: {invite.ID}");
689 Console.WriteLine($"email: {invite.Email}");
690 Console.WriteLine($"status: {invite.Status.Raw()}");
691 Console.WriteLine($"expires_at: {invite.ExpiresAt:O}");
692 ```
693
694 ```go Go
695 client := anthropic.NewClient()
696
697 invite, err := client.Organization.Invites.New(context.Background(), anthropic.OrganizationInviteNewParams{
698 Email: "[email protected]",
699 Role: anthropic.OrganizationInviteNewParamsRoleManaged,
700 RBACGroupIDs: []string{"rbac_group_01UvWxYzAbCdEfGhIjKlMn"},
701 })
702 if err != nil {
703 log.Fatal(err)
704 }
705
706 fmt.Printf("id: %s\n", invite.ID)
707 fmt.Printf("email: %s\n", invite.Email)
708 fmt.Printf("status: %s\n", invite.Status)
709 fmt.Printf("expires_at: %s\n", invite.ExpiresAt.Format(time.RFC3339))
710 ```
711
712 ```java Java
713 import com.anthropic.models.organization.invites.InviteCreateParams;
714
715 void main() {
716 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
717
718 var params = InviteCreateParams.builder()
719 .email("[email protected]")
720 .role(InviteCreateParams.Role.MANAGED)
721 .addRbacGroupId("rbac_group_01UvWxYzAbCdEfGhIjKlMn")
722 .build();
723 var invite = client.organization().invites().create(params);
724
725 IO.println("id: " + invite.id());
726 IO.println("email: " + invite.email());
727 IO.println("status: " + invite.status().asString());
728 IO.println("expires_at: " + invite.expiresAt());
729 }
730 ```
731
732 ```php PHP
733 use Anthropic\Organization\Invites\InviteCreateParams\Role;
734 // ...
735
736 $client = new Client();
737
738 $invite = $client->organization->invites->create(
739 email: '[email protected]',
740 role: Role::MANAGED,
741 rbacGroupIDs: ['rbac_group_01UvWxYzAbCdEfGhIjKlMn'],
742 );
743
744 echo "id: {$invite->id}\n";
745 echo "email: {$invite->email}\n";
746 echo "status: {$invite->status}\n";
747 echo "expires_at: {$invite->expiresAt->format(DATE_ATOM)}\n";
748 ```
749
750 ```ruby Ruby
751 client = Anthropic::Client.new
752
753 invite = client.organization.invites.create(
754 email: "[email protected]",
755 role: :managed,
756 rbac_group_ids: ["rbac_group_01UvWxYzAbCdEfGhIjKlMn"]
757 )
758
759 puts "id: #{invite.id}"
760 puts "email: #{invite.email}"
761 puts "status: #{invite.status}"
762 puts "expires_at: #{invite.expires_at.iso8601}"
763 ```
764</CodeGroup>
200765
201766```json
202767{
from line 783
218783
219784For complete parameter details and response schemas, see [List invites](https://platform.claude.com/docs/en/api/organization/invites/list) in the API reference.
220785
221```bash cURL
222curl "https://api.anthropic.com/v1/organizations/invites?limit=20" \
223 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
224 -H "anthropic-version: 2023-06-01"
225```
786<CodeGroup>
787 ```bash cURL
788 curl "https://api.anthropic.com/v1/organizations/invites?limit=20" \
789 -H "x-api-key: $ANTHROPIC_API_KEY" \
790 -H "anthropic-version: 2023-06-01"
791 ```
792
793 ```bash CLI
794 ant organization:invites list --limit 20
795 ```
796
797 ```python Python
798 client = anthropic.Anthropic()
799
800 invites = client.organization.invites.list(limit=20)
801
802 for invite in invites:
803 print(f"{invite.id}: {invite.email} ({invite.status})")
804 ```
805
806 ```typescript TypeScript
807 const client = new Anthropic();
808
809 const invites = await client.organization.invites.list({ limit: 20 });
810
811 for await (const invite of invites) {
812 console.log(`${invite.id}: ${invite.email} (${invite.status})`);
813 }
814 ```
815
816 ```csharp C#
817 AnthropicClient client = new();
818
819 var page = await client.Organization.Invites.List(new() { Limit = 20 });
820
821 await foreach (var invite in page.Paginate())
822 {
823 Console.WriteLine($"{invite.ID}: {invite.Email} ({invite.Status.Raw()})");
824 }
825 ```
826
827 ```go Go
828 client := anthropic.NewClient()
829
830 invites := client.Organization.Invites.ListAutoPaging(context.Background(), anthropic.OrganizationInviteListParams{
831 Limit: anthropic.Int(20),
832 })
833
834 for invites.Next() {
835 invite := invites.Current()
836 fmt.Printf("%s: %s (%s)\n", invite.ID, invite.Email, invite.Status)
837 }
838 if err := invites.Err(); err != nil {
839 log.Fatal(err)
840 }
841 ```
842
843 ```java Java
844 import com.anthropic.models.organization.invites.InviteListParams;
845
846 void main() {
847 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
848
849 var params = InviteListParams.builder()
850 .limit(20)
851 .build();
852 var invites = client.organization().invites().list(params);
853
854 for (var invite : invites.autoPager()) {
855 IO.println(invite.id() + ": " + invite.email() + " (" + invite.status().asString() + ")");
856 }
857 }
858 ```
859
860 ```php PHP
861 $client = new Client();
862
863 $invites = $client->organization->invites->list(limit: 20);
864
865 foreach ($invites->pagingEachItem() as $invite) {
866 echo "{$invite->id}: {$invite->email} ({$invite->status})\n";
867 }
868 ```
869
870 ```ruby Ruby
871 client = Anthropic::Client.new
872
873 invites = client.organization.invites.list(limit: 20)
874
875 invites.auto_paging_each do |invite|
876 puts "#{invite.id}: #{invite.email} (#{invite.status})"
877 end
878 ```
879</CodeGroup>
226880
227881### Get an invite
228882
from line 884
230884
231885For complete parameter details and response schemas, see [Get invite](https://platform.claude.com/docs/en/api/organization/invites/retrieve) in the API reference.
232886
233```bash cURL
234curl "https://api.anthropic.com/v1/organizations/invites/invite_01QrStUvWxYzAbCdEfGhIj" \
235 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
236 -H "anthropic-version: 2023-06-01"
237```
887<CodeGroup>
888 ```bash cURL
889 curl "https://api.anthropic.com/v1/organizations/invites/invite_01QrStUvWxYzAbCdEfGhIj" \
890 -H "x-api-key: $ANTHROPIC_API_KEY" \
891 -H "anthropic-version: 2023-06-01"
892 ```
893
894 ```bash CLI
895 ant organization:invites retrieve --invite-id invite_01QrStUvWxYzAbCdEfGhIj
896 ```
897
898 ```python Python
899 client = anthropic.Anthropic()
900
901 invite = client.organization.invites.retrieve("invite_01QrStUvWxYzAbCdEfGhIj")
902
903 print(f"id: {invite.id}")
904 print(f"email: {invite.email}")
905 print(f"status: {invite.status}")
906 ```
907
908 ```typescript TypeScript
909 const client = new Anthropic();
910
911 const invite = await client.organization.invites.retrieve("invite_01QrStUvWxYzAbCdEfGhIj");
912
913 console.log(`id: ${invite.id}`);
914 console.log(`email: ${invite.email}`);
915 console.log(`status: ${invite.status}`);
916 ```
917
918 ```csharp C#
919 AnthropicClient client = new();
920
921 var invite = await client.Organization.Invites.Retrieve("invite_01QrStUvWxYzAbCdEfGhIj");
922
923 Console.WriteLine($"id: {invite.ID}");
924 Console.WriteLine($"email: {invite.Email}");
925 Console.WriteLine($"status: {invite.Status.Raw()}");
926 ```
927
928 ```go Go
929 client := anthropic.NewClient()
930
931 invite, err := client.Organization.Invites.Get(context.Background(), "invite_01QrStUvWxYzAbCdEfGhIj")
932 if err != nil {
933 log.Fatal(err)
934 }
935
936 fmt.Printf("id: %s\n", invite.ID)
937 fmt.Printf("email: %s\n", invite.Email)
938 fmt.Printf("status: %s\n", invite.Status)
939 ```
940
941 ```java Java
942 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
943
944 var invite = client.organization().invites()
945 .retrieve("invite_01QrStUvWxYzAbCdEfGhIj");
946
947 IO.println("id: " + invite.id());
948 IO.println("email: " + invite.email());
949 IO.println("status: " + invite.status().asString());
950 ```
951
952 ```php PHP
953 $client = new Client();
954
955 $invite = $client->organization->invites->retrieve(
956 inviteID: 'invite_01QrStUvWxYzAbCdEfGhIj',
957 );
958
959 echo "id: {$invite->id}\n";
960 echo "email: {$invite->email}\n";
961 echo "status: {$invite->status}\n";
962 ```
963
964 ```ruby Ruby
965 client = Anthropic::Client.new
966
967 invite = client.organization.invites.retrieve("invite_01QrStUvWxYzAbCdEfGhIj")
968
969 puts "id: #{invite.id}"
970 puts "email: #{invite.email}"
971 puts "status: #{invite.status}"
972 ```
973</CodeGroup>
238974
239975### Withdraw an invite
240976
from line 978
242978
243979For complete parameter details and response schemas, see [Delete invite](https://platform.claude.com/docs/en/api/organization/invites/delete) in the API reference.
244980
245```bash cURL
246curl -X DELETE "https://api.anthropic.com/v1/organizations/invites/invite_01QrStUvWxYzAbCdEfGhIj" \
247 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
248 -H "anthropic-version: 2023-06-01"
249```
981<CodeGroup>
982 ```bash cURL
983 curl -X DELETE "https://api.anthropic.com/v1/organizations/invites/invite_01QrStUvWxYzAbCdEfGhIj" \
984 -H "x-api-key: $ANTHROPIC_API_KEY" \
985 -H "anthropic-version: 2023-06-01"
986 ```
987
988 ```bash CLI
989 ant organization:invites delete --invite-id invite_01QrStUvWxYzAbCdEfGhIj
990 ```
991
992 ```python Python
993 client = anthropic.Anthropic()
994
995 deleted_invite = client.organization.invites.delete("invite_01QrStUvWxYzAbCdEfGhIj")
996
997 print(f"id: {deleted_invite.id}")
998 ```
999
1000 ```typescript TypeScript
1001 const client = new Anthropic();
1002
1003 const deletedInvite = await client.organization.invites.delete(
1004 "invite_01QrStUvWxYzAbCdEfGhIj"
1005 );
1006
1007 console.log(`id: ${deletedInvite.id}`);
1008 ```
1009
1010 ```csharp C#
1011 AnthropicClient client = new();
1012
1013 var deletedInvite = await client.Organization.Invites.Delete("invite_01QrStUvWxYzAbCdEfGhIj");
1014
1015 Console.WriteLine($"id: {deletedInvite.ID}");
1016 ```
1017
1018 ```go Go
1019 client := anthropic.NewClient()
1020
1021 deletedInvite, err := client.Organization.Invites.Delete(context.Background(), "invite_01QrStUvWxYzAbCdEfGhIj")
1022 if err != nil {
1023 log.Fatal(err)
1024 }
1025
1026 fmt.Printf("id: %s\n", deletedInvite.ID)
1027 ```
1028
1029 ```java Java
1030 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1031
1032 var deletedInvite = client.organization().invites()
1033 .delete("invite_01QrStUvWxYzAbCdEfGhIj");
1034
1035 IO.println("id: " + deletedInvite.id());
1036 ```
1037
1038 ```php PHP
1039 $client = new Client();
1040
1041 $deletedInvite = $client->organization->invites->delete(
1042 inviteID: 'invite_01QrStUvWxYzAbCdEfGhIj',
1043 );
1044
1045 echo "id: {$deletedInvite->id}\n";
1046 ```
1047
1048 ```ruby Ruby
1049 client = Anthropic::Client.new
1050
1051 invite_id = "invite_01QrStUvWxYzAbCdEfGhIj"
1052 deleted_invite = client.organization.invites.delete(invite_id)
1053
1054 puts "id: #{deleted_invite.id}"
1055 ```
1056</CodeGroup>
2501057
2511058## Groups
2521059
from line 1065
2581065
2591066For complete parameter details and response schemas, see [List groups](https://platform.claude.com/docs/en/api/beta/organization/rbac_groups/list) in the API reference.
2601067
261```bash cURL
262curl "https://api.anthropic.com/v1/organizations/rbac_groups?limit=20" \
263 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
264 -H "anthropic-version: 2023-06-01"
265```
1068<CodeGroup>
1069 ```bash cURL
1070 curl "https://api.anthropic.com/v1/organizations/rbac_groups?limit=20" \
1071 -H "x-api-key: $ANTHROPIC_API_KEY" \
1072 -H "anthropic-version: 2023-06-01"
1073 ```
1074
1075 ```bash CLI
1076 ant beta:organization:rbac-groups list --limit 20
1077 ```
1078
1079 ```python Python
1080 client = anthropic.Anthropic()
1081
1082 groups = client.beta.organization.rbac_groups.list(limit=20)
1083
1084 for group in groups:
1085 print(f"{group.id}: {group.name} ({group.source_type})")
1086 ```
1087
1088 ```typescript TypeScript
1089 const client = new Anthropic();
1090
1091 const groups = await client.beta.organization.rbacGroups.list({ limit: 20 });
1092
1093 for await (const group of groups) {
1094 console.log(`${group.id}: ${group.name} (${group.source_type})`);
1095 }
1096 ```
1097
1098 ```csharp C#
1099 AnthropicClient client = new();
1100
1101 var page = await client.Beta.Organization.RbacGroups.List(new() { Limit = 20 });
1102
1103 await foreach (var group in page.Paginate())
1104 {
1105 Console.WriteLine($"{group.ID}: {group.Name} ({group.SourceType.Raw()})");
1106 }
1107 ```
1108
1109 ```go Go
1110 client := anthropic.NewClient()
1111
1112 groups := client.Beta.Organization.RBACGroups.ListAutoPaging(context.Background(), anthropic.BetaOrganizationRBACGroupListParams{
1113 Limit: anthropic.Int(20),
1114 })
1115
1116 for groups.Next() {
1117 group := groups.Current()
1118 fmt.Printf("%s: %s (%s)\n", group.ID, group.Name, group.SourceType)
1119 }
1120 if err := groups.Err(); err != nil {
1121 log.Fatal(err)
1122 }
1123 ```
1124
1125 ```java Java
1126 import com.anthropic.models.beta.organization.rbacgroups.RbacGroupListParams;
1127
1128 void main() {
1129 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1130
1131 var params = RbacGroupListParams.builder()
1132 .limit(20)
1133 .build();
1134 var groups = client.beta().organization().rbacGroups().list(params);
1135
1136 for (var group : groups.autoPager()) {
1137 IO.println(group.id() + ": " + group.name() + " (" + group.sourceType().asString() + ")");
1138 }
1139 }
1140 ```
1141
1142 ```php PHP
1143 $client = new Client();
1144
1145 $groups = $client->beta->organization->rbacGroups->list(limit: 20);
1146
1147 foreach ($groups->pagingEachItem() as $group) {
1148 echo "{$group->id}: {$group->name} ({$group->sourceType})\n";
1149 }
1150 ```
1151
1152 ```ruby Ruby
1153 client = Anthropic::Client.new
1154
1155 groups = client.beta.organization.rbac_groups.list(limit: 20)
1156
1157 groups.auto_paging_each do |group|
1158 puts "#{group.id}: #{group.name} (#{group.source_type})"
1159 end
1160 ```
1161</CodeGroup>
2661162
2671163```json
2681164{
from line 1185
2891185
2901186For complete parameter details and response schemas, see [Get group](https://platform.claude.com/docs/en/api/beta/organization/rbac_groups/retrieve) in the API reference.
2911187
292```bash cURL
293curl "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn" \
294 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
295 -H "anthropic-version: 2023-06-01"
296```
1188<CodeGroup>
1189 ```bash cURL
1190 curl "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn" \
1191 -H "x-api-key: $ANTHROPIC_API_KEY" \
1192 -H "anthropic-version: 2023-06-01"
1193 ```
1194
1195 ```bash CLI
1196 ant beta:organization:rbac-groups retrieve \
1197 --rbac-group-id rbac_group_01UvWxYzAbCdEfGhIjKlMn
1198 ```
1199
1200 ```python Python
1201 client = anthropic.Anthropic()
1202
1203 group = client.beta.organization.rbac_groups.retrieve(
1204 "rbac_group_01UvWxYzAbCdEfGhIjKlMn"
1205 )
1206
1207 print(f"id: {group.id}")
1208 print(f"name: {group.name}")
1209 print(f"source_type: {group.source_type}")
1210 ```
1211
1212 ```typescript TypeScript
1213 const client = new Anthropic();
1214
1215 const group = await client.beta.organization.rbacGroups.retrieve(
1216 "rbac_group_01UvWxYzAbCdEfGhIjKlMn"
1217 );
1218
1219 console.log(`id: ${group.id}`);
1220 console.log(`name: ${group.name}`);
1221 console.log(`source_type: ${group.source_type}`);
1222 ```
1223
1224 ```csharp C#
1225 AnthropicClient client = new();
1226
1227 var group = await client.Beta.Organization.RbacGroups.Retrieve("rbac_group_01UvWxYzAbCdEfGhIjKlMn");
1228
1229 Console.WriteLine($"id: {group.ID}");
1230 Console.WriteLine($"name: {group.Name}");
1231 Console.WriteLine($"source_type: {group.SourceType.Raw()}");
1232 ```
1233
1234 ```go Go
1235 client := anthropic.NewClient()
1236
1237 group, err := client.Beta.Organization.RBACGroups.Get(context.Background(), "rbac_group_01UvWxYzAbCdEfGhIjKlMn")
1238 if err != nil {
1239 log.Fatal(err)
1240 }
1241
1242 fmt.Printf("id: %s\n", group.ID)
1243 fmt.Printf("name: %s\n", group.Name)
1244 fmt.Printf("source_type: %s\n", group.SourceType)
1245 ```
1246
1247 ```java Java
1248 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1249
1250 var group = client.beta().organization().rbacGroups()
1251 .retrieve("rbac_group_01UvWxYzAbCdEfGhIjKlMn");
1252
1253 IO.println("id: " + group.id());
1254 IO.println("name: " + group.name());
1255 IO.println("source_type: " + group.sourceType().asString());
1256 ```
1257
1258 ```php PHP
1259 $client = new Client();
1260
1261 $group = $client->beta->organization->rbacGroups->retrieve(
1262 rbacGroupID: 'rbac_group_01UvWxYzAbCdEfGhIjKlMn',
1263 );
1264
1265 echo "id: {$group->id}\n";
1266 echo "name: {$group->name}\n";
1267 echo "source_type: {$group->sourceType}\n";
1268 ```
1269
1270 ```ruby Ruby
1271 client = Anthropic::Client.new
1272
1273 rbac_group_id = "rbac_group_01UvWxYzAbCdEfGhIjKlMn"
1274 group = client.beta.organization.rbac_groups.retrieve(rbac_group_id)
1275
1276 puts "id: #{group.id}"
1277 puts "name: #{group.name}"
1278 puts "source_type: #{group.source_type}"
1279 ```
1280</CodeGroup>
2971281
2981282### Create a group
2991283
from line 1285
3011285
3021286For complete parameter details and response schemas, see [Create group](https://platform.claude.com/docs/en/api/beta/organization/rbac_groups/create) in the API reference.
3031287
304```bash cURL
305curl -X POST "https://api.anthropic.com/v1/organizations/rbac_groups" \
306 -H "content-type: application/json" \
307 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
308 -H "anthropic-version: 2023-06-01" \
309 -d '{"name": "Engineering"}'
310```
1288<CodeGroup>
1289 ```bash cURL
1290 curl -X POST "https://api.anthropic.com/v1/organizations/rbac_groups" \
1291 -H "content-type: application/json" \
1292 -H "x-api-key: $ANTHROPIC_API_KEY" \
1293 -H "anthropic-version: 2023-06-01" \
1294 -d '{"name": "Engineering"}'
1295 ```
1296
1297 ```bash CLI
1298 ant beta:organization:rbac-groups create --name Engineering
1299 ```
1300
1301 ```python Python
1302 client = anthropic.Anthropic()
1303
1304 group = client.beta.organization.rbac_groups.create(name="Engineering")
1305
1306 print(f"id: {group.id}")
1307 print(f"name: {group.name}")
1308 ```
1309
1310 ```typescript TypeScript
1311 const client = new Anthropic();
1312
1313 const group = await client.beta.organization.rbacGroups.create({ name: "Engineering" });
1314
1315 console.log(`id: ${group.id}`);
1316 console.log(`name: ${group.name}`);
1317 ```
1318
1319 ```csharp C#
1320 AnthropicClient client = new();
1321
1322 var group = await client.Beta.Organization.RbacGroups.Create(new()
1323 {
1324 Name = "Engineering"
1325 });
1326
1327 Console.WriteLine($"id: {group.ID}");
1328 Console.WriteLine($"name: {group.Name}");
1329 ```
1330
1331 ```go Go
1332 client := anthropic.NewClient()
1333
1334 group, err := client.Beta.Organization.RBACGroups.New(context.Background(), anthropic.BetaOrganizationRBACGroupNewParams{
1335 Name: "Engineering",
1336 })
1337 if err != nil {
1338 log.Fatal(err)
1339 }
1340
1341 fmt.Printf("id: %s\n", group.ID)
1342 fmt.Printf("name: %s\n", group.Name)
1343 ```
1344
1345 ```java Java
1346 import com.anthropic.models.beta.organization.rbacgroups.RbacGroupCreateParams;
1347
1348 void main() {
1349 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1350
1351 var params = RbacGroupCreateParams.builder()
1352 .name("Engineering")
1353 .build();
1354 var group = client.beta().organization().rbacGroups().create(params);
1355
1356 IO.println("id: " + group.id());
1357 IO.println("name: " + group.name());
1358 }
1359 ```
1360
1361 ```php PHP
1362 $client = new Client();
1363
1364 $group = $client->beta->organization->rbacGroups->create(
1365 name: 'Engineering',
1366 );
1367
1368 echo "id: {$group->id}\n";
1369 echo "name: {$group->name}\n";
1370 ```
1371
1372 ```ruby Ruby
1373 client = Anthropic::Client.new
1374
1375 group = client.beta.organization.rbac_groups.create(name: "Engineering")
1376
1377 puts "id: #{group.id}"
1378 puts "name: #{group.name}"
1379 ```
1380</CodeGroup>
3111381
3121382```json
3131383{
from line 1398
3281398
3291399For complete parameter details and response schemas, see [Update group](https://platform.claude.com/docs/en/api/beta/organization/rbac_groups/update) in the API reference.
3301400
331```bash cURL
332curl -X POST "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn" \
333 -H "content-type: application/json" \
334 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
335 -H "anthropic-version: 2023-06-01" \
336 -d '{"name": "Platform Engineering"}'
337```
1401<CodeGroup>
1402 ```bash cURL
1403 curl -X POST "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn" \
1404 -H "content-type: application/json" \
1405 -H "x-api-key: $ANTHROPIC_API_KEY" \
1406 -H "anthropic-version: 2023-06-01" \
1407 -d '{"name": "Platform Engineering"}'
1408 ```
1409
1410 ```bash CLI
1411 ant beta:organization:rbac-groups update \
1412 --rbac-group-id rbac_group_01UvWxYzAbCdEfGhIjKlMn \
1413 --name "Platform Engineering"
1414 ```
1415
1416 ```python Python
1417 client = anthropic.Anthropic()
1418
1419 group = client.beta.organization.rbac_groups.update(
1420 "rbac_group_01UvWxYzAbCdEfGhIjKlMn", name="Platform Engineering"
1421 )
1422
1423 print(f"id: {group.id}")
1424 print(f"name: {group.name}")
1425 ```
1426
1427 ```typescript TypeScript
1428 const client = new Anthropic();
1429
1430 const group = await client.beta.organization.rbacGroups.update(
1431 "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
1432 { name: "Platform Engineering" }
1433 );
1434
1435 console.log(`id: ${group.id}`);
1436 console.log(`name: ${group.name}`);
1437 ```
1438
1439 ```csharp C#
1440 AnthropicClient client = new();
1441
1442 var group = await client.Beta.Organization.RbacGroups.Update(
1443 "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
1444 new() { Name = "Platform Engineering" }
1445 );
1446
1447 Console.WriteLine($"id: {group.ID}");
1448 Console.WriteLine($"name: {group.Name}");
1449 ```
1450
1451 ```go Go
1452 client := anthropic.NewClient()
1453
1454 group, err := client.Beta.Organization.RBACGroups.Update(
1455 context.Background(),
1456 "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
1457 anthropic.BetaOrganizationRBACGroupUpdateParams{
1458 Name: anthropic.String("Platform Engineering"),
1459 },
1460 )
1461 if err != nil {
1462 log.Fatal(err)
1463 }
1464
1465 fmt.Printf("id: %s\n", group.ID)
1466 fmt.Printf("name: %s\n", group.Name)
1467 ```
1468
1469 ```java Java
1470 import com.anthropic.models.beta.organization.rbacgroups.RbacGroupUpdateParams;
1471
1472 void main() {
1473 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1474
1475 var params = RbacGroupUpdateParams.builder()
1476 .name("Platform Engineering")
1477 .build();
1478 var group = client.beta().organization().rbacGroups()
1479 .update("rbac_group_01UvWxYzAbCdEfGhIjKlMn", params);
1480
1481 IO.println("id: " + group.id());
1482 IO.println("name: " + group.name());
1483 }
1484 ```
1485
1486 ```php PHP
1487 $client = new Client();
1488
1489 $group = $client->beta->organization->rbacGroups->update(
1490 rbacGroupID: 'rbac_group_01UvWxYzAbCdEfGhIjKlMn',
1491 name: 'Platform Engineering',
1492 );
1493
1494 echo "id: {$group->id}\n";
1495 echo "name: {$group->name}\n";
1496 ```
1497
1498 ```ruby Ruby
1499 client = Anthropic::Client.new
1500
1501 rbac_group_id = "rbac_group_01UvWxYzAbCdEfGhIjKlMn"
1502 group = client.beta.organization.rbac_groups.update(rbac_group_id, name: "Platform Engineering")
1503
1504 puts "id: #{group.id}"
1505 puts "name: #{group.name}"
1506 ```
1507</CodeGroup>
3381508
3391509### Delete a group
3401510
from line 1512
3421512
3431513For complete parameter details and response schemas, see [Delete group](https://platform.claude.com/docs/en/api/beta/organization/rbac_groups/delete) in the API reference.
3441514
345```bash cURL
346curl -X DELETE "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn" \
347 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
348 -H "anthropic-version: 2023-06-01"
349```
1515<CodeGroup>
1516 ```bash cURL
1517 curl -X DELETE "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn" \
1518 -H "x-api-key: $ANTHROPIC_API_KEY" \
1519 -H "anthropic-version: 2023-06-01"
1520 ```
1521
1522 ```bash CLI
1523 ant beta:organization:rbac-groups delete \
1524 --rbac-group-id rbac_group_01UvWxYzAbCdEfGhIjKlMn
1525 ```
1526
1527 ```python Python
1528 client = anthropic.Anthropic()
1529
1530 deleted_group = client.beta.organization.rbac_groups.delete(
1531 "rbac_group_01UvWxYzAbCdEfGhIjKlMn"
1532 )
1533
1534 print(f"id: {deleted_group.id}")
1535 ```
1536
1537 ```typescript TypeScript
1538 const client = new Anthropic();
1539
1540 const deletedGroup = await client.beta.organization.rbacGroups.delete(
1541 "rbac_group_01UvWxYzAbCdEfGhIjKlMn"
1542 );
1543
1544 console.log(`id: ${deletedGroup.id}`);
1545 ```
1546
1547 ```csharp C#
1548 AnthropicClient client = new();
1549
1550 var deletedGroup = await client.Beta.Organization.RbacGroups.Delete(
1551 "rbac_group_01UvWxYzAbCdEfGhIjKlMn"
1552 );
1553
1554 Console.WriteLine($"id: {deletedGroup.ID}");
1555 ```
1556
1557 ```go Go
1558 client := anthropic.NewClient()
1559
1560 deletedGroup, err := client.Beta.Organization.RBACGroups.Delete(context.Background(), "rbac_group_01UvWxYzAbCdEfGhIjKlMn")
1561 if err != nil {
1562 log.Fatal(err)
1563 }
1564
1565 fmt.Printf("id: %s\n", deletedGroup.ID)
1566 ```
1567
1568 ```java Java
1569 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1570
1571 var deletedGroup = client.beta().organization().rbacGroups()
1572 .delete("rbac_group_01UvWxYzAbCdEfGhIjKlMn");
1573
1574 IO.println("id: " + deletedGroup.id());
1575 ```
1576
1577 ```php PHP
1578 $client = new Client();
1579
1580 $deletedGroup = $client->beta->organization->rbacGroups->delete(
1581 rbacGroupID: 'rbac_group_01UvWxYzAbCdEfGhIjKlMn',
1582 );
1583
1584 echo "id: {$deletedGroup->id}\n";
1585 ```
1586
1587 ```ruby Ruby
1588 client = Anthropic::Client.new
1589
1590 rbac_group_id = "rbac_group_01UvWxYzAbCdEfGhIjKlMn"
1591 deleted_group = client.beta.organization.rbac_groups.delete(rbac_group_id)
1592
1593 puts "id: #{deleted_group.id}"
1594 ```
1595</CodeGroup>
3501596
3511597```json
3521598{
from line 1607
3611607
3621608For complete parameter details and response schemas, see [List group members](https://platform.claude.com/docs/en/api/beta/organization/rbac_groups/members/list) in the API reference.
3631609
364```bash cURL
365curl "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn/members?limit=100" \
366 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
367 -H "anthropic-version: 2023-06-01"
368```
1610<CodeGroup>
1611 ```bash cURL
1612 curl "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn/members?limit=100" \
1613 -H "x-api-key: $ANTHROPIC_API_KEY" \
1614 -H "anthropic-version: 2023-06-01"
1615 ```
1616
1617 ```bash CLI
1618 ant beta:organization:rbac-groups:members list \
1619 --rbac-group-id rbac_group_01UvWxYzAbCdEfGhIjKlMn \
1620 --limit 100
1621 ```
1622
1623 ```python Python
1624 client = anthropic.Anthropic()
1625
1626 members = client.beta.organization.rbac_groups.members.list(
1627 "rbac_group_01UvWxYzAbCdEfGhIjKlMn", limit=100
1628 )
1629
1630 for member in members:
1631 print(f"{member.user_id}: {member.email}")
1632 ```
1633
1634 ```typescript TypeScript
1635 const client = new Anthropic();
1636
1637 const members = await client.beta.organization.rbacGroups.members.list(
1638 "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
1639 { limit: 100 }
1640 );
1641
1642 for await (const member of members) {
1643 console.log(`${member.user_id}: ${member.email}`);
1644 }
1645 ```
1646
1647 ```csharp C#
1648 AnthropicClient client = new();
1649
1650 var page = await client.Beta.Organization.RbacGroups.Members.List(
1651 "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
1652 new() { Limit = 100 }
1653 );
1654
1655 await foreach (var member in page.Paginate())
1656 {
1657 Console.WriteLine($"{member.UserID}: {member.Email}");
1658 }
1659 ```
1660
1661 ```go Go
1662 client := anthropic.NewClient()
1663
1664 members := client.Beta.Organization.RBACGroups.Members.ListAutoPaging(
1665 context.Background(),
1666 "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
1667 anthropic.BetaOrganizationRBACGroupMemberListParams{
1668 Limit: anthropic.Int(100),
1669 },
1670 )
1671
1672 for members.Next() {
1673 member := members.Current()
1674 fmt.Printf("%s: %s\n", member.UserID, member.Email)
1675 }
1676 if err := members.Err(); err != nil {
1677 log.Fatal(err)
1678 }
1679 ```
1680
1681 ```java Java
1682 import com.anthropic.models.beta.organization.rbacgroups.members.MemberListParams;
1683
1684 void main() {
1685 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1686
1687 var params = MemberListParams.builder()
1688 .limit(100)
1689 .build();
1690 var members = client.beta().organization().rbacGroups().members()
1691 .list("rbac_group_01UvWxYzAbCdEfGhIjKlMn", params);
1692
1693 for (var member : members.autoPager()) {
1694 IO.println(member.userId() + ": " + member.email());
1695 }
1696 }
1697 ```
1698
1699 ```php PHP
1700 $client = new Client();
1701
1702 $members = $client->beta->organization->rbacGroups->members->list(
1703 rbacGroupID: 'rbac_group_01UvWxYzAbCdEfGhIjKlMn',
1704 limit: 100,
1705 );
1706
1707 foreach ($members->pagingEachItem() as $member) {
1708 echo "{$member->userID}: {$member->email}\n";
1709 }
1710 ```
1711
1712 ```ruby Ruby
1713 client = Anthropic::Client.new
1714
1715 rbac_group_id = "rbac_group_01UvWxYzAbCdEfGhIjKlMn"
1716 members = client.beta.organization.rbac_groups.members.list(rbac_group_id, limit: 100)
1717
1718 members.auto_paging_each do |member|
1719 puts "#{member.user_id}: #{member.email}"
1720 end
1721 ```
1722</CodeGroup>
3691723
3701724```json
3711725{
from line 1744
3901744
3911745For complete parameter details and response schemas, see [Add group member](https://platform.claude.com/docs/en/api/beta/organization/rbac_groups/members/add) in the API reference.
3921746
393```bash cURL
394curl -X POST "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn/members" \
395 -H "content-type: application/json" \
396 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
397 -H "anthropic-version: 2023-06-01" \
398 -d '{"user_id": "user_01AbCdEfGhIjKlMnOpQrSt"}'
399```
1747<CodeGroup>
1748 ```bash cURL
1749 curl -X POST "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn/members" \
1750 -H "content-type: application/json" \
1751 -H "x-api-key: $ANTHROPIC_API_KEY" \
1752 -H "anthropic-version: 2023-06-01" \
1753 -d '{"user_id": "user_01AbCdEfGhIjKlMnOpQrSt"}'
1754 ```
1755
1756 ```bash CLI
1757 ant beta:organization:rbac-groups:members add \
1758 --rbac-group-id rbac_group_01UvWxYzAbCdEfGhIjKlMn \
1759 --user-id user_01AbCdEfGhIjKlMnOpQrSt
1760 ```
1761
1762 ```python Python
1763 client = anthropic.Anthropic()
1764
1765 member = client.beta.organization.rbac_groups.members.add(
1766 "rbac_group_01UvWxYzAbCdEfGhIjKlMn", user_id="user_01AbCdEfGhIjKlMnOpQrSt"
1767 )
1768
1769 print(f"user_id: {member.user_id}")
1770 print(f"email: {member.email}")
1771 ```
1772
1773 ```typescript TypeScript
1774 const client = new Anthropic();
1775
1776 const member = await client.beta.organization.rbacGroups.members.add(
1777 "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
1778 { user_id: "user_01AbCdEfGhIjKlMnOpQrSt" }
1779 );
1780
1781 console.log(`user_id: ${member.user_id}`);
1782 console.log(`email: ${member.email}`);
1783 ```
1784
1785 ```csharp C#
1786 AnthropicClient client = new();
1787
1788 var member = await client.Beta.Organization.RbacGroups.Members.Add(
1789 "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
1790 new() { UserID = "user_01AbCdEfGhIjKlMnOpQrSt" }
1791 );
1792
1793 Console.WriteLine($"user_id: {member.UserID}");
1794 Console.WriteLine($"email: {member.Email}");
1795 ```
1796
1797 ```go Go
1798 client := anthropic.NewClient()
1799
1800 member, err := client.Beta.Organization.RBACGroups.Members.Add(
1801 context.Background(),
1802 "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
1803 anthropic.BetaOrganizationRBACGroupMemberAddParams{
1804 UserID: "user_01AbCdEfGhIjKlMnOpQrSt",
1805 },
1806 )
1807 if err != nil {
1808 log.Fatal(err)
1809 }
1810
1811 fmt.Printf("user_id: %s\n", member.UserID)
1812 fmt.Printf("email: %s\n", member.Email)
1813 ```
1814
1815 ```java Java
1816 import com.anthropic.models.beta.organization.rbacgroups.members.MemberAddParams;
1817
1818 void main() {
1819 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1820
1821 var params = MemberAddParams.builder()
1822 .userId("user_01AbCdEfGhIjKlMnOpQrSt")
1823 .build();
1824 var member = client.beta().organization().rbacGroups().members()
1825 .add("rbac_group_01UvWxYzAbCdEfGhIjKlMn", params);
1826
1827 IO.println("user_id: " + member.userId());
1828 IO.println("email: " + member.email());
1829 }
1830 ```
1831
1832 ```php PHP
1833 $client = new Client();
1834
1835 $member = $client->beta->organization->rbacGroups->members->add(
1836 rbacGroupID: 'rbac_group_01UvWxYzAbCdEfGhIjKlMn',
1837 userID: 'user_01AbCdEfGhIjKlMnOpQrSt',
1838 );
1839
1840 echo "user_id: {$member->userID}\n";
1841 echo "email: {$member->email}\n";
1842 ```
1843
1844 ```ruby Ruby
1845 client = Anthropic::Client.new
1846
1847 rbac_group_id = "rbac_group_01UvWxYzAbCdEfGhIjKlMn"
1848 member = client.beta.organization.rbac_groups.members.add(
1849 rbac_group_id,
1850 user_id: "user_01AbCdEfGhIjKlMnOpQrSt"
1851 )
1852
1853 puts "user_id: #{member.user_id}"
1854 puts "email: #{member.email}"
1855 ```
1856</CodeGroup>
4001857
4011858```json
4021859{
from line 1872
4151872
4161873For complete parameter details and response schemas, see [Remove group member](https://platform.claude.com/docs/en/api/beta/organization/rbac_groups/members/remove) in the API reference.
4171874
418```bash cURL
419curl -X DELETE "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn/members/user_01AbCdEfGhIjKlMnOpQrSt" \
420 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
421 -H "anthropic-version: 2023-06-01"
422```
1875<CodeGroup>
1876 ```bash cURL
1877 curl -X DELETE "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn/members/user_01AbCdEfGhIjKlMnOpQrSt" \
1878 -H "x-api-key: $ANTHROPIC_API_KEY" \
1879 -H "anthropic-version: 2023-06-01"
1880 ```
1881
1882 ```bash CLI
1883 ant beta:organization:rbac-groups:members remove \
1884 --rbac-group-id rbac_group_01UvWxYzAbCdEfGhIjKlMn \
1885 --user-id user_01AbCdEfGhIjKlMnOpQrSt
1886 ```
1887
1888 ```python Python
1889 client = anthropic.Anthropic()
1890
1891 removed_member = client.beta.organization.rbac_groups.members.remove(
1892 "user_01AbCdEfGhIjKlMnOpQrSt", rbac_group_id="rbac_group_01UvWxYzAbCdEfGhIjKlMn"
1893 )
1894
1895 print(f"user_id: {removed_member.user_id}")
1896 ```
1897
1898 ```typescript TypeScript
1899 const client = new Anthropic();
1900
1901 const removedMember = await client.beta.organization.rbacGroups.members.remove(
1902 "user_01AbCdEfGhIjKlMnOpQrSt",
1903 { rbac_group_id: "rbac_group_01UvWxYzAbCdEfGhIjKlMn" }
1904 );
1905
1906 console.log(`user_id: ${removedMember.user_id}`);
1907 ```
1908
1909 ```csharp C#
1910 AnthropicClient client = new();
1911
1912 var removedMember = await client.Beta.Organization.RbacGroups.Members.Remove(
1913 "user_01AbCdEfGhIjKlMnOpQrSt",
1914 new() { RbacGroupID = "rbac_group_01UvWxYzAbCdEfGhIjKlMn" }
1915 );
1916
1917 Console.WriteLine($"user_id: {removedMember.UserID}");
1918 ```
1919
1920 ```go Go
1921 client := anthropic.NewClient()
1922
1923 removedMember, err := client.Beta.Organization.RBACGroups.Members.Remove(
1924 context.Background(),
1925 "user_01AbCdEfGhIjKlMnOpQrSt",
1926 anthropic.BetaOrganizationRBACGroupMemberRemoveParams{
1927 RBACGroupID: "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
1928 },
1929 )
1930 if err != nil {
1931 log.Fatal(err)
1932 }
1933
1934 fmt.Printf("user_id: %s\n", removedMember.UserID)
1935 ```
1936
1937 ```java Java
1938 import com.anthropic.models.beta.organization.rbacgroups.members.MemberRemoveParams;
1939
1940 void main() {
1941 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1942
1943 var params = MemberRemoveParams.builder()
1944 .rbacGroupId("rbac_group_01UvWxYzAbCdEfGhIjKlMn")
1945 .build();
1946 var removedMember = client.beta().organization().rbacGroups().members()
1947 .remove("user_01AbCdEfGhIjKlMnOpQrSt", params);
1948
1949 IO.println("user_id: " + removedMember.userId());
1950 }
1951 ```
1952
1953 ```php PHP
1954 $client = new Client();
1955
1956 $removedMember = $client->beta->organization->rbacGroups->members->remove(
1957 userID: 'user_01AbCdEfGhIjKlMnOpQrSt',
1958 rbacGroupID: 'rbac_group_01UvWxYzAbCdEfGhIjKlMn',
1959 );
1960
1961 echo "user_id: {$removedMember->userID}\n";
1962 ```
1963
1964 ```ruby Ruby
1965 client = Anthropic::Client.new
1966
1967 rbac_group_id = "rbac_group_01UvWxYzAbCdEfGhIjKlMn"
1968 removed_member = client.beta.organization.rbac_groups.members.remove(
1969 "user_01AbCdEfGhIjKlMnOpQrSt",
1970 rbac_group_id: rbac_group_id
1971 )
1972
1973 puts "user_id: #{removed_member.user_id}"
1974 ```
1975</CodeGroup>
4231976
4241977```json
4251978{
from line 1995
4421995
4431996For complete parameter details and response schemas, see [List roles](https://platform.claude.com/docs/en/api/beta/organization/rbac_roles/list) in the API reference.
4441997
445```bash cURL
446curl "https://api.anthropic.com/v1/organizations/rbac_roles?limit=20" \
447 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
448 -H "anthropic-version: 2023-06-01"
449```
1998<CodeGroup>
1999 ```bash cURL
2000 curl "https://api.anthropic.com/v1/organizations/rbac_roles?limit=20" \
2001 -H "x-api-key: $ANTHROPIC_API_KEY" \
2002 -H "anthropic-version: 2023-06-01"
2003 ```
2004
2005 ```bash CLI
2006 ant beta:organization:rbac-roles list --limit 20
2007 ```
2008
2009 ```python Python
2010 client = anthropic.Anthropic()
2011
2012 roles = client.beta.organization.rbac_roles.list(limit=20)
2013
2014 for role in roles:
2015 print(f"{role.id}: {role.display_name}")
2016 ```
2017
2018 ```typescript TypeScript
2019 const client = new Anthropic();
2020
2021 const roles = await client.beta.organization.rbacRoles.list({ limit: 20 });
2022
2023 for await (const role of roles) {
2024 console.log(`${role.id}: ${role.display_name}`);
2025 }
2026 ```
2027
2028 ```csharp C#
2029 AnthropicClient client = new();
2030
2031 var page = await client.Beta.Organization.RbacRoles.List(new() { Limit = 20 });
2032
2033 await foreach (var role in page.Paginate())
2034 {
2035 Console.WriteLine($"{role.ID}: {role.DisplayName}");
2036 }
2037 ```
2038
2039 ```go Go
2040 client := anthropic.NewClient()
2041
2042 roles := client.Beta.Organization.RBACRoles.ListAutoPaging(context.Background(), anthropic.BetaOrganizationRBACRoleListParams{
2043 Limit: anthropic.Int(20),
2044 })
2045
2046 for roles.Next() {
2047 role := roles.Current()
2048 fmt.Printf("%s: %s\n", role.ID, role.DisplayName)
2049 }
2050 if err := roles.Err(); err != nil {
2051 log.Fatal(err)
2052 }
2053 ```
2054
2055 ```java Java
2056 import com.anthropic.models.beta.organization.rbacroles.RbacRoleListParams;
2057
2058 void main() {
2059 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
2060
2061 var params = RbacRoleListParams.builder()
2062 .limit(20)
2063 .build();
2064 var roles = client.beta().organization().rbacRoles().list(params);
2065
2066 for (var role : roles.autoPager()) {
2067 IO.println(role.id() + ": " + role.displayName());
2068 }
2069 }
2070 ```
2071
2072 ```php PHP
2073 $client = new Client();
2074
2075 $roles = $client->beta->organization->rbacRoles->list(limit: 20);
2076
2077 foreach ($roles->pagingEachItem() as $role) {
2078 echo "{$role->id}: {$role->displayName}\n";
2079 }
2080 ```
2081
2082 ```ruby Ruby
2083 client = Anthropic::Client.new
2084
2085 roles = client.beta.organization.rbac_roles.list(limit: 20)
2086
2087 roles.auto_paging_each do |role|
2088 puts "#{role.id}: #{role.display_name}"
2089 end
2090 ```
2091</CodeGroup>
4502092
4512093```json
4522094{
from line 2113
4712113
4722114For complete parameter details and response schemas, see [Get role](https://platform.claude.com/docs/en/api/beta/organization/rbac_roles/retrieve) in the API reference.
4732115
474```bash cURL
475curl "https://api.anthropic.com/v1/organizations/rbac_roles/rbac_role_01CdEfGhIjKlMnOpQrStUv" \
476 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
477 -H "anthropic-version: 2023-06-01"
478```
2116<CodeGroup>
2117 ```bash cURL
2118 curl "https://api.anthropic.com/v1/organizations/rbac_roles/rbac_role_01CdEfGhIjKlMnOpQrStUv" \
2119 -H "x-api-key: $ANTHROPIC_API_KEY" \
2120 -H "anthropic-version: 2023-06-01"
2121 ```
2122
2123 ```bash CLI
2124 ant beta:organization:rbac-roles retrieve \
2125 --rbac-role-id rbac_role_01CdEfGhIjKlMnOpQrStUv
2126 ```
2127
2128 ```python Python
2129 client = anthropic.Anthropic()
2130
2131 role = client.beta.organization.rbac_roles.retrieve("rbac_role_01CdEfGhIjKlMnOpQrStUv")
2132
2133 print(f"id: {role.id}")
2134 print(f"display_name: {role.display_name}")
2135 ```
2136
2137 ```typescript TypeScript
2138 const client = new Anthropic();
2139
2140 const role = await client.beta.organization.rbacRoles.retrieve(
2141 "rbac_role_01CdEfGhIjKlMnOpQrStUv"
2142 );
2143
2144 console.log(`id: ${role.id}`);
2145 console.log(`display_name: ${role.display_name}`);
2146 ```
2147
2148 ```csharp C#
2149 AnthropicClient client = new();
2150
2151 var role = await client.Beta.Organization.RbacRoles.Retrieve("rbac_role_01CdEfGhIjKlMnOpQrStUv");
2152
2153 Console.WriteLine($"id: {role.ID}");
2154 Console.WriteLine($"display_name: {role.DisplayName}");
2155 ```
2156
2157 ```go Go
2158 client := anthropic.NewClient()
2159
2160 role, err := client.Beta.Organization.RBACRoles.Get(context.Background(), "rbac_role_01CdEfGhIjKlMnOpQrStUv")
2161 if err != nil {
2162 log.Fatal(err)
2163 }
2164
2165 fmt.Printf("id: %s\n", role.ID)
2166 fmt.Printf("display_name: %s\n", role.DisplayName)
2167 ```
2168
2169 ```java Java
2170 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
2171
2172 var role = client.beta().organization().rbacRoles()
2173 .retrieve("rbac_role_01CdEfGhIjKlMnOpQrStUv");
2174
2175 IO.println("id: " + role.id());
2176 IO.println("display_name: " + role.displayName());
2177 ```
2178
2179 ```php PHP
2180 $client = new Client();
2181
2182 $role = $client->beta->organization->rbacRoles->retrieve(
2183 rbacRoleID: 'rbac_role_01CdEfGhIjKlMnOpQrStUv',
2184 );
2185
2186 echo "id: {$role->id}\n";
2187 echo "display_name: {$role->displayName}\n";
2188 ```
2189
2190 ```ruby Ruby
2191 client = Anthropic::Client.new
2192
2193 rbac_role_id = "rbac_role_01CdEfGhIjKlMnOpQrStUv"
2194 role = client.beta.organization.rbac_roles.retrieve(rbac_role_id)
2195
2196 puts "id: #{role.id}"
2197 puts "display_name: #{role.display_name}"
2198 ```
2199</CodeGroup>
4792200
4802201### List a role's permissions
4812202
from line 2206
4852206
4862207For complete parameter details and response schemas, see [List role permissions](https://platform.claude.com/docs/en/api/beta/organization/rbac_roles/permissions/list) in the API reference.
4872208
488```bash cURL
489curl "https://api.anthropic.com/v1/organizations/rbac_roles/rbac_role_01CdEfGhIjKlMnOpQrStUv/permissions?limit=20" \
490 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
491 -H "anthropic-version: 2023-06-01"
492```
2209<CodeGroup>
2210 ```bash cURL
2211 curl "https://api.anthropic.com/v1/organizations/rbac_roles/rbac_role_01CdEfGhIjKlMnOpQrStUv/permissions?limit=20" \
2212 -H "x-api-key: $ANTHROPIC_API_KEY" \
2213 -H "anthropic-version: 2023-06-01"
2214 ```
2215
2216 ```bash CLI
2217 ant beta:organization:rbac-roles:permissions list \
2218 --rbac-role-id rbac_role_01CdEfGhIjKlMnOpQrStUv \
2219 --limit 20
2220 ```
2221
2222 ```python Python
2223 client = anthropic.Anthropic()
2224
2225 permissions = client.beta.organization.rbac_roles.permissions.list(
2226 "rbac_role_01CdEfGhIjKlMnOpQrStUv", limit=20
2227 )
2228
2229 for permission in permissions:
2230 print(permission.action)
2231 ```
2232
2233 ```typescript TypeScript
2234 const client = new Anthropic();
2235
2236 const permissions = await client.beta.organization.rbacRoles.permissions.list(
2237 "rbac_role_01CdEfGhIjKlMnOpQrStUv",
2238 { limit: 20 }
2239 );
2240
2241 for await (const permission of permissions) {
2242 console.log(permission.action);
2243 }
2244 ```
2245
2246 ```csharp C#
2247 AnthropicClient client = new();
2248
2249 var page = await client.Beta.Organization.RbacRoles.Permissions.List(
2250 "rbac_role_01CdEfGhIjKlMnOpQrStUv",
2251 new() { Limit = 20 }
2252 );
2253
2254 await foreach (var permission in page.Paginate())
2255 {
2256 Console.WriteLine(permission.Action);
2257 }
2258 ```
2259
2260 ```go Go
2261 client := anthropic.NewClient()
2262
2263 permissions := client.Beta.Organization.RBACRoles.Permissions.ListAutoPaging(
2264 context.Background(),
2265 "rbac_role_01CdEfGhIjKlMnOpQrStUv",
2266 anthropic.BetaOrganizationRBACRolePermissionListParams{
2267 Limit: anthropic.Int(20),
2268 },
2269 )
2270
2271 for permissions.Next() {
2272 permission := permissions.Current()
2273 fmt.Println(permission.Action)
2274 }
2275 if err := permissions.Err(); err != nil {
2276 log.Fatal(err)
2277 }
2278 ```
2279
2280 ```java Java
2281 import com.anthropic.models.beta.organization.rbacroles.permissions.PermissionListParams;
2282
2283 void main() {
2284 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
2285
2286 var params = PermissionListParams.builder()
2287 .limit(20)
2288 .build();
2289 var permissions = client.beta().organization().rbacRoles().permissions()
2290 .list("rbac_role_01CdEfGhIjKlMnOpQrStUv", params);
2291
2292 for (var permission : permissions.autoPager()) {
2293 IO.println(permission.action());
2294 }
2295 }
2296 ```
2297
2298 ```php PHP
2299 $client = new Client();
2300
2301 $permissions = $client->beta->organization->rbacRoles->permissions->list(
2302 rbacRoleID: 'rbac_role_01CdEfGhIjKlMnOpQrStUv',
2303 limit: 20,
2304 );
2305
2306 foreach ($permissions->pagingEachItem() as $permission) {
2307 echo "{$permission->action}\n";
2308 }
2309 ```
2310
2311 ```ruby Ruby
2312 client = Anthropic::Client.new
2313
2314 rbac_role_id = "rbac_role_01CdEfGhIjKlMnOpQrStUv"
2315 permissions = client.beta.organization.rbac_roles.permissions.list(rbac_role_id, limit: 20)
2316
2317 permissions.auto_paging_each do |permission|
2318 puts permission.action
2319 end
2320 ```
2321</CodeGroup>
4932322
4942323```json
4952324{
from line 2352
5232352
52423531. Look up the member by email:
5252354
526 ```bash cURL
527 curl "https://api.anthropic.com/v1/organizations/[email protected]" \
528 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
529 -H "anthropic-version: 2023-06-01"
530 ```
2355 <CodeGroup>
2356 ```bash cURL
2357 curl "https://api.anthropic.com/v1/organizations/[email protected]" \
2358 -H "x-api-key: $ANTHROPIC_API_KEY" \
2359 -H "anthropic-version: 2023-06-01"
2360 ```
2361
2362 ```bash CLI
2363 ant organization:users list --email [email protected]
2364 ```
2365
2366 ```python Python
2367 client = anthropic.Anthropic()
2368
2369 users = client.organization.users.list(email="[email protected]")
2370
2371 for user in users:
2372 print(f"{user.id}: {user.email} ({user.role})")
2373 ```
2374
2375 ```typescript TypeScript
2376 const client = new Anthropic();
2377
2378 const users = await client.organization.users.list({ email: "[email protected]" });
2379
2380 for await (const user of users) {
2381 console.log(`${user.id}: ${user.email} (${user.role})`);
2382 }
2383 ```
2384
2385 ```csharp C#
2386 AnthropicClient client = new();
2387
2388 var page = await client.Organization.Users.List(new() { Email = "[email protected]" });
2389
2390 await foreach (var user in page.Paginate())
2391 {
2392 Console.WriteLine($"{user.ID}: {user.Email} ({user.Role.Raw()})");
2393 }
2394 ```
2395
2396 ```go Go
2397 client := anthropic.NewClient()
2398
2399 users := client.Organization.Users.ListAutoPaging(context.Background(), anthropic.OrganizationUserListParams{
2400 Email: anthropic.String("[email protected]"),
2401 })
2402
2403 for users.Next() {
2404 user := users.Current()
2405 fmt.Printf("%s: %s (%s)\n", user.ID, user.Email, user.Role)
2406 }
2407 if err := users.Err(); err != nil {
2408 log.Fatal(err)
2409 }
2410 ```
2411
2412 ```java Java
2413 import com.anthropic.models.organization.users.UserListParams;
2414
2415 void main() {
2416 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
2417
2418 var params = UserListParams.builder()
2419 .email("[email protected]")
2420 .build();
2421 var users = client.organization().users().list(params);
2422
2423 for (var user : users.autoPager()) {
2424 IO.println(user.id() + ": " + user.email() + " (" + user.role().asString() + ")");
2425 }
2426 }
2427 ```
2428
2429 ```php PHP
2430 $client = new Client();
2431
2432 $users = $client->organization->users->list(email: '[email protected]');
2433
2434 foreach ($users->pagingEachItem() as $user) {
2435 echo "{$user->id}: {$user->email} ({$user->role})\n";
2436 }
2437 ```
2438
2439 ```ruby Ruby
2440 client = Anthropic::Client.new
2441
2442 users = client.organization.users.list(email: "[email protected]")
2443
2444 users.auto_paging_each do |user|
2445 puts "#{user.id}: #{user.email} (#{user.role})"
2446 end
2447 ```
2448 </CodeGroup>
5312449
53224502. Remove them with `DELETE /v1/organizations/users/{user_id}`, using the `id` from the response. Their seat, if any, returns to the pool.
5332451
5342452
No line in this hunk matches that.