-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusp-rest.json
More file actions
4474 lines (4474 loc) · 152 KB
/
Copy pathusp-rest.json
File metadata and controls
4474 lines (4474 loc) · 152 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.1.0",
"info": {
"title": "Universal Scheduling Protocol (USP) REST API",
"version": "2026-08-20",
"description": "The Universal Scheduling Protocol (USP) enables consumer platforms and AI agents to discover, check availability of, and book time-based services from businesses. This OpenAPI specification defines the REST binding for all USP operations.",
"contact": {
"url": "https://usp-protocol.dev"
},
"license": {
"name": "Apache-2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0"
}
},
"servers": [
{
"url": "https://business.example.com/usp/v1",
"description": "Business USP endpoint (from /.well-known/usp)"
}
],
"tags": [
{
"name": "Services",
"description": "Service catalog operations"
},
{
"name": "Availability",
"description": "Availability query and optional hold operations. Hold and release endpoints require the business to advertise holds: true in the dev.usp-protocol.services.availability capability."
},
{
"name": "Bookings",
"description": "Booking lifecycle operations"
},
{
"name": "Waitlist",
"description": "Waitlist management operations"
},
{
"name": "Registry",
"description": "Discovery registry operations (optional)"
}
],
"components": {
"parameters": {
"USP-Agent": {
"name": "USP-Agent",
"in": "header",
"description": "Platform profile URI for capability negotiation (Standalone Mode). RFC 8941 Dictionary Structured Field syntax. The business fetches this URI to determine the capability intersection. Required in Standalone Mode; omit in UCP-Native Mode.",
"schema": {
"type": "string",
"example": "profile=\"https://agent.example/profiles/scheduling-agent.json\""
},
"required": true
},
"IdempotencyKey": {
"name": "Idempotency-Key",
"in": "header",
"description": "UUID v4 for idempotency of state-modifying operations.",
"schema": {
"type": "string",
"format": "uuid"
}
},
"IfMatch": {
"name": "If-Match",
"in": "header",
"description": "OPTIONAL conditional-write precondition. Carries the opaque `revision` the platform last observed for this resource. When present, the business MUST apply the write only if the resource's current revision matches, and MUST return 412 otherwise rather than applying it - this is what stops two agents holding the same booking_scoped_credential from silently clobbering each other's changes. Omit it to write unconditionally. A business that does not return `revision` on this resource type does not support conditional writes and ignores this header. Interaction with Idempotency-Key: an idempotent REPLAY returns the stored original response WITHOUT re-evaluating this precondition, since the revision the caller sent was current at the time the original request succeeded and re-checking it would fail a retry of an already-successful call.",
"schema": {
"type": "string"
}
},
"USPCorrelationId": {
"name": "USP-Correlation-Id",
"in": "header",
"description": "OPTIONAL non-normative money-path correlation join id (specification.md Section 9.7). Opaque, non-PII token; a UUID is sufficient. Recipients that do not participate ignore this header without failing the request. Not a substitute for booking_id or payment identifiers.",
"schema": {
"type": "string",
"example": "7f3c2b1a-9e4d-4a8b-8c1f-2d5e6f7a8b9c"
}
}
},
"headers": {
"USPCorrelationId": {
"description": "OPTIONAL non-normative money-path correlation join id echoed on error (and optionally success) responses per specification.md Section 9.7. Caller-safe reference; not a substitute for Problem Details type or code.",
"schema": {
"type": "string",
"example": "7f3c2b1a-9e4d-4a8b-8c1f-2d5e6f7a8b9c"
}
}
},
"schemas": {
"USPEnvelope": {
"$ref": "https://usp-protocol.dev/schemas/usp.json#/$defs/USPEnvelope"
},
"BookingScopedCredential": {
"$ref": "https://usp-protocol.dev/schemas/profile.json#/$defs/BookingScopedCredential"
},
"ConfirmationKey": {
"$ref": "https://usp-protocol.dev/schemas/usp.json#/$defs/ConfirmationKey"
},
"PopProofJwt": {
"$ref": "https://usp-protocol.dev/schemas/usp.json#/$defs/PopProofJwt"
},
"PaginationRequest": {
"$ref": "https://usp-protocol.dev/schemas/usp.json#/$defs/PaginationRequest"
},
"Pagination": {
"$ref": "https://usp-protocol.dev/schemas/usp.json#/$defs/Pagination"
},
"Service": {
"$ref": "https://usp-protocol.dev/schemas/services/catalog.json#/$defs/Service"
},
"FeedSubscription": {
"$ref": "https://usp-protocol.dev/schemas/rest_common.json#/$defs/FeedSubscription"
},
"TimeSlot": {
"$ref": "https://usp-protocol.dev/schemas/services/availability.json#/$defs/TimeSlot"
},
"Hold": {
"$ref": "https://usp-protocol.dev/schemas/services/availability.json#/$defs/Hold"
},
"Buyer": {
"$ref": "https://usp-protocol.dev/schemas/services/booking.json#/$defs/Buyer"
},
"BuyerConsent": {
"$ref": "https://usp-protocol.dev/schemas/services/booking.json#/$defs/BuyerConsent"
},
"DeliveryAddress": {
"$ref": "https://usp-protocol.dev/schemas/services/booking.json#/$defs/DeliveryAddress"
},
"Booking": {
"$ref": "https://usp-protocol.dev/schemas/services/booking.json#/$defs/Booking"
},
"BookingPayment": {
"$ref": "https://usp-protocol.dev/schemas/services/booking.json#/$defs/BookingPayment"
},
"Action": {
"$ref": "https://usp-protocol.dev/schemas/services/booking.json#/$defs/Action"
},
"Dispute": {
"$ref": "https://usp-protocol.dev/schemas/services/booking.json#/$defs/Dispute"
},
"Message": {
"$ref": "https://usp-protocol.dev/schemas/services/booking.json#/$defs/Message"
},
"PaymentContext": {
"$ref": "https://usp-protocol.dev/schemas/services/booking.json#/$defs/PaymentContext"
},
"PostPaymentReturnRequest": {
"$ref": "https://usp-protocol.dev/schemas/services/booking.json#/$defs/PostPaymentReturnRequest"
},
"WaitlistEntry": {
"$ref": "https://usp-protocol.dev/schemas/services/waitlist.json#/$defs/WaitlistEntry"
},
"ProblemDetails": {
"$ref": "https://usp-protocol.dev/schemas/rest_common.json#/$defs/ProblemDetails"
},
"SigningKey": {
"$ref": "https://usp-protocol.dev/schemas/profile.json#/$defs/SigningKey"
},
"ServiceBinding": {
"$ref": "https://usp-protocol.dev/schemas/usp.json#/$defs/ServiceBinding"
},
"CapabilityEntry": {
"$ref": "https://usp-protocol.dev/schemas/usp.json#/$defs/CapabilityEntry"
},
"ProfileCapabilityEntry": {
"$ref": "https://usp-protocol.dev/schemas/usp.json#/$defs/ProfileCapabilityEntry"
},
"BusinessProfile": {
"$ref": "https://usp-protocol.dev/schemas/profile.json#/$defs/BusinessProfile"
},
"PlatformProfile": {
"$ref": "https://usp-protocol.dev/schemas/profile.json#/$defs/PlatformProfile"
},
"RegistryContext": {
"$ref": "https://usp-protocol.dev/schemas/services/registry.json#/$defs/RegistryContext"
},
"RegistryEntry": {
"$ref": "https://usp-protocol.dev/schemas/services/registry.json#/$defs/RegistryEntry"
},
"BusinessSearchRequest": {
"$ref": "https://usp-protocol.dev/schemas/services/registry.json#/$defs/BusinessSearchRequest"
},
"ServiceSearchRequest": {
"$ref": "https://usp-protocol.dev/schemas/services/registry.json#/$defs/ServiceSearchRequest"
},
"ServiceSearchResult": {
"$ref": "https://usp-protocol.dev/schemas/services/registry.json#/$defs/ServiceSearchResult"
},
"BusyBlock": {
"$ref": "https://usp-protocol.dev/schemas/platform/calendar_freebusy.json#/$defs/BusyBlock"
},
"BuyerFreeBusy": {
"$ref": "https://usp-protocol.dev/schemas/platform/calendar_freebusy.json#/$defs/BuyerFreeBusy"
},
"RegistrationRequest": {
"$ref": "https://usp-protocol.dev/schemas/services/registry.json#/$defs/RegistrationRequest"
}
},
"responses": {
"BadRequest": {
"description": "Protocol error: malformed request, or a signature the verifier cannot evaluate (digest_mismatch, algorithm_unsupported).",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
},
"examples": {
"invalid_request": {
"summary": "Malformed request",
"value": {
"type": "https://usp-protocol.dev/errors/invalid-request",
"title": "Bad Request",
"status": 400,
"detail": "Malformed JSON or missing required fields"
}
},
"algorithm_unsupported": {
"summary": "Signature algorithm not supported by the verifier",
"value": {
"type": "https://usp-protocol.dev/errors/algorithm-unsupported",
"title": "Algorithm Unsupported",
"status": 400,
"detail": "The algorithm of the resolved signing key is not supported; ES256 is the baseline every verifier supports"
}
},
"digest_mismatch": {
"summary": "Content-Digest does not match body",
"value": {
"type": "https://usp-protocol.dev/errors/digest-mismatch",
"title": "Digest Mismatch",
"status": 400,
"detail": "Content-Digest header does not match the computed digest of the request body"
}
},
"invalid_profile_url": {
"summary": "Profile URL malformed, non-HTTPS, or unresolvable",
"value": {
"type": "https://usp-protocol.dev/errors/invalid-profile-url",
"title": "Invalid Profile URL",
"status": 400,
"detail": "The supplied profile URL is malformed, uses a non-HTTPS scheme, or cannot be resolved"
}
},
"cursor_expired": {
"summary": "Pagination cursor no longer honored",
"value": {
"type": "https://usp-protocol.dev/errors/cursor-expired",
"title": "Cursor Expired",
"status": 400,
"detail": "The supplied pagination cursor is no longer honored; restart from the first page"
}
},
"range_too_wide": {
"summary": "Availability range exceeds the supported limit",
"value": {
"type": "https://usp-protocol.dev/errors/range-too-wide",
"title": "Range Too Wide",
"status": 400,
"detail": "The requested availability range exceeds the business's supported limit"
}
},
"version_unsupported": {
"summary": "Requested USP version is not supported",
"value": {
"type": "https://usp-protocol.dev/errors/version-unsupported",
"title": "Version Unsupported",
"status": 400,
"detail": "The requested USP version is not supported by this business"
}
}
}
}
}
},
"Unauthorized": {
"description": "Protocol error: authentication required or signature verification failed. Signature error codes: signature_missing (no Signature/Signature-Input headers), signature_invalid (verification failed), key_not_found (keyid not in signer profile keys/signing_keys), signature_expired (the RFC 9421 'created' signature parameter is outside a freshness window the verifier enforces; note that 'created' is OPTIONAL on request signatures, where replay protection is the signed Idempotency-Key, so this code applies chiefly to webhooks). digest_mismatch and algorithm_unsupported are 400-class; see BadRequest. Responses SHOULD carry WWW-Authenticate naming the mechanisms the business would have accepted (specification.md Section 10.1.6). Proof-of-possession error codes (Section 10.1.6): pop_proof_missing (a required platform_key_pop proof is absent, or a credential carrying cnf was presented without one - a business MUST return this rather than accept the credential as a bearer token), pop_proof_invalid (proof failed to parse or verify, or htm/htu/ath did not match), pop_key_mismatch (the RFC 7638 thumbprint of the proof header jwk does not equal the recorded cnf.jkt - the cross-key replay case), pop_proof_replayed (jti already seen inside the freshness window), and proof_nonce_required (the business requires a nonce; the response carries it and the platform retries with a fresh proof). All are 401 and all are reported through the same Problem Details shape as the signature_* codes above.",
"headers": {
"WWW-Authenticate": {
"description": "SHOULD be present. Names the authentication mechanisms the business would have accepted for this operation, per RFC 9110 and the business's published AuthorizationPolicy. Note that 'signature' is not an IANA-registered auth scheme; HTTP Message Signature support is advertised authoritatively via the profile's authorization policy.",
"required": false,
"schema": {
"type": "string"
},
"example": "Bearer realm=\"usp\", error=\"invalid_token\""
}
},
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
},
"examples": {
"authentication_required": {
"summary": "Missing or invalid credentials",
"value": {
"type": "https://usp-protocol.dev/errors/authentication-required",
"title": "Unauthorized",
"status": 401,
"detail": "Authentication credentials are missing or invalid"
}
},
"signature_missing": {
"summary": "Missing Signature/Signature-Input headers",
"value": {
"type": "https://usp-protocol.dev/errors/signature-missing",
"title": "Signature Missing",
"status": 401,
"detail": "Request does not include required Signature and Signature-Input headers"
}
},
"signature_invalid": {
"summary": "Signature verification failed",
"value": {
"type": "https://usp-protocol.dev/errors/signature-invalid",
"title": "Signature Invalid",
"status": 401,
"detail": "Signature verification failed"
}
},
"key_not_found": {
"summary": "Signing key not found in profile",
"value": {
"type": "https://usp-protocol.dev/errors/key-not-found",
"title": "Key Not Found",
"status": 401,
"detail": "The keyid in Signature-Input does not match any key in the signer's profile"
}
},
"signature_expired": {
"summary": "Signature 'created' parameter outside the verifier's freshness window",
"value": {
"type": "https://usp-protocol.dev/errors/signature-expired",
"title": "Signature Expired",
"status": 401,
"detail": "The 'created' signature parameter is outside the acceptable window"
}
},
"pop_proof_missing": {
"summary": "Proof of possession missing",
"value": {
"type": "https://usp-protocol.dev/errors/pop-proof-missing",
"title": "Proof of possession missing",
"status": 401,
"detail": "The presented booking_scoped_credential carries a cnf confirmation key and is sender-constrained. Present it as 'Authorization: DPoP <credential>' together with a DPoP proof header over the bound key; it MUST NOT be sent as a bearer token."
}
},
"pop_key_mismatch": {
"summary": "Proof key does not match the credential binding",
"value": {
"type": "https://usp-protocol.dev/errors/pop-key-mismatch",
"title": "Proof key does not match the credential binding",
"status": 401,
"detail": "The RFC 7638 thumbprint of the jwk in the DPoP proof header does not match the cnf.jkt this credential was issued against. The credential is bound to a different key."
}
},
"pop_proof_replayed": {
"summary": "Proof replayed",
"value": {
"type": "https://usp-protocol.dev/errors/pop-proof-replayed",
"title": "Proof replayed",
"status": 401,
"detail": "The jti in the DPoP proof has already been seen within the freshness window. Build a fresh proof for each request."
}
},
"pop_proof_required": {
"summary": "Sender-constrained credential presented without a proof",
"value": {
"type": "https://usp-protocol.dev/errors/pop-proof-required",
"title": "Proof of possession required",
"status": 401,
"detail": "A sender-constrained credential was presented without a valid proof of possession"
}
},
"pop_proof_invalid": {
"summary": "Proof failed to parse or verify",
"value": {
"type": "https://usp-protocol.dev/errors/pop-proof-invalid",
"title": "Proof invalid",
"status": 401,
"detail": "The proof failed to parse or verify: bad typ, rejected alg, signature failure, or a mismatched htm/htu, usp_m/aud/usp_p, or ath"
}
},
"proof_nonce_required": {
"summary": "Business requires a nonce in the proof",
"value": {
"type": "https://usp-protocol.dev/errors/proof-nonce-required",
"title": "Proof nonce required",
"status": 401,
"detail": "The business requires a nonce. Retry with a fresh proof carrying the nonce supplied in this response."
}
}
}
}
}
},
"NotFound": {
"description": "Protocol error: the resource addressed by the request path does not exist or is not visible to the caller. Path-addressed operations MUST return 404 rather than a 200 with a messages[] entry, so that a missing resource is distinguishable from a successful read. See specification.md Section 9.4.1.",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
},
"examples": {
"booking_not_found": {
"summary": "Booking in the request path does not exist",
"value": {
"type": "https://usp-protocol.dev/errors/booking-not-found",
"title": "Not Found",
"status": 404,
"detail": "The requested booking does not exist or is not visible to the caller"
}
},
"entry_not_found": {
"summary": "Waitlist entry in the request path does not exist",
"value": {
"type": "https://usp-protocol.dev/errors/entry-not-found",
"title": "Not Found",
"status": 404,
"detail": "The requested waitlist entry does not exist or is not visible to the caller"
}
}
}
}
}
},
"Conflict": {
"description": "Idempotency key conflict",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
},
"example": {
"type": "https://usp-protocol.dev/errors/idempotency-conflict",
"title": "Conflict",
"status": 409,
"detail": "Idempotency key was previously used with different parameters"
}
}
}
},
"UnprocessableEntity": {
"description": "Protocol error: the request was well-formed but failed validation (validation_error), or a referenced profile document failed schema validation (profile_malformed). See specification.md Section 9.4.3.",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
},
"examples": {
"validation_error": {
"summary": "Request fields failed validation",
"value": {
"type": "https://usp-protocol.dev/errors/validation-error",
"title": "Unprocessable Entity",
"status": 422,
"detail": "One or more request fields failed validation"
}
},
"profile_malformed": {
"summary": "Profile document fails schema validation",
"value": {
"type": "https://usp-protocol.dev/errors/profile-malformed",
"title": "Profile Malformed",
"status": 422,
"detail": "The profile document is not valid JSON or fails schema validation against schemas/profile.json"
}
}
}
}
}
},
"Forbidden": {
"description": "Profile not trusted",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
},
"example": {
"type": "https://usp-protocol.dev/errors/profile-not-trusted",
"title": "Forbidden",
"status": 403,
"detail": "The platform profile URL is not in the business's pre-approved allowlist"
}
}
}
},
"FailedDependency": {
"description": "Profile unreachable",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
},
"example": {
"type": "https://usp-protocol.dev/errors/profile-unreachable",
"title": "Failed Dependency",
"status": 424,
"detail": "Business profile could not be fetched"
}
}
}
},
"TooManyRequests": {
"description": "Protocol error: the caller exceeded the applicable request rate (rate_limited), or the buyer already holds the maximum number of concurrent holds the business permits (hold_limit_exceeded). See specification.md Sections 9.4.3 and 10.1.2.",
"headers": {
"Retry-After": {
"schema": {
"type": "integer"
}
}
},
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
},
"examples": {
"rate_limited": {
"summary": "Request rate exceeded",
"value": {
"type": "https://usp-protocol.dev/errors/rate-limited",
"title": "Too Many Requests",
"status": 429,
"detail": "Rate limit exceeded"
}
},
"hold_limit_exceeded": {
"summary": "Buyer already at the concurrent hold limit",
"value": {
"type": "https://usp-protocol.dev/errors/hold-limit-exceeded",
"title": "Hold Limit Exceeded",
"status": 429,
"detail": "The buyer already holds the maximum number of concurrent holds permitted for this service. Release an existing hold before requesting another."
}
}
}
}
}
},
"InternalServerError": {
"description": "Server error",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
},
"example": {
"type": "https://usp-protocol.dev/errors/server-error",
"title": "Internal Server Error",
"status": 500,
"detail": "An unexpected error occurred"
}
}
}
},
"ServiceUnavailable": {
"description": "Service temporarily unavailable. The business is temporarily unable to handle requests.",
"headers": {
"Retry-After": {
"description": "Number of seconds to wait before retrying.",
"schema": {
"type": "integer"
}
}
},
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
},
"example": {
"type": "https://usp-protocol.dev/errors/service-unavailable",
"title": "Service Unavailable",
"status": 503,
"detail": "The business is temporarily unable to handle requests"
}
}
}
},
"PreconditionFailed": {
"description": "Conditional-write precondition failed: the If-Match revision is stale, so the resource changed since the platform last observed it. Distinct from 409, which this API uses for idempotency-key conflicts. Re-read the resource, reconcile, and retry with the new revision.",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
},
"example": {
"type": "https://usp-protocol.dev/errors/revision-mismatch",
"title": "Precondition Failed",
"status": 412,
"detail": "The If-Match revision is stale; the booking changed since it was read. Re-read the booking and retry with the current revision."
}
}
}
}
},
"securitySchemes": {
"HttpMessageSignature": {
"type": "http",
"scheme": "signature",
"description": "RFC 9421 HTTP Message Signatures, keyed off the keys (or transition signing_keys alias; verifiers resolve keys first) published in the platform profile referenced by the USP-Agent/UCP-Agent header. RECOMMENDED default mechanism: requires no pre-established credential, so a personal single-user agent can authenticate solely by publishing a profile. Covered components are UCP's REST set so one signature satisfies both verifiers: @method, @authority and @path are always covered, plus @query, usp-agent (or ucp-agent), idempotency-key, content-digest and content-type when present. @target-uri MAY be covered additionally but MUST NOT replace @authority and @path. The 'created' parameter is OPTIONAL; request replay protection is the signed Idempotency-Key. ECDSA signature values use fixed-width raw r||s encoding, not DER, and verifiers MUST support ES256. See specification.md Section 9.1.4 and Section 10.1.6. Note: 'signature' is not an IANA-registered HTTP auth scheme; this entry documents USP's use of RFC 9421 rather than asserting WWW-Authenticate scheme registration. Mechanism identifier shared with schemas/profile.json#/$defs/AuthorizationMechanism and with openrpc/usp-mcp.json components.x-usp-securitySchemes; that identifier set is open, and consumers ignore unrecognized mechanisms rather than treating them as accepted.",
"x-usp-mechanism": "http_message_signature"
},
"PlatformKeyPop": {
"type": "apiKey",
"in": "header",
"name": "DPoP",
"description": "Platform key proof-of-possession, carried as an RFC 9449 dpop+jwt proof on the DPoP request header. The caller generates an ephemeral key, never transmits the private half, and proves possession on each privileged request by presenting a compact JWS whose header carries the bare public JWK; the business computes the RFC 7638 thumbprint (jkt), records it as the platform identifier, and binds it to the USP-Agent profile URI on first contact. Permissionless: no registration, no token endpoint, no pre-established credential, and no published or rotated platform keys - the platform profile stays keyless. Modelled as apiKey/header/DPoP rather than http/DPoP deliberately: on a resource-creating call there is NO Authorization header at all, and the proof header is itself the credential, so an http scheme would misdescribe the wire form at issuance. At issuance the proof carries no ath and the business records the thumbprint. At presentation it carries ath over the credential value and the business compares the thumbprint against the recorded cnf.jkt; that case appears in a security requirement object ANDed with BookingScopedCredential, since both must be satisfied together. Off-the-shelf DPoP libraries apply, and DPoP is an IANA-registered authentication scheme - unlike 'signature' above. The MCP binding carries the proof in _meta.usp.authorization.proof on both its transports instead; see openrpc/usp-mcp.json. See specification.md Section 10.1.6 and schemas/usp.json#/$defs/PopProofJwt. Mechanism identifier shared with schemas/profile.json#/$defs/AuthorizationMechanism and with openrpc/usp-mcp.json components.x-usp-securitySchemes; that identifier set is open, and consumers ignore unrecognized mechanisms rather than treating them as accepted.",
"x-usp-mechanism": "platform_key_pop"
},
"BookingScopedCredential": {
"type": "http",
"scheme": "DPoP",
"description": "Resource-scoped capability credential issued at creation, authorizing get/update/cancel/reschedule/PII-bearing operations on that single resource independent of platform identity. It does not authorize confirm. The resource is a booking, a waitlist entry, or a feed subscription. Registry registrations are NOT in this set: they are authorized at platform tier against the registering platform's bound jkt, since a registry entry has exactly one owner and needs no separate credential type. Transmitted as 'Authorization: DPoP <bsc_...>'. Shape defined at schemas/profile.json#/$defs/BookingScopedCredential and returned by the creation responses. The DPoP scheme replaces Bearer for two reasons. It removes this credential from the Authorization: Bearer slot it previously shared with OAuth2Bearer and ApiKey, where a server could not tell from the request alone which scheme the caller intended. And it stops a business silently accepting a sender-constrained credential as a plain bearer token. When the credential carries a cnf confirmation key it is sender-constrained and MUST be presented together with a PlatformKeyPop proof over the bound key - the requirement object listing both is that case, and OpenAPI cannot express the 'only when cnf is present' condition, so the credential-alone alternative remains listed for unbound legacy credentials while the MUST is carried in specification.md Section 10.1.6. A business that issued a cnf-bearing credential MUST NOT accept it without a proof, whatever mechanism the caller declares. Mechanism identifier shared with schemas/profile.json#/$defs/AuthorizationMechanism and with openrpc/usp-mcp.json components.x-usp-securitySchemes.",
"x-usp-mechanism": "booking_scoped_credential"
},
"OAuth2Bearer": {
"type": "http",
"scheme": "bearer",
"description": "OAuth 2.0 Bearer token (RFC 6749 client_credentials grant for platform-to-business auth, or RFC 6750 for token transmission). Pre-established host-platform credential. See specification.md Section 10.1.6 and Section 10.2.3. Mechanism identifier shared with schemas/profile.json#/$defs/AuthorizationMechanism and with openrpc/usp-mcp.json components.x-usp-securitySchemes.",
"x-usp-mechanism": "oauth2_bearer"
},
"ApiKey": {
"type": "apiKey",
"in": "header",
"name": "Authorization",
"description": "Pre-shared API key transmitted as 'Authorization: Bearer <key>'. Pre-established host-platform credential suited to simple integrations. See specification.md Section 10.1.6 and Section 10.2.3. Mechanism identifier shared with schemas/profile.json#/$defs/AuthorizationMechanism and with openrpc/usp-mcp.json components.x-usp-securitySchemes.",
"x-usp-mechanism": "api_key"
},
"MutualTLS": {
"type": "mutualTLS",
"description": "Client-certificate authentication for high-security environments. Pre-established host-platform credential. See specification.md Section 10.1.6 and Section 10.2.3. Mechanism identifier shared with schemas/profile.json#/$defs/AuthorizationMechanism and with openrpc/usp-mcp.json components.x-usp-securitySchemes.",
"x-usp-mechanism": "mtls"
}
}
},
"paths": {
"/services/list": {
"post": {
"tags": [
"Services"
],
"summary": "List Services",
"operationId": "listServices",
"parameters": [
{
"$ref": "#/components/parameters/USP-Agent"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Free-text search query across service names, descriptions, and categories. When present, the business SHOULD rank results by relevance. Businesses that do not support search MUST ignore this field (not return an error). Aligns with UCP catalog_search."
},
"filters": {
"type": "object",
"description": "Filter criteria to narrow results. All specified filters combine with AND logic.",
"properties": {
"type": {
"type": "string",
"description": "Service vertical to filter by (e.g., appointment, group, reservation)."
},
"category_id": {
"type": "string",
"description": "Single category ID to filter by. Shorthand for categories with one value. If both category_id and categories are provided, categories takes precedence. Matches the primary categories[] entry's id, and MAY match any entry's id."
},
"categories": {
"type": "array",
"items": {
"type": "string"
},
"description": "Category IDs to filter by (OR logic - matches services in any listed category). Aligns with UCP catalog_search filters. Match rule: primary entry id, and MAY match any entry's id."
},
"location_id": {
"type": "string",
"description": "Location ID to filter by (for multi-location businesses)."
},
"price": {
"type": "object",
"description": "Price range filter in minor currency units. Currency determined by context.currency or the business's default currency.",
"properties": {
"min": {
"type": "integer",
"description": "Minimum price in minor currency units (e.g., 5000 = $50.00)."
},
"max": {
"type": "integer",
"description": "Maximum price in minor currency units (e.g., 15000 = $150.00)."
}
}
}
}
},
"context": {
"type": "object",
"description": "Buyer locale and intent signals for relevance, localization, and personalization. Aligns with UCP context pattern. Businesses SHOULD use context when available and MUST ignore unrecognized fields without error.",
"properties": {
"address_country": {
"type": "string",
"description": "Buyer's country (ISO 3166-1 alpha-2, e.g., US). Hint for market context."
},
"address_region": {
"type": "string",
"description": "Region within the country (e.g., California). Optional localization hint."
},
"postal_code": {
"type": "string",
"description": "Postal code (e.g., 94043). Optional regional refinement hint."
},
"coordinates": {
"type": "object",
"description": "Buyer's geographic coordinates for proximity-based ranking. Higher-resolution than postal code; location_id filter supersedes for multi-location businesses.",
"required": [
"latitude",
"longitude"
],
"properties": {
"latitude": {
"type": "number",
"minimum": -90,
"maximum": 90,
"description": "Latitude in WGS 84 decimal degrees."
},
"longitude": {
"type": "number",
"minimum": -180,
"maximum": 180,
"description": "Longitude in WGS 84 decimal degrees."
}
}
},
"language": {
"type": "string",
"description": "Preferred language (IETF BCP 47, e.g., en, fr-CA). Business MAY return content in a different language if unavailable."
},
"currency": {
"type": "string",
"description": "Preferred currency (ISO 4217, e.g., USD, EUR). Used as denomination for price filter values. Response prices include explicit currency."
},
"intent": {
"type": "string",
"description": "Free-text description of the buyer's intent (e.g., 'looking for a relaxing spa treatment'). Informs relevance and recommendations."
}
},
"additionalProperties": true
},
"pagination": {
"$ref": "#/components/schemas/PaginationRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "List of services",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/USPEnvelope"
},
{
"type": "object",
"required": [
"services",
"pagination"
],
"properties": {
"services": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Service"
}
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
},
"messages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Message"
},
"description": "Optional errors, warnings, or informational messages about the response (e.g., partial results, filter feedback, service-level notices)."
}
}
}
]
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"422": {
"$ref": "#/components/responses/UnprocessableEntity"
},
"424": {
"$ref": "#/components/responses/FailedDependency"
},
"429": {
"$ref": "#/components/responses/TooManyRequests"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
},
"security": []
}
},
"/services/{service_id}": {
"get": {
"tags": [
"Services"
],
"summary": "Get Service",
"operationId": "getService",
"parameters": [
{
"$ref": "#/components/parameters/USP-Agent"
},
{
"name": "service_id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Service details",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/USPEnvelope"
},
{
"type": "object",
"required": [
"service"
],
"properties": {
"service": {
"$ref": "#/components/schemas/Service"
},
"messages": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Message"
},
"description": "Optional errors, warnings, or informational messages about the service (e.g., temporarily suspended, pricing provisional)."
}
}
}
]
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"424": {
"$ref": "#/components/responses/FailedDependency"
},
"429": {
"$ref": "#/components/responses/TooManyRequests"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
}
},
"security": []
}
},
"/services/lookup": {
"post": {
"tags": [
"Services"
],
"summary": "Lookup Services",
"operationId": "lookupServices",
"description": "Returns full service objects for a batch of service IDs. Analogous to UCP catalog_lookup. Designed for hydrating multiple service references in a single request.",
"parameters": [
{
"$ref": "#/components/parameters/USP-Agent"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ids"
],
"properties": {
"ids": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"description": "Service IDs to look up. Businesses MUST accept at least 50 IDs. Duplicates are silently deduplicated."
},
"context": {
"type": "object",
"description": "Buyer locale and intent signals for localization of returned service content. Same definition as on POST /services/list. Businesses MUST ignore unrecognized fields without error.",
"properties": {
"address_country": {
"type": "string",
"description": "Buyer's country (ISO 3166-1 alpha-2, e.g., US)."
},
"address_region": {
"type": "string",
"description": "Region within the country (e.g., California)."
},
"postal_code": {
"type": "string",
"description": "Postal code (e.g., 94043)."
},
"coordinates": {
"type": "object",
"description": "Buyer's geographic coordinates for proximity context.",
"required": [
"latitude",
"longitude"
],
"properties": {
"latitude": {
"type": "number",
"minimum": -90,
"maximum": 90,
"description": "Latitude in WGS 84 decimal degrees."
},
"longitude": {
"type": "number",
"minimum": -180,
"maximum": 180,
"description": "Longitude in WGS 84 decimal degrees."
}
}
},
"language": {
"type": "string",
"description": "Preferred language (IETF BCP 47, e.g., en, fr-CA)."
},
"currency": {
"type": "string",
"description": "Preferred currency (ISO 4217, e.g., USD, EUR)."
},
"intent": {
"type": "string",
"description": "Free-text buyer intent."
}
},
"additionalProperties": true
}
}
}
}
}
},