-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstytch-openapi.yml
More file actions
5511 lines (5358 loc) · 178 KB
/
stytch-openapi.yml
File metadata and controls
5511 lines (5358 loc) · 178 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
# Generated from Postman collection
# and hand-edited from there. Good luck!
openapi: 3.1.0
info:
title: "Stytch B2B API [Last Updated: 2024-02-14]"
description: >-
Stytch’s B2B API is designed to address the unique authentication and user
management needs of organization-based applications at every stage of
growth.
version: 1.0.0
servers:
- description: Test environment
url: https://test.stytch.com
- description: Live environment
url: https://api.stytch.com
components:
schemas:
ActiveSCIMConnection:
type: object
properties:
connection_id:
type: string
display_name:
type: string
bearer_token_last_four:
type: string
bearer_token_expires_at:
type: string
format: date-time
required:
- connection_id
- display_name
- bearer_token_last_four
ActiveSSOConnection:
type: object
properties:
connection_id:
type: string
display_name:
type: string
identity_provider:
type: string
required:
- connection_id
- display_name
- identity_provider
AmazonOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
AppleOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
AuthenticatorAppFactor:
type: object
properties:
totp_id:
type: string
required:
- totp_id
AuthenticationFactor:
type: object
properties:
type:
type: string
description: >
The type of authentication factor. Possible values include `magic_link`, `otp`, `oauth`, `password`, `email_otp`, `sso`, etc.
delivery_method:
type: string
description: >
The method used to deliver the authentication factor. Possible values depend on the `type`.
last_authenticated_at:
type: string
format: date-time
description: >
The timestamp when the factor was last authenticated.
created_at:
type: string
format: date-time
description: >
The timestamp when the factor was initially authenticated.
updated_at:
type: string
format: date-time
description: >
The timestamp when the factor was last updated.
email_factor:
$ref: "#/components/schemas/EmailFactor"
phone_number_factor:
$ref: "#/components/schemas/PhoneNumberFactor"
google_oauth_factor:
$ref: "#/components/schemas/GoogleOAuthFactor"
microsoft_oauth_factor:
$ref: "#/components/schemas/MicrosoftOAuthFactor"
apple_oauth_factor:
$ref: "#/components/schemas/AppleOAuthFactor"
amazon_oauth_factor:
$ref: "#/components/schemas/AmazonOAuthFactor"
webauthn_factor:
$ref: "#/components/schemas/WebAuthnFactor"
authenticator_app_factor:
$ref: "#/components/schemas/AuthenticatorAppFactor"
github_oauth_factor:
$ref: "#/components/schemas/GithubOAuthFactor"
recovery_code_factor:
$ref: "#/components/schemas/RecoveryCodeFactor"
facebook_oauth_factor:
$ref: "#/components/schemas/FacebookOAuthFactor"
crypto_wallet_factor:
$ref: "#/components/schemas/CryptoWalletFactor"
bitbucket_oauth_factor:
$ref: "#/components/schemas/BitbucketOAuthFactor"
coinbase_oauth_factor:
$ref: "#/components/schemas/CoinbaseOAuthFactor"
discord_oauth_factor:
$ref: "#/components/schemas/DiscordOAuthFactor"
figma_oauth_factor:
$ref: "#/components/schemas/FigmaOAuthFactor"
git_lab_oauth_factor:
$ref: "#/components/schemas/GitLabOAuthFactor"
instagram_oauth_factor:
$ref: "#/components/schemas/InstagramOAuthFactor"
linked_in_oauth_factor:
$ref: "#/components/schemas/LinkedInOAuthFactor"
shopify_oauth_factor:
$ref: "#/components/schemas/ShopifyOAuthFactor"
slack_oauth_factor:
$ref: "#/components/schemas/SlackOAuthFactor"
snapchat_oauth_factor:
$ref: "#/components/schemas/SnapchatOAuthFactor"
spotify_oauth_factor:
$ref: "#/components/schemas/SpotifyOAuthFactor"
steam_oauth_factor:
$ref: "#/components/schemas/SteamOAuthFactor"
tik_tok_oauth_factor:
$ref: "#/components/schemas/TikTokOAuthFactor"
twitch_oauth_factor:
$ref: "#/components/schemas/TwitchOAuthFactor"
twitter_oauth_factor:
$ref: "#/components/schemas/TwitterOAuthFactor"
embeddable_magic_link_factor:
$ref: "#/components/schemas/EmbeddableMagicLinkFactor"
biometric_factor:
$ref: "#/components/schemas/BiometricFactor"
saml_sso_factor:
$ref: "#/components/schemas/SAMLSSOFactor"
oidc_sso_factor:
$ref: "#/components/schemas/OIDCSSOFactor"
salesforce_oauth_factor:
$ref: "#/components/schemas/SalesforceOAuthFactor"
yahoo_oauth_factor:
$ref: "#/components/schemas/YahooOAuthFactor"
hubspot_oauth_factor:
$ref: "#/components/schemas/HubspotOAuthFactor"
slack_oauth_exchange_factor:
$ref: "#/components/schemas/SlackOAuthExchangeFactor"
hubspot_oauth_exchange_factor:
$ref: "#/components/schemas/HubspotOAuthExchangeFactor"
github_oauth_exchange_factor:
$ref: "#/components/schemas/GithubOAuthExchangeFactor"
google_oauth_exchange_factor:
$ref: "#/components/schemas/GoogleOAuthExchangeFactor"
impersonated_factor:
$ref: "#/components/schemas/ImpersonatedFactor"
oauth_access_token_exchange_factor:
$ref: "#/components/schemas/OAuthAccessTokenExchangeFactor"
required:
- type
- delivery_method
BiometricFactor:
type: object
properties:
biometric_registration_id:
type: string
required:
- biometric_registration_id
BitbucketOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
CoinbaseOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
Connection:
type: object
properties:
organization_id:
type: string
connection_id:
type: string
external_organization_id:
type: string
external_connection_id:
type: string
display_name:
type: string
status:
type: string
external_connection_implicit_role_assignments:
type: array
items:
$ref: "#/components/schemas/ConnectionImplicitRoleAssignment"
external_group_implicit_role_assignments:
type: array
items:
$ref: "#/components/schemas/GroupImplicitRoleAssignment"
required:
- organization_id
- connection_id
- external_organization_id
- external_connection_id
- display_name
- status
- external_connection_implicit_role_assignments
- external_group_implicit_role_assignments
ConnectionImplicitRoleAssignment:
type: object
properties:
role_id:
type: string
description: >
The unique identifier of the RBAC Role, provided by the developer and intended to be human-readable.
required:
- role_id
CryptoWalletFactor:
type: object
properties:
crypto_wallet_id:
type: string
crypto_wallet_address:
type: string
crypto_wallet_type:
type: string
required:
- crypto_wallet_id
- crypto_wallet_address
- crypto_wallet_type
DiscordOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
DiscoveredOrganization:
type: object
properties:
member_authenticated:
type: boolean
description: >
Indicates whether the Member has all of the factors needed to fully authenticate to this Organization.
If false, the Member may need to complete an MFA step or complete a different primary authentication
flow. See the `primary_required` and `mfa_required` fields for more details on each.
organization:
$ref: "#/components/schemas/Organization"
description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
membership:
$ref: "#/components/schemas/Membership"
description: Information about the membership.
primary_required:
$ref: "#/components/schemas/PrimaryRequired"
description: Information about the primary authentication requirements of the Organization.
mfa_required:
$ref: "#/components/schemas/MfaRequired"
description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
required:
- member_authenticated
EmailFactor:
type: object
properties:
email_id:
type: string
description: >
The globally unique UUID of the Member's email.
email_address:
type: string
description: >
The email address of the Member.
required:
- email_id
- email_address
EmailImplicitRoleAssignment:
type: object
properties:
domain:
type: string
role_id:
type: string
required:
- domain
- role_id
EmbeddableMagicLinkFactor:
type: object
properties:
embedded_id:
type: string
required:
- embedded_id
ErrorResponse:
type: object
properties:
error_message:
type: string
error_type:
type: string
error_url:
type: string
request_id:
type: string
status_code:
type: integer
FacebookOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
FigmaOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
GitLabOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
GithubOAuthExchangeFactor:
type: object
properties:
email_id:
type: string
required:
- email_id
GithubOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
GoogleOAuthExchangeFactor:
type: object
properties:
email_id:
type: string
required:
- email_id
GoogleOAuthFactor:
type: object
properties:
id:
type: string
description: >
The unique ID of an OAuth registration.
provider_subject:
type: string
description: >
The unique identifier for the User within a given OAuth provider.
email_id:
type: string
description: >
The globally unique UUID of the Member's email.
required:
- id
- provider_subject
GroupImplicitRoleAssignment:
type: object
properties:
role_id:
type: string
description: >
The unique identifier of the RBAC Role, provided by the developer and intended to be human-readable.
group:
type: string
description: >
The name of the group that grants the specified role assignment.
required:
- role_id
- group
HubspotOAuthExchangeFactor:
type: object
properties:
email_id:
type: string
required:
- email_id
HubspotOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
ImpersonatedFactor:
type: object
properties:
impersonator_id:
type: string
impersonator_email_address:
type: string
required:
- impersonator_id
- impersonator_email_address
InstagramOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
JWK:
type: object
properties:
kty:
type: string
description: Key type.
use:
type: string
description: Public key use.
key_ops:
type: array
items:
type: string
description: Key operations.
alg:
type: string
description: Algorithm.
kid:
type: string
description: Key ID.
x5c:
type: array
items:
type: string
description: X.509 certificate chain.
n:
type: string
description: RSA modulus.
e:
type: string
description: RSA public exponent.
required:
- kty
- kid
LinkedInOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
Member:
type: object
properties:
organization_id:
type: string
description: >-
Globally unique UUID that identifies a specific Organization.
member_id:
type: string
description: >-
Globally unique UUID that identifies a specific Member.
email_address:
type: string
description: The email address of the Member.
status:
type: string
description: >-
The status of the Member. The possible values are: `pending`, `invited`, `active`, or `deleted`.
name:
type: string
description: The name of the Member.
sso_registrations:
type: array
items:
$ref: "#/components/schemas/SSORegistration"
is_breakglass:
type: boolean
description: >-
Identifies the Member as a break glass user for emergency access.
member_password_id:
type: string
description: >-
Globally unique UUID that identifies a Member's password.
oauth_registrations:
type: array
items:
$ref: "#/components/schemas/OAuthRegistration"
email_address_verified:
type: boolean
description: >-
Whether or not the Member's email address is verified.
mfa_phone_number_verified:
type: boolean
description: >-
Whether or not the Member's phone number is verified.
is_admin:
type: boolean
description: >-
Whether or not the Member has the `stytch_admin` Role.
totp_registration_id:
type: string
description: >-
Globally unique UUID that identifies a Member's TOTP registration.
retired_email_addresses:
type: array
items:
$ref: "#/components/schemas/RetiredEmail"
mfa_enrolled:
type: boolean
description: >-
Whether the Member is enrolled in MFA.
mfa_phone_number:
type: string
description: >-
The Member's phone number. A Member may only have one phone number.
default_mfa_method:
type: string
description: >-
The default MFA method for the Member.
roles:
type: array
items:
$ref: "#/components/schemas/MemberRole"
trusted_metadata:
type: object
additionalProperties: true
description: >-
An arbitrary JSON object for storing application-specific data or identity-provider-specific data.
untrusted_metadata:
type: object
additionalProperties: true
description: >-
An arbitrary JSON object of application-specific data.
created_at:
type: string
format: date-time
description: >-
The timestamp of the Member's creation.
updated_at:
type: string
format: date-time
description: >-
The timestamp of when the Member was last updated.
scim_registration:
$ref: "#/components/schemas/SCIMRegistration"
external_id:
type: string
description: >-
The ID of the member given by the identity provider.
required:
- organization_id
- member_id
- email_address
- status
- name
- sso_registrations
- is_breakglass
- member_password_id
- oauth_registrations
- email_address_verified
- mfa_phone_number_verified
- is_admin
- totp_registration_id
- retired_email_addresses
- mfa_enrolled
- mfa_phone_number
- default_mfa_method
- roles
Membership:
type: object
properties:
type:
type: string
description: >
Either `active_member`, `pending_member`, `invited_member`, `eligible_to_join_by_email_domain`, or
`eligible_to_join_by_oauth_tenant`
details:
type: object
additionalProperties: true
description: An object containing additional metadata about the membership, if available.
member:
$ref: "#/components/schemas/Member"
description: >
The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one
does not.
required:
- type
MemberOptions:
type: object
properties:
mfa_phone_number:
type: string
description: The Member's MFA phone number.
totp_registration_id:
type: string
description: The Member's MFA TOTP registration ID.
required:
- mfa_phone_number
- totp_registration_id
MemberRole:
type: object
properties:
role_id:
type: string
description: >-
The unique identifier of the RBAC Role.
sources:
type: array
items:
$ref: "#/components/schemas/MemberRoleSource"
required:
- role_id
- sources
MemberRoleSource:
type: object
properties:
type:
type: string
description: >-
The type of role assignment.
details:
type: object
additionalProperties: true
description: >-
Additional metadata about the source assignment.
required:
- type
MemberSession:
type: object
properties:
member_session_id:
type: string
description: Globally unique UUID that identifies a specific Session.
member_id:
type: string
description: Globally unique UUID that identifies a specific Member.
started_at:
type: string
format: date-time
description: >
The timestamp when the Session was created. Values conform to the RFC 3339 standard and are expressed in UTC.
last_accessed_at:
type: string
format: date-time
description: >
The timestamp when the Session was last accessed. Values conform to the RFC 3339 standard and are expressed in UTC.
expires_at:
type: string
format: date-time
description: >
The timestamp when the Session expires. Values conform to the RFC 3339 standard and are expressed in UTC.
authentication_factors:
type: array
items:
$ref: "#/components/schemas/AuthenticationFactor"
description: An array of different authentication factors that comprise a Session.
organization_id:
type: string
description: >
Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization.
roles:
type: array
items:
type: string
description: A list of roles assigned to the Member in the Session.
custom_claims:
type: object
additionalProperties: true
description: >
The custom claims map for a Session. Claims can be added to a session during a Sessions authenticate call.
required:
- member_session_id
- member_id
- started_at
- last_accessed_at
- expires_at
- authentication_factors
- organization_id
- roles
MfaRequired:
type: object
properties:
member_options:
$ref: "#/components/schemas/MemberOptions"
description: Information about the Member's options for completing MFA.
secondary_auth_initiated:
type: string
description: >
If null, indicates that no secondary authentication has been initiated. If equal to "sms_otp", indicates
that the Member has a phone number, and a one time passcode has been sent to the Member's phone number.
No secondary authentication will be initiated during calls to the discovery authenticate or list
organizations endpoints, even if the Member has a phone number.
MicrosoftOAuthFactor:
type: object
properties:
id:
type: string
description: >
The unique ID of an OAuth registration.
provider_subject:
type: string
description: >
The unique identifier for the User within a given OAuth provider.
email_id:
type: string
description: >
The globally unique UUID of the Member's email.
required:
- id
- provider_subject
OAuthAccessTokenExchangeFactor:
type: object
properties:
client_id:
type: string
required:
- client_id
OAuthRegistration:
type: object
properties:
provider_type:
type: string
description: >-
Denotes the OAuth identity provider the user has authenticated with.
provider_subject:
type: string
description: >-
The unique identifier for the User within a given OAuth provider.
member_oauth_registration_id:
type: string
description: >-
The unique ID of an OAuth registration.
profile_picture_url:
type: string
description: >-
If available, the URL of the User's profile picture set in the OAuth provider.
locale:
type: string
description: >-
If available, the Member's locale set in the OAuth provider.
required:
- provider_type
- provider_subject
- member_oauth_registration_id
OIDCConnection:
type: object
properties:
organization_id:
type: string
connection_id:
type: string
status:
type: string
display_name:
type: string
redirect_url:
type: string
client_id:
type: string
client_secret:
type: string
issuer:
type: string
authorization_url:
type: string
token_url:
type: string
userinfo_url:
type: string
jwks_url:
type: string
identity_provider:
type: string
custom_scopes:
type: string
attribute_mapping:
type: object
additionalProperties: true
required:
- organization_id
- connection_id
- status
- display_name
- redirect_url
- client_id
- client_secret
- issuer
- authorization_url
- token_url
- userinfo_url
- jwks_url
- identity_provider
- custom_scopes
OIDCProviderInfo:
type: object
properties:
provider_subject:
type: string
id_token:
type: string
access_token:
type: string
access_token_expires_at:
type: string
format: date-time
scopes:
type: array
items:
type: string
connection_id:
type: string
refresh_token:
type: string
required:
- provider_subject
- id_token
- access_token
- access_token_expires_at
- scopes
- connection_id
OIDCSSOFactor:
type: object
properties:
id:
type: string
provider_id:
type: string
external_id:
type: string
required:
- id
- provider_id
- external_id
Organization:
type: object
properties:
allowed_auth_methods:
type: array
items:
type: string
enum:
- sso
- magic_link
- email_otp
- password
- google_oauth
- microsoft_oauth
- slack_oauth
- github_oauth
- hubspot_oauth
description: >-
An array of allowed authentication methods.
This list is enforced when auth_methods is set to RESTRICTED.
The list's accepted values are: sso, magic_link, email_otp, password, google_oauth, microsoft_oauth, slack_oauth, github_oauth, and hubspot_oauth.
allowed_mfa_methods:
type: array
items:
type: string
enum:
- sms_otp
- totp
description: >-
An array of allowed MFA authentication methods.
This list is enforced when mfa_methods is set to RESTRICTED.
The list's accepted values are: sms_otp and totp.
allowed_oauth_tenants:
type: object
additionalProperties: true
description: >-
A map of allowed OAuth tenants.
If this field is not passed in, the Organization will not allow JIT provisioning by OAuth Tenant.
Allowed keys are "slack", "hubspot", and "github".
auth_methods:
type: string