@workos/openapi-spec 0.75.0 → 0.77.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,6 +74,10 @@ paths:
74
74
  - org_01EHWNCE74X7JSDV0X3SZ3KJNY
75
75
  description: Who may mint sessions from this blueprint.
76
76
  session_settings:
77
+ default:
78
+ max_age_seconds: 3600
79
+ access_token_ttl_seconds: 300
80
+ refresh_token_ttl_seconds: 3600
77
81
  type: object
78
82
  properties:
79
83
  max_age_seconds:
@@ -110,7 +114,6 @@ paths:
110
114
  blueprint.
111
115
  required:
112
116
  - name
113
- - session_settings
114
117
  description: Configuration for the new agent blueprint.
115
118
  responses:
116
119
  '201':
@@ -975,6 +978,139 @@ paths:
975
978
  tags:
976
979
  - agents.blueprints.tokens
977
980
  x-feature-flag: agent-blueprints-public-api
981
+ /agents/blueprints/{agent_blueprint_id}/tokens/validate:
982
+ post:
983
+ description: >-
984
+ Validates an agent access token: verifies its signature against the
985
+ environment, that it was minted under this blueprint, and that the
986
+ backing session is live (not revoked or expired, and — for delegated
987
+ sessions — that the delegating user session has not ended). Returns the
988
+ token claims and session metadata when valid; invalid tokens are
989
+ reported as errors with stable codes.
990
+ operationId: AgentBlueprintsTokenController_validateToken
991
+ parameters:
992
+ - name: agent_blueprint_id
993
+ required: true
994
+ in: path
995
+ description: The unique ID of the agent blueprint.
996
+ schema:
997
+ type: string
998
+ example: agent_blueprint_01EHWNCE74X7JSDV0X3SZ3KJNY
999
+ requestBody:
1000
+ required: true
1001
+ content:
1002
+ application/json:
1003
+ schema:
1004
+ type: object
1005
+ properties:
1006
+ agent_access_token:
1007
+ type: string
1008
+ minLength: 1
1009
+ description: The agent access token (a JWT) to validate.
1010
+ example: eyJhbGciOiJSUzI1NiIsImtpZCI6...
1011
+ required:
1012
+ - agent_access_token
1013
+ description: The agent access token to validate.
1014
+ responses:
1015
+ '200':
1016
+ description: OK
1017
+ content:
1018
+ application/json:
1019
+ schema:
1020
+ $ref: '#/components/schemas/AgentTokenValidation'
1021
+ '400':
1022
+ description: Bad Request
1023
+ content:
1024
+ application/json:
1025
+ schema:
1026
+ oneOf:
1027
+ - type: object
1028
+ properties:
1029
+ code:
1030
+ type: string
1031
+ description: The error code identifying the type of error.
1032
+ example: invalid_request
1033
+ const: invalid_request
1034
+ message:
1035
+ type: string
1036
+ description: A human-readable description of the error.
1037
+ example: Request could not be processed.
1038
+ required:
1039
+ - code
1040
+ - message
1041
+ - type: object
1042
+ properties:
1043
+ code:
1044
+ type: string
1045
+ description: The error code identifying the type of error.
1046
+ example: invalid_agent_access_token
1047
+ const: invalid_agent_access_token
1048
+ message:
1049
+ type: string
1050
+ description: A human-readable description of the error.
1051
+ example: Request could not be processed.
1052
+ required:
1053
+ - code
1054
+ - message
1055
+ - type: object
1056
+ properties:
1057
+ code:
1058
+ type: string
1059
+ description: The error code identifying the type of error.
1060
+ example: session_revoked
1061
+ const: session_revoked
1062
+ message:
1063
+ type: string
1064
+ description: A human-readable description of the error.
1065
+ example: Request could not be processed.
1066
+ required:
1067
+ - code
1068
+ - message
1069
+ - type: object
1070
+ properties:
1071
+ code:
1072
+ type: string
1073
+ description: The error code identifying the type of error.
1074
+ example: session_expired
1075
+ const: session_expired
1076
+ message:
1077
+ type: string
1078
+ description: A human-readable description of the error.
1079
+ example: Request could not be processed.
1080
+ required:
1081
+ - code
1082
+ - message
1083
+ - type: object
1084
+ properties:
1085
+ code:
1086
+ type: string
1087
+ description: The error code identifying the type of error.
1088
+ example: user_session_ended
1089
+ const: user_session_ended
1090
+ message:
1091
+ type: string
1092
+ description: A human-readable description of the error.
1093
+ example: Request could not be processed.
1094
+ required:
1095
+ - code
1096
+ - message
1097
+ '404':
1098
+ description: Not Found
1099
+ content:
1100
+ application/json:
1101
+ schema:
1102
+ type: object
1103
+ properties:
1104
+ message:
1105
+ type: string
1106
+ description: A human-readable description of the error.
1107
+ example: 'Organization not found: ''org_01EHQMYV6MBK39QC5PZXHY59C3''.'
1108
+ required:
1109
+ - message
1110
+ summary: Validate an agent token
1111
+ tags:
1112
+ - agents.blueprints.tokens
1113
+ x-feature-flag: agent-blueprints-public-api
978
1114
  /agents/claims/attempts:
979
1115
  patch:
980
1116
  description: >-
@@ -28301,6 +28437,63 @@ components:
28301
28437
  - new_instance
28302
28438
  - agent_instance_session_id
28303
28439
  - permissions
28440
+ AgentTokenValidation:
28441
+ type: object
28442
+ properties:
28443
+ valid:
28444
+ type: boolean
28445
+ description: >-
28446
+ Always `true`: an invalid token is reported as an error with a
28447
+ stable code, never as a `200`.
28448
+ const: true
28449
+ agent_instance_id:
28450
+ type: string
28451
+ description: The agent instance the token was minted for.
28452
+ example: agent_01EHWNCE74X7JSDV0X3SZ3KJNY
28453
+ agent_instance_session_id:
28454
+ type: string
28455
+ description: The agent instance session backing the token.
28456
+ example: agent_session_01EHWNCE74X7JSDV0X3SZ3KJNY
28457
+ organization_id:
28458
+ type: string
28459
+ description: The organization the agent acts within.
28460
+ example: org_01EHWNCE74X7JSDV0X3SZ3KJNY
28461
+ permissions:
28462
+ type: array
28463
+ items:
28464
+ type: string
28465
+ description: The effective permission slugs carried by the token.
28466
+ example:
28467
+ - crm:read
28468
+ intent:
28469
+ type:
28470
+ - string
28471
+ - 'null'
28472
+ description: >-
28473
+ The caller-supplied context echoed into the token at mint time, or
28474
+ `null` when none was given.
28475
+ example: renew-contract-123
28476
+ acting_user_id:
28477
+ type:
28478
+ - string
28479
+ - 'null'
28480
+ description: >-
28481
+ The delegating user carried in the `act.sub` claim of the token, or
28482
+ `null` for autonomous sessions.
28483
+ example: userland_user_01EHWNCE74X7JSDV0X3SZ3KJNY
28484
+ session_expires_at:
28485
+ type: string
28486
+ description: When the backing agent instance session expires.
28487
+ example: '2024-01-01T00:00:00.000Z'
28488
+ required:
28489
+ - valid
28490
+ - agent_instance_id
28491
+ - agent_instance_session_id
28492
+ - organization_id
28493
+ - permissions
28494
+ - intent
28495
+ - acting_user_id
28496
+ - session_expires_at
28304
28497
  AgentInstanceSession:
28305
28498
  type: object
28306
28499
  properties:
package/dist/policy.mjs CHANGED
@@ -35,6 +35,7 @@ const operationHints = {
35
35
  urlBuilder: true
36
36
  },
37
37
  "POST /portal/generate_link": { name: "generate_link" },
38
+ "POST /agents/blueprints/{agent_blueprint_id}/tokens/validate": { name: "validate_blueprint_token" },
38
39
  "GET /organizations/{organizationId}/feature-flags": { name: "list_organization_feature_flags" },
39
40
  "GET /user_management/users/{userId}/feature-flags": { name: "list_user_feature_flags" },
40
41
  "GET /organizations/{organization_id}/authorized_applications": { name: "list_authorized_applications" },
package/dist/services.mjs CHANGED
@@ -62,6 +62,11 @@ const serviceEndpoints = {
62
62
  "path": "/agents/blueprints/{agent_blueprint_id}/tokens",
63
63
  "name": "create_blueprint_token"
64
64
  },
65
+ {
66
+ "method": "POST",
67
+ "path": "/agents/blueprints/{agent_blueprint_id}/tokens/validate",
68
+ "name": "validate_blueprint_token"
69
+ },
65
70
  {
66
71
  "method": "PATCH",
67
72
  "path": "/agents/claims/attempts",
package/dist/types.d.ts CHANGED
@@ -76,6 +76,26 @@ export interface paths {
76
76
  patch?: never;
77
77
  trace?: never;
78
78
  };
79
+ "/agents/blueprints/{agent_blueprint_id}/tokens/validate": {
80
+ parameters: {
81
+ query?: never;
82
+ header?: never;
83
+ path?: never;
84
+ cookie?: never;
85
+ };
86
+ get?: never;
87
+ put?: never;
88
+ /**
89
+ * Validate an agent token
90
+ * @description Validates an agent access token: verifies its signature against the environment, that it was minted under this blueprint, and that the backing session is live (not revoked or expired, and — for delegated sessions — that the delegating user session has not ended). Returns the token claims and session metadata when valid; invalid tokens are reported as errors with stable codes.
91
+ */
92
+ post: operations["AgentBlueprintsTokenController_validateToken"];
93
+ delete?: never;
94
+ options?: never;
95
+ head?: never;
96
+ patch?: never;
97
+ trace?: never;
98
+ };
79
99
  "/agents/claims/attempts": {
80
100
  parameters: {
81
101
  query?: never;
@@ -6648,6 +6668,50 @@ export interface components {
6648
6668
  */
6649
6669
  permissions: string[];
6650
6670
  };
6671
+ AgentTokenValidation: {
6672
+ /**
6673
+ * @description Always `true`: an invalid token is reported as an error with a stable code, never as a `200`.
6674
+ * @constant
6675
+ */
6676
+ valid: true;
6677
+ /**
6678
+ * @description The agent instance the token was minted for.
6679
+ * @example agent_01EHWNCE74X7JSDV0X3SZ3KJNY
6680
+ */
6681
+ agent_instance_id: string;
6682
+ /**
6683
+ * @description The agent instance session backing the token.
6684
+ * @example agent_session_01EHWNCE74X7JSDV0X3SZ3KJNY
6685
+ */
6686
+ agent_instance_session_id: string;
6687
+ /**
6688
+ * @description The organization the agent acts within.
6689
+ * @example org_01EHWNCE74X7JSDV0X3SZ3KJNY
6690
+ */
6691
+ organization_id: string;
6692
+ /**
6693
+ * @description The effective permission slugs carried by the token.
6694
+ * @example [
6695
+ * "crm:read"
6696
+ * ]
6697
+ */
6698
+ permissions: string[];
6699
+ /**
6700
+ * @description The caller-supplied context echoed into the token at mint time, or `null` when none was given.
6701
+ * @example renew-contract-123
6702
+ */
6703
+ intent: string | null;
6704
+ /**
6705
+ * @description The delegating user carried in the `act.sub` claim of the token, or `null` for autonomous sessions.
6706
+ * @example userland_user_01EHWNCE74X7JSDV0X3SZ3KJNY
6707
+ */
6708
+ acting_user_id: string | null;
6709
+ /**
6710
+ * @description When the backing agent instance session expires.
6711
+ * @example 2024-01-01T00:00:00.000Z
6712
+ */
6713
+ session_expires_at: string;
6714
+ };
6651
6715
  AgentInstanceSession: {
6652
6716
  /**
6653
6717
  * @description Distinguishes the agent instance session object.
@@ -19403,8 +19467,15 @@ export interface operations {
19403
19467
  */
19404
19468
  organization_ids?: string[];
19405
19469
  };
19406
- /** @description Token and session lifetimes for sessions minted from this blueprint. */
19407
- session_settings: {
19470
+ /**
19471
+ * @description Token and session lifetimes for sessions minted from this blueprint.
19472
+ * @default {
19473
+ * "max_age_seconds": 3600,
19474
+ * "access_token_ttl_seconds": 300,
19475
+ * "refresh_token_ttl_seconds": 3600
19476
+ * }
19477
+ */
19478
+ session_settings?: {
19408
19479
  /**
19409
19480
  * @description Maximum lifetime of a session in seconds; refreshes never extend a session past this. At most 31,536,000 (365 days).
19410
19481
  * @example 3600
@@ -20058,6 +20129,123 @@ export interface operations {
20058
20129
  };
20059
20130
  };
20060
20131
  };
20132
+ AgentBlueprintsTokenController_validateToken: {
20133
+ parameters: {
20134
+ query?: never;
20135
+ header?: never;
20136
+ path: {
20137
+ /** @description The unique ID of the agent blueprint. */
20138
+ agent_blueprint_id: string;
20139
+ };
20140
+ cookie?: never;
20141
+ };
20142
+ requestBody: {
20143
+ content: {
20144
+ "application/json": {
20145
+ /**
20146
+ * @description The agent access token (a JWT) to validate.
20147
+ * @example eyJhbGciOiJSUzI1NiIsImtpZCI6...
20148
+ */
20149
+ agent_access_token: string;
20150
+ };
20151
+ };
20152
+ };
20153
+ responses: {
20154
+ /** @description OK */
20155
+ 200: {
20156
+ headers: {
20157
+ [name: string]: unknown;
20158
+ };
20159
+ content: {
20160
+ "application/json": components["schemas"]["AgentTokenValidation"];
20161
+ };
20162
+ };
20163
+ /** @description Bad Request */
20164
+ 400: {
20165
+ headers: {
20166
+ [name: string]: unknown;
20167
+ };
20168
+ content: {
20169
+ "application/json": {
20170
+ /**
20171
+ * @description The error code identifying the type of error.
20172
+ * @example invalid_request
20173
+ * @constant
20174
+ */
20175
+ code: "invalid_request";
20176
+ /**
20177
+ * @description A human-readable description of the error.
20178
+ * @example Request could not be processed.
20179
+ */
20180
+ message: string;
20181
+ } | {
20182
+ /**
20183
+ * @description The error code identifying the type of error.
20184
+ * @example invalid_agent_access_token
20185
+ * @constant
20186
+ */
20187
+ code: "invalid_agent_access_token";
20188
+ /**
20189
+ * @description A human-readable description of the error.
20190
+ * @example Request could not be processed.
20191
+ */
20192
+ message: string;
20193
+ } | {
20194
+ /**
20195
+ * @description The error code identifying the type of error.
20196
+ * @example session_revoked
20197
+ * @constant
20198
+ */
20199
+ code: "session_revoked";
20200
+ /**
20201
+ * @description A human-readable description of the error.
20202
+ * @example Request could not be processed.
20203
+ */
20204
+ message: string;
20205
+ } | {
20206
+ /**
20207
+ * @description The error code identifying the type of error.
20208
+ * @example session_expired
20209
+ * @constant
20210
+ */
20211
+ code: "session_expired";
20212
+ /**
20213
+ * @description A human-readable description of the error.
20214
+ * @example Request could not be processed.
20215
+ */
20216
+ message: string;
20217
+ } | {
20218
+ /**
20219
+ * @description The error code identifying the type of error.
20220
+ * @example user_session_ended
20221
+ * @constant
20222
+ */
20223
+ code: "user_session_ended";
20224
+ /**
20225
+ * @description A human-readable description of the error.
20226
+ * @example Request could not be processed.
20227
+ */
20228
+ message: string;
20229
+ };
20230
+ };
20231
+ };
20232
+ /** @description Not Found */
20233
+ 404: {
20234
+ headers: {
20235
+ [name: string]: unknown;
20236
+ };
20237
+ content: {
20238
+ "application/json": {
20239
+ /**
20240
+ * @description A human-readable description of the error.
20241
+ * @example Organization not found: 'org_01EHQMYV6MBK39QC5PZXHY59C3'.
20242
+ */
20243
+ message: string;
20244
+ };
20245
+ };
20246
+ };
20247
+ };
20248
+ };
20061
20249
  AgentAdminController_linkClaimAttemptToExternalUser: {
20062
20250
  parameters: {
20063
20251
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workos/openapi-spec",
3
- "version": "0.75.0",
3
+ "version": "0.77.0",
4
4
  "type": "module",
5
5
  "description": "WorkOS OpenAPI specification, TypeScript types, and SDK resolution policy",
6
6
  "license": "MIT",