Follow Discord
Sweep 22 Oct 2026 · 21:04Z Build v2.1.309 528 read Stable v2.1.308 Latest v2.1.309 Next v2.1.309 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

wif-admin-api changedmanage-claude/wif-admin-api

Nearest release: v2.1.247, published under an hour 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+1,149added
Lines−82removed
From line 12 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits8to this page, all time

The whole hunk

from line 12, old and new numbered
/
lines

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 12
1212 
1313### Interactive (your terminal)
1414 
15Log in with the [`ant` CLI](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/quickstart) under a dedicated profile, requesting the `org:admin` scope (see [Admin access](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/authentication#admin-access)), then export the bearer token:
15Log in with the [`ant` CLI](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/quickstart) under a dedicated profile, requesting the `org:admin` scope (see [Admin access](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/authentication#admin-access)), then export the bearer token. Logging in with `--profile admin` stores the `org:admin` credential under its own profile name and also makes it the CLI's active profile, and the exported variable applies to every SDK and CLI call in that shell; so use a shell you reserve for administration, unset the variable when you are done, and switch the CLI back with `ant profile activate default`:
1616 
1717```bash CLI
1818ant auth login --profile admin --scope "org:admin"
19export ANTHROPIC_OAUTH_TOKEN=$(ant auth print-credentials --profile admin --access-token)
19export ANTHROPIC_AUTH_TOKEN=$(ant auth print-credentials --profile admin --access-token)
2020```
2121 
2222Interactive tokens are short-lived; if requests start returning 401, re-run the export command (it refreshes the token automatically).
23 
24The SDKs and the `ant` CLI read `ANTHROPIC_AUTH_TOKEN` automatically; leave `ANTHROPIC_API_KEY` unset in the same shell, because these endpoints reject API keys and some clients prefer the key when both are set.
2325 
2426### Workload (CI and automation)
2527 
from line 41
3941 </Step>
4042 
4143 <Step title="Exchange the workload's identity token">
42 At runtime, the workload exchanges the JWT from its identity provider for a short-lived `org:admin` bearer token using the same [token exchange](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#authenticate-from-your-workload) as any other federated workload.
44 A workload that uses one of the SDKs or the `ant` CLI does not perform the exchange itself. Point the client at the rule with the federation environment variables and construct it with no arguments, exactly as for inference in [Construct the SDK client](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#construct-the-sdk-client); the client exchanges the identity token on the first request and, before the resulting access token expires, re-reads the identity token and exchanges it again:
45 
46 ```bash
47 export ANTHROPIC_FEDERATION_RULE_ID=fdrl_... # the org:admin rule from step 1
48 export ANTHROPIC_ORGANIZATION_ID=00000000-0000-0000-0000-000000000000
49 export ANTHROPIC_SERVICE_ACCOUNT_ID=svac_... # the rule's target service account
50 export ANTHROPIC_IDENTITY_TOKEN_FILE=/path/to/jwt # or ANTHROPIC_IDENTITY_TOKEN
51 # ANTHROPIC_WORKSPACE_ID is required only if the rule is enabled for all
52 # workspaces or more than one; the org:admin endpoints ignore the binding.
53 unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN # both take precedence over federation
54 ```
55 
56 The `ant` CLI reads the same variables, or takes `--federation-rule`, `--organization-id`, `--service-account-id`, and `--identity-token-file` flags. For a workload that runs more than one `ant` command, use a [federation profile](https://platform.claude.com/docs/en/manage-claude/wif-reference#profile-configuration-file) rather than flags or environment variables: with flags or variables the CLI exchanges the identity token again in every process, and identity tokens that carry a `jti` claim (GitHub Actions tokens do) are accepted only once, so a second command would be rejected; a profile is also the only way to give the CLI a `workspace_id` for the exchange when the rule is enabled for all workspaces or more than one, because unlike the SDKs the CLI does not pass `ANTHROPIC_WORKSPACE_ID` or `--workspace-id` into the exchange. Every SDK also accepts the same settings as explicit constructor arguments, shown per language in [Construct the SDK client](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#construct-the-sdk-client). See [Environment variables](https://platform.claude.com/docs/en/manage-claude/wif-reference#environment-variables) and [Credential precedence](https://platform.claude.com/docs/en/manage-claude/wif-reference#credential-precedence) for the full list and ordering.
57 
58 A workload that calls the API with curl exchanges the JWT for a short-lived `org:admin` bearer token itself, using the same [token exchange](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#authenticate-from-your-workload) as any other federated workload, and sends it in the `authorization: Bearer` header.
4359 </Step>
4460 
4561 <Step title="Manage issuers and workspace-scoped rules through the API">
46 With the minted token in `ANTHROPIC_OAUTH_TOKEN`, the workload creates and manages your federation configuration using the endpoints on this page.
62 With the client configured (or, for curl, the minted token in `ANTHROPIC_AUTH_TOKEN`), the workload creates and manages your federation configuration using the endpoints on this page.
4763 </Step>
4864</Steps>
4965 
from line 69
5369 
5470All endpoints live under `https://api.anthropic.com/v1/organizations/`. Every request to the federation and service-account endpoints needs the API version header and the bearer token:
5571 
56```bash cURL
57curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/service_accounts" \
58 -H "anthropic-version: 2023-06-01" \
59 -H "authorization: Bearer $ANTHROPIC_OAUTH_TOKEN"
60```
72In the SDKs these endpoints are `client.beta.organization.service_accounts`, `client.beta.organization.federation.issuers`, and `client.beta.organization.federation.rules` (`ant beta:organization:service-accounts`, `federation:issuers`, and `federation:rules` in the CLI). The SDK and CLI examples construct the default client, which sends the bearer token from `ANTHROPIC_AUTH_TOKEN`, or, in an automated workload, performs the federation exchange itself as described in [Bootstrap a workload to manage WIF](https://platform.claude.com/docs/en/manage-claude/wif-admin-api#bootstrap-a-workload-to-manage-wif). SDK list methods fetch further pages on demand, so `limit` sets the page size; the PHP and Ruby examples read one page.
73 
74<CodeGroup>
75 ```bash cURL
76 curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/service_accounts" \
77 -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
78 -H "anthropic-version: 2023-06-01"
79 ```
80 
81 ```bash CLI
82 ant beta:organization:service-accounts list
83 ```
84 
85 ```python Python
86 client = anthropic.Anthropic()
87 
88 service_accounts = client.beta.organization.service_accounts.list()
89 
90 for service_account in service_accounts:
91 print(f"{service_account.id}: {service_account.name}")
92 ```
93 
94 ```typescript TypeScript
95 const client = new Anthropic();
96 
97 for await (const serviceAccount of client.beta.organization.serviceAccounts.list()) {
98 console.log(`${serviceAccount.id}: ${serviceAccount.name}`);
99 }
100 ```
101 
102 ```csharp C#
103 AnthropicClient client = new();
104 
105 var page = await client.Beta.Organization.ServiceAccounts.List();
106 
107 await foreach (var serviceAccount in page.Paginate())
108 {
109 Console.WriteLine($"{serviceAccount.ID}: {serviceAccount.Name}");
110 }
111 ```
112 
113 ```go Go
114 client := anthropic.NewClient()
115 
116 serviceAccounts := client.Beta.Organization.ServiceAccounts.ListAutoPaging(context.Background(), anthropic.BetaOrganizationServiceAccountListParams{})
117 
118 for serviceAccounts.Next() {
119 serviceAccount := serviceAccounts.Current()
120 fmt.Printf("%s: %s\n", serviceAccount.ID, serviceAccount.Name)
121 }
122 if err := serviceAccounts.Err(); err != nil {
123 log.Fatal(err)
124 }
125 ```
126 
127 ```java Java
128 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
129 
130 var serviceAccounts = client.beta().organization().serviceAccounts().list();
131 
132 for (var serviceAccount : serviceAccounts.autoPager()) {
133 IO.println(serviceAccount.id() + ": " + serviceAccount.name());
134 }
135 ```
136 
137 ```php PHP
138 $client = new Client();
139 
140 $serviceAccounts = $client->beta->organization->serviceAccounts->list();
141 
142 foreach ($serviceAccounts->getItems() as $serviceAccount) {
143 echo "{$serviceAccount->id}: {$serviceAccount->name}\n";
144 }
145 ```
146 
147 ```ruby Ruby
148 client = Anthropic::Client.new
149 
150 service_accounts = client.beta.organization.service_accounts.list
151 
152 service_accounts.data.each do |service_account|
153 puts "#{service_account.id}: #{service_account.name}"
154 end
155 ```
156</CodeGroup>
61157 
62158Admin API keys are not accepted on these endpoints; the Admin API page's `x-api-key` examples do not apply here.
63159 
from line 161
65161 
66162A [service account](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#service-accounts) (`svac_...`) is the non-human identity that a federated token acts as. Set `organization_role` to `developer`.
67163 
68```bash cURL
69# Create a service account
70curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/service_accounts" \
71 -H "anthropic-version: 2023-06-01" \
72 -H "authorization: Bearer $ANTHROPIC_OAUTH_TOKEN" \
73 -H "content-type: application/json" \
74 -d '{
75 "name": "inference-worker",
76 "organization_role": "developer"
77 }'
78 
79# List service accounts
80curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/service_accounts?limit=20" \
81 -H "anthropic-version: 2023-06-01" \
82 -H "authorization: Bearer $ANTHROPIC_OAUTH_TOKEN"
83 
84# Archive a service account
85curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/organizations/service_accounts/svac_.../archive" \
86 -H "anthropic-version: 2023-06-01" \
87 -H "authorization: Bearer $ANTHROPIC_OAUTH_TOKEN"
88```
164Create a service account:
165 
166<CodeGroup>
167 ```bash cURL
168 curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/service_accounts" \
169 -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
170 -H "anthropic-version: 2023-06-01" \
171 -H "content-type: application/json" \
172 -d '{
173 "name": "inference-worker",
174 "organization_role": "developer"
175 }'
176 ```
177 
178 ```bash CLI
179 ant beta:organization:service-accounts create \
180 --name inference-worker \
181 --organization-role developer
182 ```
183 
184 ```python Python
185 client = anthropic.Anthropic()
186 
187 service_account = client.beta.organization.service_accounts.create(
188 name="inference-worker", organization_role="developer"
189 )
190 
191 print(f"id: {service_account.id}")
192 print(f"name: {service_account.name}")
193 ```
194 
195 ```typescript TypeScript
196 const client = new Anthropic();
197 
198 const serviceAccount = await client.beta.organization.serviceAccounts.create({
199 name: "inference-worker",
200 organization_role: "developer"
201 });
202 
203 console.log(`id: ${serviceAccount.id}`);
204 console.log(`name: ${serviceAccount.name}`);
205 ```
206 
207 ```csharp C#
208 using Anthropic.Models.Beta.Organization.ServiceAccounts;
209 
210 AnthropicClient client = new();
211 
212 var serviceAccount = await client.Beta.Organization.ServiceAccounts.Create(new()
213 {
214 Name = "inference-worker",
215 OrganizationRole = OrganizationRole.Developer
216 });
217 
218 Console.WriteLine($"id: {serviceAccount.ID}");
219 Console.WriteLine($"name: {serviceAccount.Name}");
220 ```
221 
222 ```go Go
223 client := anthropic.NewClient()
224 
225 serviceAccount, err := client.Beta.Organization.ServiceAccounts.New(context.Background(), anthropic.BetaOrganizationServiceAccountNewParams{
226 Name: "inference-worker",
227 OrganizationRole: anthropic.BetaOrganizationServiceAccountNewParamsOrganizationRoleDeveloper,
228 })
229 if err != nil {
230 log.Fatal(err)
231 }
232 
233 fmt.Printf("id: %s\n", serviceAccount.ID)
234 fmt.Printf("name: %s\n", serviceAccount.Name)
235 ```
236 
237 ```java Java
238 import com.anthropic.models.beta.organization.serviceaccounts.ServiceAccountCreateParams;
239 
240 void main() {
241 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
242 
243 var params = ServiceAccountCreateParams.builder()
244 .name("inference-worker")
245 .organizationRole(ServiceAccountCreateParams.OrganizationRole.DEVELOPER)
246 .build();
247 var serviceAccount = client.beta().organization().serviceAccounts().create(params);
248 
249 IO.println("id: " + serviceAccount.id());
250 IO.println("name: " + serviceAccount.name());
251 }
252 ```
253 
254 ```php PHP
255 use Anthropic\Beta\Organization\ServiceAccounts\ServiceAccountCreateParams\OrganizationRole;
256 // ...
257 
258 $client = new Client();
259 
260 $serviceAccount = $client->beta->organization->serviceAccounts->create(
261 name: 'inference-worker',
262 organizationRole: OrganizationRole::DEVELOPER,
263 );
264 
265 echo "id: {$serviceAccount->id}\n";
266 echo "name: {$serviceAccount->name}\n";
267 ```
268 
269 ```ruby Ruby
270 client = Anthropic::Client.new
271 
272 service_account = client.beta.organization.service_accounts.create(
273 name: "inference-worker",
274 organization_role: :developer
275 )
276 
277 puts "id: #{service_account.id}"
278 puts "name: #{service_account.name}"
279 ```
280</CodeGroup>
281 
282List service accounts:
283 
284<CodeGroup>
285 ```bash cURL
286 curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/service_accounts?limit=20" \
287 -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
288 -H "anthropic-version: 2023-06-01"
289 ```
290 
291 ```bash CLI
292 ant beta:organization:service-accounts list --limit 20
293 ```
294 
295 ```python Python
296 client = anthropic.Anthropic()
297 
298 service_accounts = client.beta.organization.service_accounts.list(limit=20)
299 
300 for service_account in service_accounts:
301 print(f"{service_account.id}: {service_account.name}")
302 ```
303 
304 ```typescript TypeScript
305 const client = new Anthropic();
306 
307 for await (const serviceAccount of client.beta.organization.serviceAccounts.list({
308 limit: 20
309 })) {
310 console.log(`${serviceAccount.id}: ${serviceAccount.name}`);
311 }
312 ```
313 
314 ```csharp C#
315 AnthropicClient client = new();
316 
317 var page = await client.Beta.Organization.ServiceAccounts.List(new() { Limit = 20 });
318 
319 await foreach (var serviceAccount in page.Paginate())
320 {
321 Console.WriteLine($"{serviceAccount.ID}: {serviceAccount.Name}");
322 }
323 ```
324 
325 ```go Go
326 client := anthropic.NewClient()
327 
328 serviceAccounts := client.Beta.Organization.ServiceAccounts.ListAutoPaging(context.Background(), anthropic.BetaOrganizationServiceAccountListParams{
329 Limit: anthropic.Int(20),
330 })
331 
332 for serviceAccounts.Next() {
333 serviceAccount := serviceAccounts.Current()
334 fmt.Printf("%s: %s\n", serviceAccount.ID, serviceAccount.Name)
335 }
336 if err := serviceAccounts.Err(); err != nil {
337 log.Fatal(err)
338 }
339 ```
340 
341 ```java Java
342 import com.anthropic.models.beta.organization.serviceaccounts.ServiceAccountListParams;
343 
344 void main() {
345 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
346 
347 var params = ServiceAccountListParams.builder()
348 .limit(20)
349 .build();
350 var serviceAccounts = client.beta().organization().serviceAccounts().list(params);
351 
352 for (var serviceAccount : serviceAccounts.autoPager()) {
353 IO.println(serviceAccount.id() + ": " + serviceAccount.name());
354 }
355 }
356 ```
357 
358 ```php PHP
359 $client = new Client();
360 
361 $serviceAccounts = $client->beta->organization->serviceAccounts->list(limit: 20);
362 
363 foreach ($serviceAccounts->getItems() as $serviceAccount) {
364 echo "{$serviceAccount->id}: {$serviceAccount->name}\n";
365 }
366 ```
367 
368 ```ruby Ruby
369 client = Anthropic::Client.new
370 
371 service_accounts = client.beta.organization.service_accounts.list(limit: 20)
372 
373 service_accounts.data.each do |service_account|
374 puts "#{service_account.id}: #{service_account.name}"
375 end
376 ```
377</CodeGroup>
378 
379Archive a service account:
380 
381<CodeGroup>
382 ```bash cURL
383 curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/organizations/service_accounts/svac_01ABCDEFabcdef0123456789XY/archive" \
384 -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
385 -H "anthropic-version: 2023-06-01"
386 ```
387 
388 ```bash CLI
389 ant beta:organization:service-accounts archive svac_01ABCDEFabcdef0123456789XY
390 ```
391 
392 ```python Python
393 client = anthropic.Anthropic()
394 
395 service_account = client.beta.organization.service_accounts.archive(
396 "svac_01ABCDEFabcdef0123456789XY"
397 )
398 
399 print(f"id: {service_account.id}")
400 print(f"archived_at: {service_account.archived_at}")
401 ```
402 
403 ```typescript TypeScript
404 const client = new Anthropic();
405 
406 const serviceAccount = await client.beta.organization.serviceAccounts.archive(
407 "svac_01ABCDEFabcdef0123456789XY"
408 );
409 
410 console.log(`id: ${serviceAccount.id}`);
411 console.log(`archived_at: ${serviceAccount.archived_at}`);
412 ```
413 
414 ```csharp C#
415 AnthropicClient client = new();
416 
417 var serviceAccount = await client.Beta.Organization.ServiceAccounts.Archive(
418 "svac_01ABCDEFabcdef0123456789XY"
419 );
420 
421 Console.WriteLine($"id: {serviceAccount.ID}");
422 Console.WriteLine($"archived_at: {serviceAccount.ArchivedAt:O}");
423 ```
424 
425 ```go Go
426 client := anthropic.NewClient()
427 
428 serviceAccount, err := client.Beta.Organization.ServiceAccounts.Archive(
429 context.Background(),
430 "svac_01ABCDEFabcdef0123456789XY",
431 anthropic.BetaOrganizationServiceAccountArchiveParams{},
432 )
433 if err != nil {
434 log.Fatal(err)
435 }
436 
437 fmt.Printf("id: %s\n", serviceAccount.ID)
438 fmt.Printf("archived_at: %s\n", serviceAccount.ArchivedAt)
439 ```
440 
441 ```java Java
442 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
443 
444 var serviceAccount = client.beta().organization().serviceAccounts()
445 .archive("svac_01ABCDEFabcdef0123456789XY");
446 
447 IO.println("id: " + serviceAccount.id());
448 IO.println("archived_at: " + serviceAccount.archivedAt().orElseThrow());
449 ```
450 
451 ```php PHP
452 $client = new Client();
453 
454 $serviceAccount = $client->beta->organization->serviceAccounts->archive(
455 serviceAccountID: 'svac_01ABCDEFabcdef0123456789XY',
456 );
457 
458 echo "id: {$serviceAccount->id}\n";
459 echo "archived_at: {$serviceAccount->archivedAt?->format(DATE_ATOM)}\n";
460 ```
461 
462 ```ruby Ruby
463 client = Anthropic::Client.new
464 
465 service_account_id = "svac_01ABCDEFabcdef0123456789XY"
466 service_account = client.beta.organization.service_accounts.archive(service_account_id)
467 
468 puts "id: #{service_account.id}"
469 puts "archived_at: #{service_account.archived_at}"
470 ```
471</CodeGroup>
89472 
90473The create endpoint returns the new service account:
91474 
from line 497
114497| `{"type": "explicit_url", "url": "..."}` | Point at a JWKS endpoint directly. |
115498| `{"type": "inline", "keys": [...]}` | Upload the key set for providers that are not reachable from the public internet. |
116499 
117```bash cURL
118# Register an issuer (GitHub Actions, with JWKS discovery)
119curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/federation_issuers" \
120 -H "anthropic-version: 2023-06-01" \
121 -H "authorization: Bearer $ANTHROPIC_OAUTH_TOKEN" \
122 -H "content-type: application/json" \
123 -d '{
124 "name": "github-actions",
125 "issuer_url": "https://token.actions.githubusercontent.com",
126 "jwks": {"type": "discovery"}
127 }'
128 
129# List issuers
130curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/federation_issuers?limit=20" \
131 -H "anthropic-version: 2023-06-01" \
132 -H "authorization: Bearer $ANTHROPIC_OAUTH_TOKEN"
133 
134# Archive an issuer
135curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/organizations/federation_issuers/fdis_.../archive" \
136 -H "anthropic-version: 2023-06-01" \
137 -H "authorization: Bearer $ANTHROPIC_OAUTH_TOKEN"
138```
500Register an issuer. This example registers GitHub Actions with JWKS discovery:
501 
502<CodeGroup>
503 ```bash cURL
504 curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/federation_issuers" \
505 -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
506 -H "anthropic-version: 2023-06-01" \
507 -H "content-type: application/json" \
508 -d '{
509 "name": "github-actions",
510 "issuer_url": "https://token.actions.githubusercontent.com",
511 "jwks": {"type": "discovery"}
512 }'
513 ```
514 
515 ```bash CLI
516 ant beta:organization:federation:issuers create \
517 --name github-actions \
518 --issuer-url https://token.actions.githubusercontent.com \
519 --jwks '{type: discovery}'
520 ```
521 
522 ```python Python
523 client = anthropic.Anthropic()
524 
525 issuer = client.beta.organization.federation.issuers.create(
526 name="github-actions",
527 issuer_url="https://token.actions.githubusercontent.com",
528 jwks={"type": "discovery"},
529 )
530 
531 print(f"id: {issuer.id}")
532 print(f"name: {issuer.name}")
533 print(f"issuer_url: {issuer.issuer_url}")
534 ```
535 
536 ```typescript TypeScript
537 const client = new Anthropic();
538 
539 const issuer = await client.beta.organization.federation.issuers.create({
540 name: "github-actions",
541 issuer_url: "https://token.actions.githubusercontent.com",
542 jwks: { type: "discovery" }
543 });
544 
545 console.log(`id: ${issuer.id}`);
546 console.log(`name: ${issuer.name}`);
547 console.log(`issuer_url: ${issuer.issuer_url}`);
548 ```
549 
550 ```csharp C#
551 using Anthropic.Models.Beta.Organization.Federation.Issuers;
552 
553 AnthropicClient client = new();
554 
555 var issuer = await client.Beta.Organization.Federation.Issuers.Create(new()
556 {
557 Name = "github-actions",
558 IssuerUrl = "https://token.actions.githubusercontent.com",
559 Jwks = new BetaJwksDiscovery()
560 });
561 
562 Console.WriteLine($"id: {issuer.ID}");
563 Console.WriteLine($"name: {issuer.Name}");
564 Console.WriteLine($"issuer_url: {issuer.IssuerUrl}");
565 ```
566 
567 ```go Go
568 client := anthropic.NewClient()
569 
570 issuer, err := client.Beta.Organization.Federation.Issuers.New(context.Background(), anthropic.BetaOrganizationFederationIssuerNewParams{
571 Name: "github-actions",
572 IssuerURL: "https://token.actions.githubusercontent.com",
573 JWKS: anthropic.BetaOrganizationFederationIssuerNewParamsJWKSUnion{
574 OfDiscovery: &anthropic.BetaJWKSDiscoveryParam{},
575 },
576 })
577 if err != nil {
578 log.Fatal(err)
579 }
580 
581 fmt.Printf("id: %s\n", issuer.ID)
582 fmt.Printf("name: %s\n", issuer.Name)
583 fmt.Printf("issuer_url: %s\n", issuer.IssuerURL)
584 ```
585 
586 ```java Java
587 import com.anthropic.models.beta.organization.federation.issuers.BetaJwksDiscovery;
588 import com.anthropic.models.beta.organization.federation.issuers.IssuerCreateParams;
589 
590 void main() {
591 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
592 
593 var params = IssuerCreateParams.builder()
594 .name("github-actions")
595 .issuerUrl("https://token.actions.githubusercontent.com")
596 .jwks(BetaJwksDiscovery.builder().build())
597 .build();
598 var issuer = client.beta().organization().federation().issuers().create(params);
599 
600 IO.println("id: " + issuer.id());
601 IO.println("name: " + issuer.name());
602 IO.println("issuer_url: " + issuer.issuerUrl());
603 }
604 ```
605 
606 ```php PHP
607 $client = new Client();
608 
609 $issuer = $client->beta->organization->federation->issuers->create(
610 name: 'github-actions',
611 issuerURL: 'https://token.actions.githubusercontent.com',
612 jwks: ['type' => 'discovery'],
613 );
614 
615 echo "id: {$issuer->id}\n";
616 echo "name: {$issuer->name}\n";
617 echo "issuer_url: {$issuer->issuerURL}\n";
618 ```
619 
620 ```ruby Ruby
621 client = Anthropic::Client.new
622 
623 issuer = client.beta.organization.federation.issuers.create(
624 name: "github-actions",
625 issuer_url: "https://token.actions.githubusercontent.com",
626 jwks: {type: :discovery}
627 )
628 
629 puts "id: #{issuer.id}"
630 puts "name: #{issuer.name}"
631 puts "issuer_url: #{issuer.issuer_url}"
632 ```
633</CodeGroup>
634 
635List issuers:
636 
637<CodeGroup>
638 ```bash cURL
639 curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/federation_issuers?limit=20" \
640 -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
641 -H "anthropic-version: 2023-06-01"
642 ```
643 
644 ```bash CLI
645 ant beta:organization:federation:issuers list --limit 20
646 ```
647 
648 ```python Python
649 client = anthropic.Anthropic()
650 
651 issuers = client.beta.organization.federation.issuers.list(limit=20)
652 
653 for issuer in issuers:
654 print(f"{issuer.id}: {issuer.name}")
655 ```
656 
657 ```typescript TypeScript
658 const client = new Anthropic();
659 
660 for await (const issuer of client.beta.organization.federation.issuers.list({ limit: 20 })) {
661 console.log(`${issuer.id}: ${issuer.name}`);
662 }
663 ```
664 
665 ```csharp C#
666 AnthropicClient client = new();
667 
668 var page = await client.Beta.Organization.Federation.Issuers.List(new() { Limit = 20 });
669 
670 await foreach (var issuer in page.Paginate())
671 {
672 Console.WriteLine($"{issuer.ID}: {issuer.Name}");
673 }
674 ```
675 
676 ```go Go
677 client := anthropic.NewClient()
678 
679 issuers := client.Beta.Organization.Federation.Issuers.ListAutoPaging(context.Background(), anthropic.BetaOrganizationFederationIssuerListParams{
680 Limit: anthropic.Int(20),
681 })
682 
683 for issuers.Next() {
684 issuer := issuers.Current()
685 fmt.Printf("%s: %s\n", issuer.ID, issuer.Name)
686 }
687 if err := issuers.Err(); err != nil {
688 log.Fatal(err)
689 }
690 ```
691 
692 ```java Java
693 import com.anthropic.models.beta.organization.federation.issuers.IssuerListParams;
694 
695 void main() {
696 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
697 
698 var params = IssuerListParams.builder()
699 .limit(20)
700 .build();
701 var issuers = client.beta().organization().federation().issuers().list(params);
702 
703 for (var issuer : issuers.autoPager()) {
704 IO.println(issuer.id() + ": " + issuer.name());
705 }
706 }
707 ```
708 
709 ```php PHP
710 $client = new Client();
711 
712 $issuers = $client->beta->organization->federation->issuers->list(limit: 20);
713 
714 foreach ($issuers->getItems() as $issuer) {
715 echo "{$issuer->id}: {$issuer->name}\n";
716 }
717 ```
718 
719 ```ruby Ruby
720 client = Anthropic::Client.new
721 
722 issuers = client.beta.organization.federation.issuers.list(limit: 20)
723 
724 issuers.data.each do |issuer|
725 puts "#{issuer.id}: #{issuer.name}"
726 end
727 ```
728</CodeGroup>
729 
730Archive an issuer:
731 
732<CodeGroup>
733 ```bash cURL
734 curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/organizations/federation_issuers/fdis_01ABCDEFabcdef0123456789XY/archive" \
735 -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
736 -H "anthropic-version: 2023-06-01"
737 ```
738 
739 ```bash CLI
740 ant beta:organization:federation:issuers archive \
741 --federation-issuer-id fdis_01ABCDEFabcdef0123456789XY
742 ```
743 
744 ```python Python
745 client = anthropic.Anthropic()
746 
747 issuer = client.beta.organization.federation.issuers.archive(
748 "fdis_01ABCDEFabcdef0123456789XY"
749 )
750 
751 print(f"id: {issuer.id}")
752 print(f"archived_at: {issuer.archived_at}")
753 ```
754 
755 ```typescript TypeScript
756 const client = new Anthropic();
757 
758 const issuer = await client.beta.organization.federation.issuers.archive(
759 "fdis_01ABCDEFabcdef0123456789XY"
760 );
761 
762 console.log(`id: ${issuer.id}`);
763 console.log(`archived_at: ${issuer.archived_at}`);
764 ```
765 
766 ```csharp C#
767 AnthropicClient client = new();
768 
769 var issuer = await client.Beta.Organization.Federation.Issuers.Archive(
770 "fdis_01ABCDEFabcdef0123456789XY"
771 );
772 
773 Console.WriteLine($"id: {issuer.ID}");
774 Console.WriteLine($"archived_at: {issuer.ArchivedAt:O}");
775 ```
776 
777 ```go Go
778 client := anthropic.NewClient()
779 
780 issuer, err := client.Beta.Organization.Federation.Issuers.Archive(
781 context.Background(),
782 "fdis_01ABCDEFabcdef0123456789XY",
783 anthropic.BetaOrganizationFederationIssuerArchiveParams{},
784 )
785 if err != nil {
786 log.Fatal(err)
787 }
788 
789 fmt.Printf("id: %s\n", issuer.ID)
790 fmt.Printf("archived_at: %s\n", issuer.ArchivedAt)
791 ```
792 
793 ```java Java
794 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
795 
796 var issuer = client.beta().organization().federation().issuers()
797 .archive("fdis_01ABCDEFabcdef0123456789XY");
798 
799 IO.println("id: " + issuer.id());
800 IO.println("archived_at: " + issuer.archivedAt().orElseThrow());
801 ```
802 
803 ```php PHP
804 $client = new Client();
805 
806 $issuer = $client->beta->organization->federation->issuers->archive(
807 federationIssuerID: 'fdis_01ABCDEFabcdef0123456789XY',
808 );
809 
810 echo "id: {$issuer->id}\n";
811 echo "archived_at: {$issuer->archivedAt?->format(DATE_ATOM)}\n";
812 ```
813 
814 ```ruby Ruby
815 client = Anthropic::Client.new
816 
817 issuer_id = "fdis_01ABCDEFabcdef0123456789XY"
818 issuer = client.beta.organization.federation.issuers.archive(issuer_id)
819 
820 puts "id: #{issuer.id}"
821 puts "archived_at: #{issuer.archived_at}"
822 ```
823</CodeGroup>
139824 
140825To read or update a single issuer, use `GET` and `POST` on `/v1/organizations/federation_issuers/{issuer_id}`. An OAuth caller cannot update an issuer that backs a rule whose `oauth_scope` is anything other than `workspace:developer` or `workspace:inference`; see [Permissions and constraints](https://platform.claude.com/docs/en/manage-claude/wif-admin-api#permissions-and-constraints).
141826 
from line 830
145830 
146831A [federation rule](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#federation-rules) (`fdrl_...`) binds an issuer to a service account: JWTs from the issuer that satisfy the rule's match conditions can mint tokens that act as the rule's target. The `workspace_id` in the create request enables the rule in that workspace at creation; add more workspaces later through the `/federation_rules/{rule_id}/workspaces` sub-resource. Either `workspace_id` or `applies_to_all_workspaces: true` is required on create.
147832 
148```bash cURL
149# Create a rule (GitHub Actions deploys from the main branch)
150curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/federation_rules" \
151 -H "anthropic-version: 2023-06-01" \
152 -H "authorization: Bearer $ANTHROPIC_OAUTH_TOKEN" \
153 -H "content-type: application/json" \
154 -d '{
155 "name": "gha-deploy",
156 "issuer_id": "fdis_...",
157 "match": {
158 "subject_prefix": "repo:my-org/my-repo:ref:refs/heads/main",
159 "claims": {"repository_owner": "my-org"}
833Create a rule. This example lets GitHub Actions deploys from the main branch act as the service account:
834 
835<CodeGroup>
836 ```bash cURL
837 curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/federation_rules" \
838 -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
839 -H "anthropic-version: 2023-06-01" \
840 -H "content-type: application/json" \
841 -d '{
842 "name": "gha-deploy",
843 "issuer_id": "fdis_01ABCDEFabcdef0123456789XY",
844 "match": {
845 "subject_prefix": "repo:my-org/my-repo:ref:refs/heads/main",
846 "claims": {"repository_owner": "my-org"}
847 },
848 "target": {
849 "type": "service_account",
850 "service_account_id": "svac_01ABCDEFabcdef0123456789XY"
851 },
852 "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
853 "oauth_scope": "workspace:developer",
854 "token_lifetime_seconds": 600
855 }'
856 ```
857 
858 ```bash CLI
859 ant beta:organization:federation:rules create <<'YAML'
860 name: gha-deploy
861 issuer_id: fdis_01ABCDEFabcdef0123456789XY
862 match:
863 subject_prefix: "repo:my-org/my-repo:ref:refs/heads/main"
864 claims:
865 repository_owner: my-org
866 target:
867 type: service_account
868 service_account_id: svac_01ABCDEFabcdef0123456789XY
869 workspace_id: wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ
870 oauth_scope: "workspace:developer"
871 token_lifetime_seconds: 600
872 YAML
873 ```
874 
875 ```python Python
876 client = anthropic.Anthropic()
877 
878 rule = client.beta.organization.federation.rules.create(
879 name="gha-deploy",
880 issuer_id="fdis_01ABCDEFabcdef0123456789XY",
881 match={
882 "subject_prefix": "repo:my-org/my-repo:ref:refs/heads/main",
883 "claims": {"repository_owner": "my-org"},
884 },
885 target={
886 "type": "service_account",
887 "service_account_id": "svac_01ABCDEFabcdef0123456789XY",
888 },
889 workspace_id="wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
890 oauth_scope="workspace:developer",
891 token_lifetime_seconds=600,
892 )
893 
894 print(f"id: {rule.id}")
895 print(f"name: {rule.name}")
896 ```
897 
898 ```typescript TypeScript
899 const client = new Anthropic();
900 
901 const rule = await client.beta.organization.federation.rules.create({
902 name: "gha-deploy",
903 issuer_id: "fdis_01ABCDEFabcdef0123456789XY",
904 match: {
905 subject_prefix: "repo:my-org/my-repo:ref:refs/heads/main",
906 claims: { repository_owner: "my-org" }
160907 },
161 "target": {
162 "type": "service_account",
163 "service_account_id": "svac_..."
908 target: {
909 type: "service_account",
910 service_account_id: "svac_01ABCDEFabcdef0123456789XY"
164911 },
165 "workspace_id": "wrkspc_...",
166 "oauth_scope": "workspace:developer",
167 "token_lifetime_seconds": 600
168 }'
169 
170# List rules, optionally filtered by issuer
171curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/federation_rules?issuer_id=fdis_..." \
172 -H "anthropic-version: 2023-06-01" \
173 -H "authorization: Bearer $ANTHROPIC_OAUTH_TOKEN"
174 
175# Archive a rule
176curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/organizations/federation_rules/fdrl_.../archive" \
177 -H "anthropic-version: 2023-06-01" \
178 -H "authorization: Bearer $ANTHROPIC_OAUTH_TOKEN"
179```
912 workspace_id: "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
913 oauth_scope: "workspace:developer",
914 token_lifetime_seconds: 600
915 });
916 
917 console.log(`id: ${rule.id}`);
918 console.log(`name: ${rule.name}`);
919 ```
920 
921 ```csharp C#
922 AnthropicClient client = new();
923 
924 var rule = await client.Beta.Organization.Federation.Rules.Create(new()
925 {
926 Name = "gha-deploy",
927 IssuerID = "fdis_01ABCDEFabcdef0123456789XY",
928 Match = new()
929 {
930 SubjectPrefix = "repo:my-org/my-repo:ref:refs/heads/main",
931 Claims = new Dictionary<string, string> { ["repository_owner"] = "my-org" }
932 },
933 Target = new() { ServiceAccountID = "svac_01ABCDEFabcdef0123456789XY" },
934 WorkspaceID = "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
935 OAuthScope = "workspace:developer",
936 TokenLifetimeSeconds = 600
937 });
938 
939 Console.WriteLine($"id: {rule.ID}");
940 Console.WriteLine($"name: {rule.Name}");
941 ```
942 
943 ```go Go
944 client := anthropic.NewClient()
945 
946 rule, err := client.Beta.Organization.Federation.Rules.New(context.Background(), anthropic.BetaOrganizationFederationRuleNewParams{
947 Name: "gha-deploy",
948 IssuerID: "fdis_01ABCDEFabcdef0123456789XY",
949 Match: anthropic.BetaFederationRuleMatchParam{
950 SubjectPrefix: anthropic.String("repo:my-org/my-repo:ref:refs/heads/main"),
951 Claims: map[string]string{"repository_owner": "my-org"},
952 },
953 Target: anthropic.BetaServiceAccountTargetParam{
954 ServiceAccountID: "svac_01ABCDEFabcdef0123456789XY",
955 },
956 WorkspaceID: anthropic.String("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"),
957 OAuthScope: "workspace:developer",
958 TokenLifetimeSeconds: anthropic.Int(600),
959 })
960 if err != nil {
961 log.Fatal(err)
962 }
963 
964 fmt.Printf("id: %s\n", rule.ID)
965 fmt.Printf("name: %s\n", rule.Name)
966 ```
967 
968 ```java Java
969 import com.anthropic.core.JsonValue;
970 import com.anthropic.models.beta.organization.federation.rules.BetaFederationRuleMatch;
971 import com.anthropic.models.beta.organization.federation.rules.BetaServiceAccountTarget;
972 import com.anthropic.models.beta.organization.federation.rules.RuleCreateParams;
973 
974 void main() {
975 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
976 
977 var match = BetaFederationRuleMatch.builder()
978 .subjectPrefix("repo:my-org/my-repo:ref:refs/heads/main")
979 .claims(BetaFederationRuleMatch.Claims.builder()
980 .putAdditionalProperty("repository_owner", JsonValue.from("my-org"))
981 .build())
982 .build();
983 var params = RuleCreateParams.builder()
984 .name("gha-deploy")
985 .issuerId("fdis_01ABCDEFabcdef0123456789XY")
986 .match(match)
987 .target(BetaServiceAccountTarget.of("svac_01ABCDEFabcdef0123456789XY"))
988 .workspaceId("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ")
989 .oauthScope("workspace:developer")
990 .tokenLifetimeSeconds(600)
991 .build();
992 var rule = client.beta().organization().federation().rules().create(params);
993 
994 IO.println("id: " + rule.id());
995 IO.println("name: " + rule.name());
996 }
997 ```
998 
999 ```php PHP
1000 $client = new Client();
1001 
1002 $rule = $client->beta->organization->federation->rules->create(
1003 name: 'gha-deploy',
1004 issuerID: 'fdis_01ABCDEFabcdef0123456789XY',
1005 match: [
1006 'subjectPrefix' => 'repo:my-org/my-repo:ref:refs/heads/main',
1007 'claims' => ['repository_owner' => 'my-org'],
1008 ],
1009 target: [
1010 'type' => 'service_account',
1011 'serviceAccountID' => 'svac_01ABCDEFabcdef0123456789XY',
1012 ],
1013 workspaceID: 'wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ',
1014 oauthScope: 'workspace:developer',
1015 tokenLifetimeSeconds: 600,
1016 );
1017 
1018 echo "id: {$rule->id}\n";
1019 echo "name: {$rule->name}\n";
1020 ```
1021 
1022 ```ruby Ruby
1023 client = Anthropic::Client.new
1024 
1025 rule = client.beta.organization.federation.rules.create(
1026 name: "gha-deploy",
1027 issuer_id: "fdis_01ABCDEFabcdef0123456789XY",
1028 match: {
1029 subject_prefix: "repo:my-org/my-repo:ref:refs/heads/main",
1030 claims: {repository_owner: "my-org"}
1031 },
1032 target: {
1033 type: :service_account,
1034 service_account_id: "svac_01ABCDEFabcdef0123456789XY"
1035 },
1036 workspace_id: "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
1037 oauth_scope: "workspace:developer",
1038 token_lifetime_seconds: 600
1039 )
1040 
1041 puts "id: #{rule.id}"
1042 puts "name: #{rule.name}"
1043 ```
1044</CodeGroup>
1045 
1046List rules, optionally filtered by issuer:
1047 
1048<CodeGroup>
1049 ```bash cURL
1050 curl --fail-with-body -sS "https://api.anthropic.com/v1/organizations/federation_rules?issuer_id=fdis_01ABCDEFabcdef0123456789XY" \
1051 -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
1052 -H "anthropic-version: 2023-06-01"
1053 ```
1054 
1055 ```bash CLI
1056 ant beta:organization:federation:rules list \
1057 --issuer-id fdis_01ABCDEFabcdef0123456789XY
1058 ```
1059 
1060 ```python Python
1061 client = anthropic.Anthropic()
1062 
1063 rules = client.beta.organization.federation.rules.list(
1064 issuer_id="fdis_01ABCDEFabcdef0123456789XY"
1065 )
1066 
1067 for rule in rules:
1068 print(f"{rule.id}: {rule.name}")
1069 ```
1070 
1071 ```typescript TypeScript
1072 const client = new Anthropic();
1073 
1074 for await (const rule of client.beta.organization.federation.rules.list({
1075 issuer_id: "fdis_01ABCDEFabcdef0123456789XY"
1076 })) {
1077 console.log(`${rule.id}: ${rule.name}`);
1078 }
1079 ```
1080 
1081 ```csharp C#
1082 AnthropicClient client = new();
1083 
1084 var page = await client.Beta.Organization.Federation.Rules.List(new()
1085 {
1086 IssuerID = "fdis_01ABCDEFabcdef0123456789XY"
1087 });
1088 
1089 await foreach (var rule in page.Paginate())
1090 {
1091 Console.WriteLine($"{rule.ID}: {rule.Name}");
1092 }
1093 ```
1094 
1095 ```go Go
1096 client := anthropic.NewClient()
1097 
1098 rules := client.Beta.Organization.Federation.Rules.ListAutoPaging(context.Background(), anthropic.BetaOrganizationFederationRuleListParams{
1099 IssuerID: anthropic.String("fdis_01ABCDEFabcdef0123456789XY"),
1100 })
1101 
1102 for rules.Next() {
1103 rule := rules.Current()
1104 fmt.Printf("%s: %s\n", rule.ID, rule.Name)
1105 }
1106 if err := rules.Err(); err != nil {
1107 log.Fatal(err)
1108 }
1109 ```
1110 
1111 ```java Java
1112 import com.anthropic.models.beta.organization.federation.rules.RuleListParams;
1113 
1114 void main() {
1115 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1116 
1117 var params = RuleListParams.builder()
1118 .issuerId("fdis_01ABCDEFabcdef0123456789XY")
1119 .build();
1120 var rules = client.beta().organization().federation().rules().list(params);
1121 
1122 for (var rule : rules.autoPager()) {
1123 IO.println(rule.id() + ": " + rule.name());
1124 }
1125 }
1126 ```
1127 
1128 ```php PHP
1129 $client = new Client();
1130 
1131 $rules = $client->beta->organization->federation->rules->list(
1132 issuerID: 'fdis_01ABCDEFabcdef0123456789XY',
1133 );
1134 
1135 foreach ($rules->getItems() as $rule) {
1136 echo "{$rule->id}: {$rule->name}\n";
1137 }
1138 ```
1139 
1140 ```ruby Ruby
1141 client = Anthropic::Client.new
1142 
1143 rules = client.beta.organization.federation.rules.list(
1144 issuer_id: "fdis_01ABCDEFabcdef0123456789XY"
1145 )
1146 
1147 rules.data.each do |rule|
1148 puts "#{rule.id}: #{rule.name}"
1149 end
1150 ```
1151</CodeGroup>
1152 
1153Archive a rule:
1154 
1155<CodeGroup>
1156 ```bash cURL
1157 curl --fail-with-body -sS -X POST "https://api.anthropic.com/v1/organizations/federation_rules/fdrl_01ABCDEFabcdef0123456789XY/archive" \
1158 -H "authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
1159 -H "anthropic-version: 2023-06-01"
1160 ```
1161 
1162 ```bash CLI
1163 ant beta:organization:federation:rules archive \
1164 --federation-rule-id fdrl_01ABCDEFabcdef0123456789XY
1165 ```
1166 
1167 ```python Python
1168 client = anthropic.Anthropic()
1169 
1170 rule = client.beta.organization.federation.rules.archive(
1171 "fdrl_01ABCDEFabcdef0123456789XY"
1172 )
1173 
1174 print(f"id: {rule.id}")
1175 print(f"archived_at: {rule.archived_at}")
1176 ```
1177 
1178 ```typescript TypeScript
1179 const client = new Anthropic();
1180 
1181 const rule = await client.beta.organization.federation.rules.archive(
1182 "fdrl_01ABCDEFabcdef0123456789XY"
1183 );
1184 
1185 console.log(`id: ${rule.id}`);
1186 console.log(`archived_at: ${rule.archived_at}`);
1187 ```
1188 
1189 ```csharp C#
1190 AnthropicClient client = new();
1191 
1192 var rule = await client.Beta.Organization.Federation.Rules.Archive(
1193 "fdrl_01ABCDEFabcdef0123456789XY"
1194 );
1195 
1196 Console.WriteLine($"id: {rule.ID}");
1197 Console.WriteLine($"archived_at: {rule.ArchivedAt:O}");
1198 ```
1199 
1200 ```go Go
1201 client := anthropic.NewClient()
1202 
1203 rule, err := client.Beta.Organization.Federation.Rules.Archive(
1204 context.Background(),
1205 "fdrl_01ABCDEFabcdef0123456789XY",
1206 anthropic.BetaOrganizationFederationRuleArchiveParams{},
1207 )
1208 if err != nil {
1209 log.Fatal(err)
1210 }
1211 
1212 fmt.Printf("id: %s\n", rule.ID)
1213 fmt.Printf("archived_at: %s\n", rule.ArchivedAt)
1214 ```
1215 
1216 ```java Java
1217 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1218 
1219 var rule = client.beta().organization().federation().rules()
1220 .archive("fdrl_01ABCDEFabcdef0123456789XY");
1221 
1222 IO.println("id: " + rule.id());
1223 IO.println("archived_at: " + rule.archivedAt().orElseThrow());
1224 ```
1225 
1226 ```php PHP
1227 $client = new Client();
1228 
1229 $rule = $client->beta->organization->federation->rules->archive(
1230 federationRuleID: 'fdrl_01ABCDEFabcdef0123456789XY',
1231 );
1232 
1233 echo "id: {$rule->id}\n";
1234 echo "archived_at: {$rule->archivedAt?->format(DATE_ATOM)}\n";
1235 ```
1236 
1237 ```ruby Ruby
1238 client = Anthropic::Client.new
1239 
1240 rule_id = "fdrl_01ABCDEFabcdef0123456789XY"
1241 rule = client.beta.organization.federation.rules.archive(rule_id)
1242 
1243 puts "id: #{rule.id}"
1244 puts "archived_at: #{rule.archived_at}"
1245 ```
1246</CodeGroup>
1801247 
1811248The list endpoint returns a page of rules and the cursor for the next page:
1821249 
1831250 
Feedback