@workos/openapi-spec 0.75.0 → 0.76.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.
- package/dist/open-api-spec.yaml +190 -0
- package/dist/policy.mjs +1 -0
- package/dist/services.mjs +5 -0
- package/dist/types.d.ts +181 -0
- package/package.json +1 -1
package/dist/open-api-spec.yaml
CHANGED
|
@@ -975,6 +975,139 @@ paths:
|
|
|
975
975
|
tags:
|
|
976
976
|
- agents.blueprints.tokens
|
|
977
977
|
x-feature-flag: agent-blueprints-public-api
|
|
978
|
+
/agents/blueprints/{agent_blueprint_id}/tokens/validate:
|
|
979
|
+
post:
|
|
980
|
+
description: >-
|
|
981
|
+
Validates an agent access token: verifies its signature against the
|
|
982
|
+
environment, that it was minted under this blueprint, and that the
|
|
983
|
+
backing session is live (not revoked or expired, and — for delegated
|
|
984
|
+
sessions — that the delegating user session has not ended). Returns the
|
|
985
|
+
token claims and session metadata when valid; invalid tokens are
|
|
986
|
+
reported as errors with stable codes.
|
|
987
|
+
operationId: AgentBlueprintsTokenController_validateToken
|
|
988
|
+
parameters:
|
|
989
|
+
- name: agent_blueprint_id
|
|
990
|
+
required: true
|
|
991
|
+
in: path
|
|
992
|
+
description: The unique ID of the agent blueprint.
|
|
993
|
+
schema:
|
|
994
|
+
type: string
|
|
995
|
+
example: agent_blueprint_01EHWNCE74X7JSDV0X3SZ3KJNY
|
|
996
|
+
requestBody:
|
|
997
|
+
required: true
|
|
998
|
+
content:
|
|
999
|
+
application/json:
|
|
1000
|
+
schema:
|
|
1001
|
+
type: object
|
|
1002
|
+
properties:
|
|
1003
|
+
agent_access_token:
|
|
1004
|
+
type: string
|
|
1005
|
+
minLength: 1
|
|
1006
|
+
description: The agent access token (a JWT) to validate.
|
|
1007
|
+
example: eyJhbGciOiJSUzI1NiIsImtpZCI6...
|
|
1008
|
+
required:
|
|
1009
|
+
- agent_access_token
|
|
1010
|
+
description: The agent access token to validate.
|
|
1011
|
+
responses:
|
|
1012
|
+
'200':
|
|
1013
|
+
description: OK
|
|
1014
|
+
content:
|
|
1015
|
+
application/json:
|
|
1016
|
+
schema:
|
|
1017
|
+
$ref: '#/components/schemas/AgentTokenValidation'
|
|
1018
|
+
'400':
|
|
1019
|
+
description: Bad Request
|
|
1020
|
+
content:
|
|
1021
|
+
application/json:
|
|
1022
|
+
schema:
|
|
1023
|
+
oneOf:
|
|
1024
|
+
- type: object
|
|
1025
|
+
properties:
|
|
1026
|
+
code:
|
|
1027
|
+
type: string
|
|
1028
|
+
description: The error code identifying the type of error.
|
|
1029
|
+
example: invalid_request
|
|
1030
|
+
const: invalid_request
|
|
1031
|
+
message:
|
|
1032
|
+
type: string
|
|
1033
|
+
description: A human-readable description of the error.
|
|
1034
|
+
example: Request could not be processed.
|
|
1035
|
+
required:
|
|
1036
|
+
- code
|
|
1037
|
+
- message
|
|
1038
|
+
- type: object
|
|
1039
|
+
properties:
|
|
1040
|
+
code:
|
|
1041
|
+
type: string
|
|
1042
|
+
description: The error code identifying the type of error.
|
|
1043
|
+
example: invalid_agent_access_token
|
|
1044
|
+
const: invalid_agent_access_token
|
|
1045
|
+
message:
|
|
1046
|
+
type: string
|
|
1047
|
+
description: A human-readable description of the error.
|
|
1048
|
+
example: Request could not be processed.
|
|
1049
|
+
required:
|
|
1050
|
+
- code
|
|
1051
|
+
- message
|
|
1052
|
+
- type: object
|
|
1053
|
+
properties:
|
|
1054
|
+
code:
|
|
1055
|
+
type: string
|
|
1056
|
+
description: The error code identifying the type of error.
|
|
1057
|
+
example: session_revoked
|
|
1058
|
+
const: session_revoked
|
|
1059
|
+
message:
|
|
1060
|
+
type: string
|
|
1061
|
+
description: A human-readable description of the error.
|
|
1062
|
+
example: Request could not be processed.
|
|
1063
|
+
required:
|
|
1064
|
+
- code
|
|
1065
|
+
- message
|
|
1066
|
+
- type: object
|
|
1067
|
+
properties:
|
|
1068
|
+
code:
|
|
1069
|
+
type: string
|
|
1070
|
+
description: The error code identifying the type of error.
|
|
1071
|
+
example: session_expired
|
|
1072
|
+
const: session_expired
|
|
1073
|
+
message:
|
|
1074
|
+
type: string
|
|
1075
|
+
description: A human-readable description of the error.
|
|
1076
|
+
example: Request could not be processed.
|
|
1077
|
+
required:
|
|
1078
|
+
- code
|
|
1079
|
+
- message
|
|
1080
|
+
- type: object
|
|
1081
|
+
properties:
|
|
1082
|
+
code:
|
|
1083
|
+
type: string
|
|
1084
|
+
description: The error code identifying the type of error.
|
|
1085
|
+
example: user_session_ended
|
|
1086
|
+
const: user_session_ended
|
|
1087
|
+
message:
|
|
1088
|
+
type: string
|
|
1089
|
+
description: A human-readable description of the error.
|
|
1090
|
+
example: Request could not be processed.
|
|
1091
|
+
required:
|
|
1092
|
+
- code
|
|
1093
|
+
- message
|
|
1094
|
+
'404':
|
|
1095
|
+
description: Not Found
|
|
1096
|
+
content:
|
|
1097
|
+
application/json:
|
|
1098
|
+
schema:
|
|
1099
|
+
type: object
|
|
1100
|
+
properties:
|
|
1101
|
+
message:
|
|
1102
|
+
type: string
|
|
1103
|
+
description: A human-readable description of the error.
|
|
1104
|
+
example: 'Organization not found: ''org_01EHQMYV6MBK39QC5PZXHY59C3''.'
|
|
1105
|
+
required:
|
|
1106
|
+
- message
|
|
1107
|
+
summary: Validate an agent token
|
|
1108
|
+
tags:
|
|
1109
|
+
- agents.blueprints.tokens
|
|
1110
|
+
x-feature-flag: agent-blueprints-public-api
|
|
978
1111
|
/agents/claims/attempts:
|
|
979
1112
|
patch:
|
|
980
1113
|
description: >-
|
|
@@ -28301,6 +28434,63 @@ components:
|
|
|
28301
28434
|
- new_instance
|
|
28302
28435
|
- agent_instance_session_id
|
|
28303
28436
|
- permissions
|
|
28437
|
+
AgentTokenValidation:
|
|
28438
|
+
type: object
|
|
28439
|
+
properties:
|
|
28440
|
+
valid:
|
|
28441
|
+
type: boolean
|
|
28442
|
+
description: >-
|
|
28443
|
+
Always `true`: an invalid token is reported as an error with a
|
|
28444
|
+
stable code, never as a `200`.
|
|
28445
|
+
const: true
|
|
28446
|
+
agent_instance_id:
|
|
28447
|
+
type: string
|
|
28448
|
+
description: The agent instance the token was minted for.
|
|
28449
|
+
example: agent_01EHWNCE74X7JSDV0X3SZ3KJNY
|
|
28450
|
+
agent_instance_session_id:
|
|
28451
|
+
type: string
|
|
28452
|
+
description: The agent instance session backing the token.
|
|
28453
|
+
example: agent_session_01EHWNCE74X7JSDV0X3SZ3KJNY
|
|
28454
|
+
organization_id:
|
|
28455
|
+
type: string
|
|
28456
|
+
description: The organization the agent acts within.
|
|
28457
|
+
example: org_01EHWNCE74X7JSDV0X3SZ3KJNY
|
|
28458
|
+
permissions:
|
|
28459
|
+
type: array
|
|
28460
|
+
items:
|
|
28461
|
+
type: string
|
|
28462
|
+
description: The effective permission slugs carried by the token.
|
|
28463
|
+
example:
|
|
28464
|
+
- crm:read
|
|
28465
|
+
intent:
|
|
28466
|
+
type:
|
|
28467
|
+
- string
|
|
28468
|
+
- 'null'
|
|
28469
|
+
description: >-
|
|
28470
|
+
The caller-supplied context echoed into the token at mint time, or
|
|
28471
|
+
`null` when none was given.
|
|
28472
|
+
example: renew-contract-123
|
|
28473
|
+
acting_user_id:
|
|
28474
|
+
type:
|
|
28475
|
+
- string
|
|
28476
|
+
- 'null'
|
|
28477
|
+
description: >-
|
|
28478
|
+
The delegating user carried in the `act.sub` claim of the token, or
|
|
28479
|
+
`null` for autonomous sessions.
|
|
28480
|
+
example: userland_user_01EHWNCE74X7JSDV0X3SZ3KJNY
|
|
28481
|
+
session_expires_at:
|
|
28482
|
+
type: string
|
|
28483
|
+
description: When the backing agent instance session expires.
|
|
28484
|
+
example: '2024-01-01T00:00:00.000Z'
|
|
28485
|
+
required:
|
|
28486
|
+
- valid
|
|
28487
|
+
- agent_instance_id
|
|
28488
|
+
- agent_instance_session_id
|
|
28489
|
+
- organization_id
|
|
28490
|
+
- permissions
|
|
28491
|
+
- intent
|
|
28492
|
+
- acting_user_id
|
|
28493
|
+
- session_expires_at
|
|
28304
28494
|
AgentInstanceSession:
|
|
28305
28495
|
type: object
|
|
28306
28496
|
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.
|
|
@@ -20058,6 +20122,123 @@ export interface operations {
|
|
|
20058
20122
|
};
|
|
20059
20123
|
};
|
|
20060
20124
|
};
|
|
20125
|
+
AgentBlueprintsTokenController_validateToken: {
|
|
20126
|
+
parameters: {
|
|
20127
|
+
query?: never;
|
|
20128
|
+
header?: never;
|
|
20129
|
+
path: {
|
|
20130
|
+
/** @description The unique ID of the agent blueprint. */
|
|
20131
|
+
agent_blueprint_id: string;
|
|
20132
|
+
};
|
|
20133
|
+
cookie?: never;
|
|
20134
|
+
};
|
|
20135
|
+
requestBody: {
|
|
20136
|
+
content: {
|
|
20137
|
+
"application/json": {
|
|
20138
|
+
/**
|
|
20139
|
+
* @description The agent access token (a JWT) to validate.
|
|
20140
|
+
* @example eyJhbGciOiJSUzI1NiIsImtpZCI6...
|
|
20141
|
+
*/
|
|
20142
|
+
agent_access_token: string;
|
|
20143
|
+
};
|
|
20144
|
+
};
|
|
20145
|
+
};
|
|
20146
|
+
responses: {
|
|
20147
|
+
/** @description OK */
|
|
20148
|
+
200: {
|
|
20149
|
+
headers: {
|
|
20150
|
+
[name: string]: unknown;
|
|
20151
|
+
};
|
|
20152
|
+
content: {
|
|
20153
|
+
"application/json": components["schemas"]["AgentTokenValidation"];
|
|
20154
|
+
};
|
|
20155
|
+
};
|
|
20156
|
+
/** @description Bad Request */
|
|
20157
|
+
400: {
|
|
20158
|
+
headers: {
|
|
20159
|
+
[name: string]: unknown;
|
|
20160
|
+
};
|
|
20161
|
+
content: {
|
|
20162
|
+
"application/json": {
|
|
20163
|
+
/**
|
|
20164
|
+
* @description The error code identifying the type of error.
|
|
20165
|
+
* @example invalid_request
|
|
20166
|
+
* @constant
|
|
20167
|
+
*/
|
|
20168
|
+
code: "invalid_request";
|
|
20169
|
+
/**
|
|
20170
|
+
* @description A human-readable description of the error.
|
|
20171
|
+
* @example Request could not be processed.
|
|
20172
|
+
*/
|
|
20173
|
+
message: string;
|
|
20174
|
+
} | {
|
|
20175
|
+
/**
|
|
20176
|
+
* @description The error code identifying the type of error.
|
|
20177
|
+
* @example invalid_agent_access_token
|
|
20178
|
+
* @constant
|
|
20179
|
+
*/
|
|
20180
|
+
code: "invalid_agent_access_token";
|
|
20181
|
+
/**
|
|
20182
|
+
* @description A human-readable description of the error.
|
|
20183
|
+
* @example Request could not be processed.
|
|
20184
|
+
*/
|
|
20185
|
+
message: string;
|
|
20186
|
+
} | {
|
|
20187
|
+
/**
|
|
20188
|
+
* @description The error code identifying the type of error.
|
|
20189
|
+
* @example session_revoked
|
|
20190
|
+
* @constant
|
|
20191
|
+
*/
|
|
20192
|
+
code: "session_revoked";
|
|
20193
|
+
/**
|
|
20194
|
+
* @description A human-readable description of the error.
|
|
20195
|
+
* @example Request could not be processed.
|
|
20196
|
+
*/
|
|
20197
|
+
message: string;
|
|
20198
|
+
} | {
|
|
20199
|
+
/**
|
|
20200
|
+
* @description The error code identifying the type of error.
|
|
20201
|
+
* @example session_expired
|
|
20202
|
+
* @constant
|
|
20203
|
+
*/
|
|
20204
|
+
code: "session_expired";
|
|
20205
|
+
/**
|
|
20206
|
+
* @description A human-readable description of the error.
|
|
20207
|
+
* @example Request could not be processed.
|
|
20208
|
+
*/
|
|
20209
|
+
message: string;
|
|
20210
|
+
} | {
|
|
20211
|
+
/**
|
|
20212
|
+
* @description The error code identifying the type of error.
|
|
20213
|
+
* @example user_session_ended
|
|
20214
|
+
* @constant
|
|
20215
|
+
*/
|
|
20216
|
+
code: "user_session_ended";
|
|
20217
|
+
/**
|
|
20218
|
+
* @description A human-readable description of the error.
|
|
20219
|
+
* @example Request could not be processed.
|
|
20220
|
+
*/
|
|
20221
|
+
message: string;
|
|
20222
|
+
};
|
|
20223
|
+
};
|
|
20224
|
+
};
|
|
20225
|
+
/** @description Not Found */
|
|
20226
|
+
404: {
|
|
20227
|
+
headers: {
|
|
20228
|
+
[name: string]: unknown;
|
|
20229
|
+
};
|
|
20230
|
+
content: {
|
|
20231
|
+
"application/json": {
|
|
20232
|
+
/**
|
|
20233
|
+
* @description A human-readable description of the error.
|
|
20234
|
+
* @example Organization not found: 'org_01EHQMYV6MBK39QC5PZXHY59C3'.
|
|
20235
|
+
*/
|
|
20236
|
+
message: string;
|
|
20237
|
+
};
|
|
20238
|
+
};
|
|
20239
|
+
};
|
|
20240
|
+
};
|
|
20241
|
+
};
|
|
20061
20242
|
AgentAdminController_linkClaimAttemptToExternalUser: {
|
|
20062
20243
|
parameters: {
|
|
20063
20244
|
query?: never;
|