Repository navigation
Expand file tree
/
Copy pathapi-spec.yaml
More file actions
3159 lines (3039 loc) · 110 KB
/
Copy pathapi-spec.yaml
File metadata and controls
3159 lines (3039 loc) · 110 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: Agent Name Service (ANS) Management API
description: |
Management API for the Agent Name Service (ANS) — v2.
This API provides authenticated, ownership-scoped operations for managing
ANS agent registrations, certificates, and lifecycle. It replaces the
/v1/agents API with the following key changes:
**Route structure:** All routes moved from `/v1/agents` to `/v2/ans/agents`.
Registration uses `POST /v2/ans/agents` (standard REST collection POST,
no `/register` verb suffix). Action endpoints (`/revoke`, `/verify-acme`,
`/verify-dns`) retain verb suffixes for procedural clarity.
**Management-scoped listing:** `GET /v2/ans/agents` returns only agents owned by
the authenticated caller. Global search/discovery has moved to a dedicated
search service.
**Cursor-based pagination:** The list endpoint uses cursor-based pagination
instead of offset-based, eliminating the O(n) performance degradation at
high offsets.
**Ownership enforcement:** All agent-specific operations (`GET /{agentId}`,
`POST /{agentId}/revoke`, certificate endpoints) enforce that the
authenticated caller owns the requested agent.
**Resolution removed:** `POST /v1/agents/resolution` is not carried forward
to v2. The `_ans` DNS TXT record already contains agent endpoints, making
this endpoint redundant. Consumers needing discovery should use the
registered agents search service (`/v1/ans/registered-agents`).
## Deprecation of v1
All `/v1/agents/*` routes are deprecated and will be removed per the
published sunset schedule. v1 responses include `Deprecation: true`,
`Sunset`, and `Link` headers pointing to v2 equivalents.
version: 2.0.0
contact:
name: ANS Working Group
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: http://localhost:18080/v2
description: Local dev — quickstart ra-local.yaml
- url: https://api.ans.example.org/v2
description: Main ANS API server (v2)
- url: https://test.ans.example.org/v2
description: Test server (v2)
tags:
- name: Management
description: Agent listing and detail operations (ownership-scoped)
- name: Registration
description: Agent registration and validation operations
- name: Revocation
description: Agent certificate revocation operations
- name: Certificate Management
description: Certificate retrieval, CSR submission, and renewal operations
- name: Events
description: |
Public, unauthenticated agent-lifecycle events feed. Lives on the
`/v1` path (not `/v2`) because it is the production-compatible
ingestion contract the ANS Finder consumes; its shape is pinned to
the production `getAgentEvents` operation. The operation declares a
path-level `servers` override so the documented path resolves at
the host root rather than under this document's `/v2` server prefix.
- name: Verified Identities
description: |
The "who" behind agents — owner-level identities (did:web,
did:key) proven through challenge-bound control proofs, sealed
on their own Transparency Log stream, and linked to the owner's
agents
# Global security requirement. Every path inherits this and can
# override with `security: []` to declare itself anonymous. The
# handler's actual auth behaviour is documented in CLAUDE.md §Auth:
# static API key (Bearer <key>) for quickstart, OIDC bearer tokens
# when `auth.type: oidc` is configured. Both providers accept the
# same shape on the wire, which is why a single HTTP-bearer scheme
# covers both in the OpenAPI document.
security:
- bearerAuth: []
paths:
# ──────────────────────────────────────────────────────────────────
# Events — public agent-lifecycle feed (the Finder's ingestion source)
#
# Path-level `servers` override: this operation lives at the host
# ROOT (`/v1/agents/events`), not under this document's `/v2` server
# prefix. The override makes the rendered URL correct in Swagger UI.
# The shape is byte-compatible with the production `getAgentEvents`
# operation; the OSS RA owns a conformance test asserting that.
# ──────────────────────────────────────────────────────────────────
/v1/agents/events:
servers:
- url: http://localhost:18080
description: Local dev — quickstart ra-local.yaml (feed is not under /v2)
- url: https://api.ans.example.org
description: Main ANS API server
get:
tags:
- Events
summary: Retrieve ANS agent lifecycle events
description: |
Returns a paginated, strictly-ordered stream of ANS agent
lifecycle events (registrations and revocations). This is the
ingestion contract the ANS Finder polls to build its discovery
catalog.
**Anonymous.** This route requires no authentication (`security: []`).
**Only sealed events appear.** An event is served only after it
has been accepted by the Transparency Log and a `logId` assigned,
so an item in the feed is provably sealed in the log and its
receipt is resolvable from `logId`.
**Pagination.** Pass the `lastLogId` from a response as the next
request's `lastLogId` query parameter to fetch the following
page. Omit it for the first page. When the response omits
`lastLogId`, there are no more results.
**Retention.** Events are retained for a bounded window (default
30 days) and then age out. Because of this, an unknown
`lastLogId` and one that has aged out are indistinguishable: both
restart the stream from the oldest retained event rather than
erroring.
**providerId.** Accepted for production-shape parity. This
open-source RA has no provider concept, so supplying a non-empty
`providerId` yields an empty page.
operationId: getAgentEvents
security: []
parameters:
- name: providerId
in: query
description: |
Optional provider identifier. This OSS RA has no provider
concept; a non-empty value returns an empty page.
required: false
schema:
type: string
- name: lastLogId
in: query
description: |
Opaque cursor — the `lastLogId` from a previous response.
Omit for the first page. An unknown or aged-out cursor
restarts from the oldest retained event.
required: false
schema:
type: string
- name: limit
in: query
description: Number of events to return (1-200, default 100)
required: false
schema:
type: integer
minimum: 1
maximum: 200
default: 100
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/EventPageResponse'
'422':
description: Invalid request parameters (out-of-range or non-numeric limit)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'500':
description: Internal server error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
# ──────────────────────────────────────────────────────────────────
# Management — ownership-scoped
# ──────────────────────────────────────────────────────────────────
/ans/agents:
get:
tags:
- Management
summary: List caller's agents
description: |
Returns agents owned by the authenticated caller. This is a management
endpoint, not a discovery/search endpoint.
**Key differences from v1 `GET /v1/agents`:**
- Results are scoped to the authenticated caller's agents only.
- Uses cursor-based pagination (no `offset`).
- Removed filters: `protocol`, `agentDisplayName`, `version`.
Use the dedicated search service for discovery use cases.
- Removed `totalCount` and `searchCriteria` from response.
**Pagination:** Use the `nextCursor` value from the response as the
`cursor` query parameter in the next request. When `hasMore` is false,
there are no more results.
operationId: listCallerAgents
parameters:
- name: status
in: query
description: |
Filter by agent lifecycle status. Can specify multiple values.
Defaults to ACTIVE. Use 'ALL' to return agents of any status.
required: false
style: form
explode: true
schema:
type: array
items:
$ref: '#/components/schemas/AgentLifecycleStatusFilter'
- name: agentHost
in: query
description: Filter by agent host domain (exact match)
required: false
schema:
type: string
- name: limit
in: query
description: Maximum number of results to return (default 20, max 100)
required: false
schema:
type: integer
minimum: 1
maximum: 100
default: 20
- name: cursor
in: query
description: |
Opaque pagination cursor from a previous response's `nextCursor`.
Omit for the first page.
required: false
schema:
type: string
responses:
'200':
description: Agent list retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/AgentListResponse'
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Authorization failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Invalid query parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
post:
tags:
- Registration
summary: Register a new agent with the ANS
description: |
Registers a new agent with the Agent Name Service.
The request MAY include a Certificate Signing Request (CSR) so that
an Identity certificate can be issued. Identity certificates are
issued by the RA.
The request must include a server CSR (for RA-issued server cert)
or a BYOC server certificate with its chain.
operationId: registerAgent
requestBody:
description: Agent registration request
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AgentRegistrationRequest'
responses:
'202':
description: Registration accepted, pending validation
content:
application/json:
schema:
$ref: '#/components/schemas/RegistrationPending'
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Authorization failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: |
Conflict. `code` distinguishes the cause:
`ANS_NAME_TAKEN` (this exact versioned ANS name is already
registered) or `AGENT_HOST_TAKEN` (the FQDN has a live —
ACTIVE or DEPRECATED — registration owned by a different
operator; the FQDN belongs to that owner until no live
registration remains).
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'422':
description: Invalid registration request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/ans/agents/{agentId}:
get:
tags:
- Management
summary: Get agent details
description: |
Retrieves detailed information about a registered agent.
**Ownership enforced:** Returns 404 if the authenticated caller does
not own the requested agent.
operationId: getAgent
parameters:
- $ref: '#/components/parameters/AgentIdPath'
responses:
'200':
description: Agent details retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/AgentDetails'
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Authorization failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Agent not found or not owned by caller
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
# ──────────────────────────────────────────────────────────────────
# AI Catalog (producer-generated discovery artifact)
# ──────────────────────────────────────────────────────────────────
/ans/agents/{agentId}/catalog-entry:
get:
tags:
- Management
summary: Get the agent's AI Catalog entry
description: |
Returns the agent's AI Catalog `CatalogEntry` — the producer-side
record an external AI Catalog / ARD registry ingests. The entry is
derived entirely from the registration aggregate (display name,
version, endpoints, Transparency-Log badge/receipt URLs); nothing is
sealed or fetched, and it is regenerated on lifecycle events.
**Owner-scoped, read-only.** Returns 404 if the authenticated caller
does not own the agent (existence is hidden). This route is the
registrant's own view of how their agent appears in a catalog; it is
not the public, crawlable surface.
**Eligibility:** an entry is produced only for an **ACTIVE**
registration (the entry's SCITT-receipt attestation and TL badge
link to Transparency-Log records that exist only once the agent is
sealed at activation — a pending agent has nothing to link to) that
is versioned and has at least one A2A or MCP endpoint whose
`metaDataUrl` is present and passes the emit-side URL policy
(absolute https, no userinfo/query/fragment, host == agentHost).
Otherwise the route returns 422 `NOT_CATALOG_ELIGIBLE` (the `detail`
names the specific gate: not active, versionless, or no eligible
endpoint).
operationId: getCatalogEntry
parameters:
- $ref: '#/components/parameters/AgentIdPath'
responses:
'200':
description: The agent's CatalogEntry
content:
application/json:
schema:
$ref: '#/components/schemas/CatalogEntry'
'401':
description: Authentication failed
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: Authorization failed
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Agent not found or not owned by caller
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'422':
description: |
Registration is not catalog-eligible: not ACTIVE (no
Transparency-Log entry to link to yet), versionless, or no
A2A/MCP endpoint with a policy-passing metaDataUrl. `code` is
`NOT_CATALOG_ELIGIBLE`; `detail` names the specific gate.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'500':
description: Internal server error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/ans/agents/{agentId}/ai-catalog:
get:
tags:
- Management
summary: Get the host-complete AI Catalog document
description: |
Returns the host-complete AI Catalog **document** for the agent's
host — the file an Agent Hosting Platform publishes verbatim at
`/.well-known/ai-catalog.json`. It contains one `CatalogEntry` for
every **ACTIVE**, catalog-eligible agent registered on that host
(deprecated and revoked registrations are pruned from the
well-known file; the population export keeps them, marked).
**Owner-scoped, read-only.** Returns 404 if the authenticated
caller does not own the agent (existence is hidden). The caller
proves ownership of the keying agent; the document then lists that
owner's ACTIVE catalog-eligible agents on the host (the body is
scoped to the owner, not just the route key, so a shared host never
discloses one owner's agents to another). This is the registrant's
refresh target — not a public, crawlable surface.
**Caching:** the response carries a strong `ETag` (SHA-256 of the
body). A conditional request with a matching `If-None-Match`
receives `304 Not Modified`.
operationId: getHostCatalog
parameters:
- $ref: '#/components/parameters/AgentIdPath'
responses:
'200':
description: The host-complete AI Catalog document
headers:
ETag:
description: Strong validator (SHA-256 of the document body)
schema:
type: string
Cache-Control:
schema:
type: string
content:
application/ai-catalog+json:
schema:
$ref: '#/components/schemas/CatalogDocument'
'304':
description: Not modified (If-None-Match matched the current ETag)
headers:
ETag:
description: Strong validator (SHA-256 of the document body)
schema:
type: string
Cache-Control:
schema:
type: string
'401':
description: Authentication failed
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: Authorization failed
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: Agent not found or not owned by caller
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'500':
description: Internal server error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
# ──────────────────────────────────────────────────────────────────
# Registration Validation
# ──────────────────────────────────────────────────────────────────
/ans/agents/{agentId}/verify-acme:
post:
tags:
- Registration
summary: Trigger ACME validation
description: |
Initiates domain control validation. The AHP calls this after placing
the ACME challenge token. The RA validates domain control, which is
required before issuing both server and identity certificates.
operationId: validateRegistration
parameters:
- $ref: '#/components/parameters/AgentIdPath'
responses:
'202':
description: Validation successful, certificates pending
content:
application/json:
schema:
$ref: '#/components/schemas/AgentStatus'
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Authorization failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Agent not found or not owned by caller
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: |
`AGENT_HOST_TAKEN` — a different operator now holds this FQDN
live (it activated first). This registration lost the host and
was cancelled; it can no longer progress.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'422':
description: Validation failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/ans/agents/{agentId}/verify-dns:
post:
tags:
- Registration
summary: Verify DNS records configured
description: |
Verifies that all required DNS records have been configured correctly.
This is the final step for external domain registration.
**Seal-before-success:** activation does not report `ACTIVE` until
the agent's single terminal `AGENT_REGISTERED` event has been
sealed in the Transparency Log. The RA submits the event to the TL
INLINE and only then commits the ACTIVE transition; if the TL is
unavailable the call fails 503 `TL_UNAVAILABLE` (retryable — the
agent stays `PENDING_DNS` and nothing is committed). This is what
guarantees a catalog entry's SCITT-receipt and badge links can only
ever point at a TL record that actually exists.
operationId: verifyDnsRecords
parameters:
- $ref: '#/components/parameters/AgentIdPath'
responses:
'202':
description: DNS verified and AGENT_REGISTERED sealed in the TL; registration active
content:
application/json:
schema:
$ref: '#/components/schemas/AgentStatus'
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Authorization failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Agent not found or not owned by caller
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: |
`AGENT_HOST_TAKEN` — a different operator activated a
registration on this FQDN during this registration's pending
window. The FQDN belongs to that owner until no live
registration remains, so this activation is refused.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'422':
description: DNS records not found or incorrect
content:
application/json:
schema:
$ref: '#/components/schemas/DnsVerificationError'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'503':
description: |
`TL_UNAVAILABLE` — the Transparency Log could not seal the
`AGENT_REGISTERED` event. Retryable: the agent stays
`PENDING_DNS` and nothing is committed; retry verify-dns once
the TL is reachable.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
# ──────────────────────────────────────────────────────────────────
# Revocation
# ──────────────────────────────────────────────────────────────────
/ans/agents/{agentId}/revoke:
post:
tags:
- Revocation
summary: Revoke an active agent or cancel a pending registration
description: |
Revokes an active agent or cancels a pending registration.
**Ownership enforced:** Returns 403 if caller does not own the agent.
For ACTIVE agents: Revokes due to key compromise, decommissioning, or
other security reasons. Certificate added to CRL, registry entry flagged.
For PENDING registrations (PENDING_CERTS or PENDING_DNS): Cancels
the registration, revokes any already-issued certificates.
PENDING_VALIDATION registrations are not cancellable and will
auto-expire.
operationId: revokeAgent
parameters:
- $ref: '#/components/parameters/AgentIdPath'
requestBody:
description: Agent revocation request
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AgentRevocationRequest'
responses:
'200':
description: Agent revoked successfully
content:
application/json:
schema:
$ref: '#/components/schemas/AgentRevocationResponse'
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Authorization failed or caller does not own agent
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Agent not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Invalid revocation request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
# ──────────────────────────────────────────────────────────────────
# Certificate Management — Server
# ──────────────────────────────────────────────────────────────────
/ans/agents/{agentId}/certificates/server:
get:
tags:
- Certificate Management
summary: Get agent's server certificates
description: Retrieves all TLS server certificates for the specified agent.
operationId: getAgentServerCertificates
parameters:
- $ref: '#/components/parameters/AgentIdPath'
responses:
'200':
description: Server certificate(s) retrieved
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CertificateResponse'
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Authorization failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Agent or certificate not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
post:
tags:
- Certificate Management
summary: Submit server certificate CSR
description: |
Submits a CSR for the agent's server certificate.
The response contains a `csrId` matching `CertificateResponse.csrId`.
operationId: submitServerCsr
parameters:
- $ref: '#/components/parameters/AgentIdPath'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CsrSubmissionRequest'
responses:
'202':
description: CSR accepted
content:
application/json:
schema:
$ref: '#/components/schemas/CsrSubmissionResponse'
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Authorization failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Agent not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Invalid CSR
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/ans/agents/{agentId}/certificates/server/renewal:
post:
tags:
- Certificate Management
summary: Submit server certificate renewal
description: |
Initiates server certificate renewal. Supports CSR path (RA issues)
or BYOC path (client provides certificate). Only one pending renewal
allowed per agent.
operationId: submitServerCertRenewal
parameters:
- $ref: '#/components/parameters/AgentIdPath'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ServerCertificateRenewalRequest'
responses:
'202':
description: Renewal accepted
content:
application/json:
schema:
$ref: '#/components/schemas/RenewalSubmissionResponse'
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Authorization failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Agent not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Pending renewal already exists
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Validation failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
get:
tags:
- Certificate Management
summary: Get pending renewal status
description: Returns current renewal status if one exists.
operationId: getServerCertRenewalStatus
parameters:
- $ref: '#/components/parameters/AgentIdPath'
responses:
'200':
description: Renewal found
content:
application/json:
schema:
$ref: '#/components/schemas/RenewalStatusResponse'
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Authorization failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: No renewal exists
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
delete:
tags:
- Certificate Management
summary: Cancel pending renewal
description: |
Cancels the pending server certificate renewal. Marks associated CSR
as REJECTED if applicable. Client can immediately submit a new renewal.
operationId: cancelServerCertRenewal
parameters:
- $ref: '#/components/parameters/AgentIdPath'
responses:
'204':
description: Renewal cancelled
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Authorization failed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: No pending renewal
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Renewal already completed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/ans/agents/{agentId}/certificates/server/renewal/verify-acme:
post:
tags:
- Certificate Management
summary: Verify ACME challenges for pending server cert renewal
description: |
Triggers ACME validation for external agents only.
DNS-01 or HTTP-01 challenge verification.
operationId: verifyRenewalAcme
parameters:
- $ref: '#/components/parameters/AgentIdPath'
responses:
'200':
description: BYOC renewal completed synchronously