portkey-admin-mcp 0.6.2 → 0.7.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/ENDPOINTS.md ADDED
@@ -0,0 +1,638 @@
1
+ # Portkey Admin API Endpoints
2
+
3
+ This document lists the API endpoints used by the Portkey Admin MCP Server. The current additions were checked on 2026-08-09 against the [official Portkey OpenAPI](https://github.com/Portkey-AI/openapi) and product documentation; older live-verification notes are retained as historical compatibility evidence.
4
+
5
+ ## Configuration
6
+
7
+ - **Base URL**: `https://api.portkey.ai/v1`
8
+ - **Authentication**: `x-portkey-api-key` header
9
+ - **Public catalog exception**: `get_model_pricing` uses `https://api.portkey.ai` without authentication
10
+ - **Total MCP tools**: 171
11
+
12
+ ## Verification Legend
13
+
14
+ | Symbol | Meaning |
15
+ |--------|---------|
16
+ | [x] | Verified - matches official docs |
17
+ | [!] | Discrepancy - path differs from docs |
18
+ | [?] | Undocumented - not found in official docs |
19
+
20
+ ---
21
+
22
+ ## 1. Users
23
+
24
+ **Service**: `src/services/users.service.ts`
25
+ **Docs**: [Admin API - Users](https://portkey.ai/docs/api-reference/admin-api/control-plane/users)
26
+
27
+ | Status | Method | Codebase Path | Docs Path | Description |
28
+ |--------|--------|---------------|-----------|-------------|
29
+ | [?] | GET | `/admin/users` | `/users` | List all users |
30
+ | [?] | GET | `/admin/users/{userId}` | `/users/{id}` | Get user by ID |
31
+ | [?] | PUT | `/admin/users/{userId}` | `/users/{id}` | Update user |
32
+ | [?] | DELETE | `/admin/users/{userId}` | `/users/{id}` | Delete user |
33
+
34
+ **Tested**: Both paths return 403 (permission denied). This is an API key scope issue, not a path issue. Unable to verify correct path.
35
+
36
+ **Pagination**: `list_all_users` accepts `current_page` (page number, default 1) and `page_size` (results per page, max 100).
37
+
38
+ ---
39
+
40
+ ## 2. User Invites
41
+
42
+ **Service**: `src/services/users.service.ts`
43
+ **Docs**: [Admin API - User Invites](https://portkey.ai/docs/api-reference/admin-api/control-plane/user-invites)
44
+
45
+ | Status | Method | Codebase Path | Docs Path | Description |
46
+ |--------|--------|---------------|-----------|-------------|
47
+ | [?] | POST | `/admin/users/invites` | `/user-invites` | Invite user |
48
+ | [?] | GET | `/admin/users/invites` | `/user-invites` | List invites |
49
+ | [?] | GET | `/admin/users/invites/{inviteId}` | `/user-invites/{id}` | Get invite |
50
+ | [?] | DELETE | `/admin/users/invites/{inviteId}` | `/user-invites/{id}` | Delete invite |
51
+ | [?] | POST | `/admin/users/invites/{inviteId}/resend` | `/user-invites/{id}/resend` | Resend invite |
52
+
53
+ **Tested**: Both paths return 403 (permission denied). This is an API key scope issue, not a path issue. Unable to verify correct path.
54
+
55
+ **Pagination**: `list_user_invites` accepts `current_page` (page number, default 1) and `page_size` (results per page, max 100).
56
+
57
+ ---
58
+
59
+ ## 3. User Analytics
60
+
61
+ **Service**: `src/services/users.service.ts`
62
+ **Docs**: [Admin API - Analytics](https://portkey.ai/docs/api-reference/admin-api/control-plane/analytics)
63
+
64
+ | Status | Method | Codebase Path | Docs Path | Description |
65
+ |--------|--------|---------------|-----------|-------------|
66
+ | [x] | GET | `/analytics/groups/users` | `/analytics/groups/users` | User grouped analytics |
67
+
68
+ ---
69
+
70
+ ## 4. Workspaces
71
+
72
+ **Service**: `src/services/workspaces.service.ts`
73
+ **Docs**: [Admin API - Workspaces](https://portkey.ai/docs/api-reference/admin-api/control-plane/workspaces)
74
+
75
+ | Status | Method | Codebase Path | Docs Path | Description |
76
+ |--------|--------|---------------|-----------|-------------|
77
+ | [x] | GET | `/admin/workspaces` | `/workspaces` | List workspaces |
78
+ | [x] | POST | `/admin/workspaces` | `/workspaces` | Create workspace |
79
+ | [x] | GET | `/admin/workspaces/{workspaceId}` | `/workspaces/{id}` | Get workspace |
80
+ | [x] | PUT | `/admin/workspaces/{workspaceId}` | `/workspaces/{id}` | Update workspace |
81
+ | [x] | DELETE | `/admin/workspaces/{workspaceId}` | `/workspaces/{id}` | Delete workspace |
82
+
83
+ **Tested**: `/admin/workspaces` paths work (200). Docs `/workspaces` returns 400. Keep current paths.
84
+
85
+ ---
86
+
87
+ ## 5. Workspace Members
88
+
89
+ **Service**: `src/services/workspaces.service.ts`
90
+ **Docs**: [Admin API - Workspace Members](https://portkey.ai/docs/api-reference/admin-api/control-plane/workspace-members)
91
+
92
+ | Status | Method | Codebase Path | Docs Path | Description |
93
+ |--------|--------|---------------|-----------|-------------|
94
+ | [x] | POST | `/admin/workspaces/{id}/users` | `/workspaces/{id}/members` | Add member |
95
+ | [x] | GET | `/admin/workspaces/{id}/users` | `/workspaces/{id}/members` | List members |
96
+ | [x] | GET | `/admin/workspaces/{id}/users/{userId}` | `/workspaces/{id}/members/{member_id}` | Get member |
97
+ | [x] | PUT | `/admin/workspaces/{id}/users/{userId}` | `/workspaces/{id}/members/{member_id}` | Update member |
98
+ | [x] | DELETE | `/admin/workspaces/{id}/users/{userId}` | `/workspaces/{id}/members/{member_id}` | Remove member |
99
+
100
+ **Tested**: `/admin/workspaces/{id}/users` paths work (200). Docs paths return 400. Keep current paths.
101
+
102
+ ---
103
+
104
+ ## 6. Configs
105
+
106
+ **Service**: `src/services/configs.service.ts`
107
+ **Docs**: [Admin API - Configs](https://portkey.ai/docs/api-reference/admin-api/control-plane/configs)
108
+
109
+ | Status | Method | Codebase Path | Docs Path | Description |
110
+ |--------|--------|---------------|-----------|-------------|
111
+ | [x] | GET | `/configs` | `/configs` | List all configs |
112
+ | [x] | POST | `/configs` | `/configs` | Create config |
113
+ | [x] | GET | `/configs/{slug}` | `/configs/{id}` | Get config |
114
+ | [x] | PUT | `/configs/{slug}` | `/configs/{id}` | Update config |
115
+ | [x] | DELETE | `/configs/{slug}` | `/configs/{id}` | Delete config |
116
+ | [x] | GET | `/configs/{slug}/versions` | `/configs/{id}/versions` | List versions |
117
+
118
+ **Pagination**: `list_configs` accepts `current_page` (page number, default 1) and `page_size` (results per page, max 100).
119
+
120
+ ---
121
+
122
+ ## 7. Virtual Keys
123
+
124
+ **Service**: `src/services/keys.service.ts`
125
+ **Docs**: [Admin API - Virtual Keys](https://portkey.ai/docs/api-reference/admin-api/control-plane/virtual-keys)
126
+
127
+ | Status | Method | Codebase Path | Docs Path | Description |
128
+ |--------|--------|---------------|-----------|-------------|
129
+ | [x] | GET | `/virtual-keys` | `/virtual-keys` | List virtual keys |
130
+ | [x] | POST | `/virtual-keys` | `/virtual-keys` | Create virtual key |
131
+ | [x] | GET | `/virtual-keys/{slug}` | `/virtual-keys/{id}` | Get virtual key |
132
+ | [x] | PUT | `/virtual-keys/{slug}` | `/virtual-keys/{id}` | Update virtual key |
133
+ | [x] | DELETE | `/virtual-keys/{slug}` | `/virtual-keys/{id}` | Delete virtual key |
134
+
135
+ **Pagination**: `list_virtual_keys` accepts `current_page` (page number, default 1) and `page_size` (results per page, max 100).
136
+
137
+ ---
138
+
139
+ ## 8. API Keys
140
+
141
+ **Service**: `src/services/keys.service.ts`
142
+ **Docs**: [Admin API - API Keys](https://portkey.ai/docs/api-reference/admin-api/control-plane/api-keys)
143
+
144
+ | Status | Method | Codebase Path | Docs Path | Description |
145
+ |--------|--------|---------------|-----------|-------------|
146
+ | [x] | POST | `/api-keys/{type}/{subType}` | `/api-keys` | Create API key |
147
+ | [x] | GET | `/api-keys` | `/api-keys` | List API keys |
148
+ | [x] | GET | `/api-keys/{id}` | `/api-keys/{id}` | Get API key |
149
+ | [x] | PUT | `/api-keys/{id}` | `/api-keys/{id}` | Update API key |
150
+ | [x] | DELETE | `/api-keys/{id}` | `/api-keys/{id}` | Delete API key |
151
+ | [x] | POST | `/api-keys/{id}/rotate` | `/api-keys/{id}/rotate` | Rotate API key with an optional transition window |
152
+
153
+ **Note**: Create endpoint uses `/{type}/{subType}` for key type specification.
154
+
155
+ ## Secret References
156
+
157
+ **Service**: `src/services/secret-references.service.ts`
158
+ **Docs**: [Admin API - Secret References](https://portkey.ai/docs/api-reference/admin-api/control-plane/secret-references/create-secret-reference)
159
+
160
+ | Status | Method | Codebase Path | Docs Path | Description |
161
+ |--------|--------|---------------|-----------|-------------|
162
+ | [x] | POST | `/secret-references` | `/secret-references` | Create a Secret Reference |
163
+ | [x] | GET | `/secret-references` | `/secret-references` | List Secret References |
164
+ | [x] | GET | `/secret-references/{id}` | `/secret-references/{id}` | Retrieve by UUID or slug |
165
+ | [x] | PUT | `/secret-references/{id}` | `/secret-references/{id}` | Update a Secret Reference |
166
+ | [x] | DELETE | `/secret-references/{id}` | `/secret-references/{id}` | Delete a Secret Reference |
167
+
168
+ The configured live-test credential returned 403 for this surface on 2026-07-14. Contract fixtures currently use the official documented response examples; `tests/fixtures/record.ts` can replace them using disposable resources when run with sufficient permissions and `PORTKEY_RECORD_MUTATIONS=true`.
169
+
170
+ ---
171
+
172
+ ## 9. Collections
173
+
174
+ **Service**: `src/services/collections.service.ts`
175
+ **Docs**: [Admin API - Collections](https://portkey.ai/docs/api-reference/admin-api/control-plane/prompts/collections)
176
+
177
+ | Status | Method | Codebase Path | Docs Path | Description |
178
+ |--------|--------|---------------|-----------|-------------|
179
+ | [x] | GET | `/collections` | `/collections` | List collections |
180
+ | [x] | POST | `/collections` | `/collections` | Create collection |
181
+ | [x] | GET | `/collections/{collectionId}` | `/collections/{id}` | Get collection |
182
+ | [x] | PUT | `/collections/{collectionId}` | `/collections/{id}` | Update collection |
183
+ | [x] | DELETE | `/collections/{collectionId}` | `/collections/{id}` | Delete collection |
184
+
185
+ ---
186
+
187
+ ## 10. Prompts
188
+
189
+ **Service**: `src/services/prompts.service.ts`
190
+ **Docs**: [Admin API - Prompts](https://portkey.ai/docs/api-reference/admin-api/control-plane/prompts)
191
+
192
+ | Status | Method | Codebase Path | Docs Path | Description |
193
+ |--------|--------|---------------|-----------|-------------|
194
+ | [x] | POST | `/prompts` | `/prompts` | Create prompt |
195
+ | [x] | GET | `/prompts` | `/prompts` | List prompts |
196
+ | [x] | GET | `/prompts/{promptId}` | `/prompts/{id}` | Get prompt |
197
+ | [x] | PUT | `/prompts/{promptId}` | `/prompts/{id}` | Update prompt |
198
+ | [x] | DELETE | `/prompts/{promptId}` | `/prompts/{id}` | Delete prompt |
199
+ | [x] | PUT | `/prompts/{promptId}/makeDefault` | `/prompts/{id}/publish` | Publish version |
200
+ | [x] | GET | `/prompts/{promptId}/versions` | `/prompts/{id}/versions` | List versions |
201
+ | [x] | POST | `/prompts/{promptId}/render` | `/prompts/{id}/render` | Render prompt |
202
+ | [x] | POST | `/prompts/{promptId}/completions` | `/prompts/{id}/completions` | Run completion |
203
+
204
+ **Tested**: `/makeDefault` returns 200, `/publish` returns 404. Keep `/makeDefault`.
205
+
206
+ ---
207
+
208
+ ## 11. Prompt Partials
209
+
210
+ **Service**: `src/services/partials.service.ts`
211
+ **Docs**: [Admin API - Partials](https://portkey.ai/docs/api-reference/admin-api/control-plane/prompts/partials)
212
+
213
+ | Status | Method | Codebase Path | Docs Path | Description |
214
+ |--------|--------|---------------|-----------|-------------|
215
+ | [x] | POST | `/prompts/partials` | `/prompts/partials` | Create partial |
216
+ | [x] | GET | `/prompts/partials` | `/prompts/partials` | List partials |
217
+ | [x] | GET | `/prompts/partials/{promptPartialId}` | `/prompts/partials/{id}` | Get partial |
218
+ | [x] | PUT | `/prompts/partials/{promptPartialId}` | `/prompts/partials/{id}` | Update partial |
219
+ | [x] | DELETE | `/prompts/partials/{promptPartialId}` | `/prompts/partials/{id}` | Delete partial |
220
+ | [x] | GET | `/prompts/partials/{promptPartialId}/versions` | `/prompts/partials/{id}/versions` | List versions |
221
+ | [x] | PUT | `/prompts/partials/{promptPartialId}/makeDefault` | `/prompts/partials/{id}/publish` | Publish version |
222
+
223
+ **Tested**: `/makeDefault` returns 200, `/publish` returns 404. Keep `/makeDefault`.
224
+
225
+ ---
226
+
227
+ ## 12. Labels
228
+
229
+ **Service**: `src/services/labels.service.ts`
230
+ **Docs**: [Admin API - Labels](https://portkey.ai/docs/api-reference/admin-api/control-plane/prompts/labels)
231
+
232
+ | Status | Method | Codebase Path | Docs Path | Description |
233
+ |--------|--------|---------------|-----------|-------------|
234
+ | [x] | POST | `/labels` | `/labels` | Create label |
235
+ | [x] | GET | `/labels` | `/labels` | List labels |
236
+ | [x] | GET | `/labels/{labelId}` | `/labels/{id}` | Get label |
237
+ | [x] | PUT | `/labels/{labelId}` | `/labels/{id}` | Update label |
238
+ | [x] | DELETE | `/labels/{labelId}` | `/labels/{id}` | Delete label |
239
+
240
+ ---
241
+
242
+ ## 13. Analytics
243
+
244
+ **Service**: `src/services/analytics.service.ts`
245
+ **Docs**: [Admin API - Analytics](https://portkey.ai/docs/api-reference/admin-api/control-plane/analytics)
246
+
247
+ ### Graph Analytics
248
+
249
+ | Status | Method | Codebase Path | Docs Path | Description |
250
+ |--------|--------|---------------|-----------|-------------|
251
+ | [x] | GET | `/analytics/graphs/cost` | `/analytics/graphs/cost` | Cost analytics |
252
+ | [x] | GET | `/analytics/graphs/requests` | `/analytics/graphs/requests` | Request count |
253
+ | [x] | GET | `/analytics/graphs/tokens` | `/analytics/graphs/tokens` | Token usage |
254
+ | [x] | GET | `/analytics/graphs/latency` | `/analytics/graphs/latency` | Latency (p50/p90/p99) |
255
+ | [x] | GET | `/analytics/graphs/errors` | `/analytics/graphs/errors` | Error count |
256
+ | [x] | GET | `/analytics/graphs/errors/rate` | `/analytics/graphs/errors/rate` | Error rate |
257
+ | [x] | GET | `/analytics/graphs/cache/latency` | `/analytics/graphs/cache/latency` | Cache latency |
258
+ | [x] | GET | `/analytics/graphs/cache/hit-rate` | `/analytics/graphs/cache/hit-rate` | Cache hit rate |
259
+ | [x] | GET | `/analytics/graphs/users` | `/analytics/graphs/users` | User activity (requires elevated permissions) |
260
+
261
+ **Verified 2025-12-31**: The following documented endpoints returned 404 and were removed from codebase:
262
+ `/analytics/graphs/feedback`, `/analytics/graphs/feedback-per-models`, `/analytics/graphs/feedback-distribution`,
263
+ `/analytics/graphs/requests-per-user`, `/analytics/graphs/rescued-requests`, `/analytics/graphs/status-codes`,
264
+ `/analytics/graphs/unique-status-codes`, `/analytics/graphs/weighted-feedback`, `/analytics/groups/metadata`,
265
+ `/analytics/groups/models`. These may be deprecated or require a different API version.
266
+
267
+ ---
268
+
269
+ ## 14. Guardrails
270
+
271
+ **Service**: `src/services/guardrails.service.ts`
272
+ **Docs**: [Admin API - Guardrails](https://portkey.ai/docs/api-reference/admin-api/control-plane/guardrails)
273
+
274
+ | Status | Method | Codebase Path | Docs Path | Description |
275
+ |--------|--------|---------------|-----------|-------------|
276
+ | [x] | GET | `/guardrails` | `/guardrails` | List guardrails |
277
+ | [x] | POST | `/guardrails` | `/guardrails` | Create guardrail |
278
+ | [x] | GET | `/guardrails/{guardrailId}` | `/guardrails/{id}` | Get guardrail |
279
+ | [x] | PUT | `/guardrails/{guardrailId}` | `/guardrails/{id}` | Update guardrail |
280
+ | [x] | DELETE | `/guardrails/{guardrailId}` | `/guardrails/{id}` | Delete guardrail |
281
+
282
+ ---
283
+
284
+ ## 15. Usage Limits
285
+
286
+ **Service**: `src/services/limits.service.ts`
287
+ **Docs**: [Admin API - Usage Limits](https://portkey.ai/docs/api-reference/admin-api/control-plane/policies/usage-limits)
288
+
289
+ | Status | Method | Codebase Path | Docs Path | Description |
290
+ |--------|--------|---------------|-----------|-------------|
291
+ | [x] | GET | `/policies/usage-limits` | `/policies/usage-limits` | List usage limits |
292
+ | [x] | POST | `/policies/usage-limits` | `/policies/usage-limits` | Create usage limit |
293
+ | [x] | GET | `/policies/usage-limits/{id}` | `/policies/usage-limits/{id}` | Get usage limit |
294
+ | [x] | PUT | `/policies/usage-limits/{id}` | `/policies/usage-limits/{id}` | Update usage limit |
295
+ | [x] | DELETE | `/policies/usage-limits/{id}` | `/policies/usage-limits/{id}` | Delete usage limit |
296
+
297
+ ---
298
+
299
+ ## 16. Rate Limits
300
+
301
+ **Service**: `src/services/limits.service.ts`
302
+ **Docs**: [Admin API - Rate Limits](https://portkey.ai/docs/api-reference/admin-api/control-plane/policies/rate-limits)
303
+
304
+ | Status | Method | Codebase Path | Docs Path | Description |
305
+ |--------|--------|---------------|-----------|-------------|
306
+ | [x] | GET | `/policies/rate-limits` | `/policies/rate-limits` | List rate limits |
307
+ | [x] | POST | `/policies/rate-limits` | `/policies/rate-limits` | Create rate limit |
308
+ | [x] | GET | `/policies/rate-limits/{id}` | `/policies/rate-limits/{id}` | Get rate limit |
309
+ | [x] | PUT | `/policies/rate-limits/{id}` | `/policies/rate-limits/{id}` | Update rate limit |
310
+ | [x] | DELETE | `/policies/rate-limits/{id}` | `/policies/rate-limits/{id}` | Delete rate limit |
311
+
312
+ ---
313
+
314
+ ## 17. Audit Logs
315
+
316
+ **Service**: `src/services/audit.service.ts`
317
+ **Docs**: [Admin API - Audit Logs](https://portkey.ai/docs/api-reference/admin-api/control-plane/audit-logs)
318
+
319
+ | Status | Method | Codebase Path | Docs Path | Description |
320
+ |--------|--------|---------------|-----------|-------------|
321
+ | [x] | GET | `/audit-logs` | `/audit-logs` | List audit logs |
322
+
323
+ ---
324
+
325
+ ## 18. Tracing / Feedback
326
+
327
+ **Service**: `src/services/tracing.service.ts`
328
+ **Docs**: [Admin API - Feedback](https://portkey.ai/docs/api-reference/admin-api/data-plane/feedback)
329
+
330
+ | Status | Method | Codebase Path | Docs Path | Description |
331
+ |--------|--------|---------------|-----------|-------------|
332
+ | [x] | POST | `/feedback` | `/feedback` | Create feedback |
333
+ | [x] | PUT | `/feedback/{id}` | `/feedback/{id}` | Update feedback |
334
+
335
+ ---
336
+
337
+ ## 19. Logging / Exports
338
+
339
+ **Service**: `src/services/logging.service.ts`
340
+ **Docs**: [Admin API - Log Exports](https://portkey.ai/docs/api-reference/admin-api/data-plane/logs/log-exports-beta)
341
+
342
+ | Status | Method | Codebase Path | Docs Path | Description |
343
+ |--------|--------|---------------|-----------|-------------|
344
+ | [x] | POST | `/logs` | `/logs` | Insert log entry |
345
+ | [x] | POST | `/logs/exports` | `/logs/exports` | Create export job |
346
+ | [x] | GET | `/logs/exports` | `/logs/exports` | List exports |
347
+ | [x] | GET | `/logs/exports/{exportId}` | `/logs/exports/{id}` | Get export |
348
+ | [x] | POST | `/logs/exports/{exportId}/start` | `/logs/exports/{id}/start` | Start export |
349
+ | [x] | POST | `/logs/exports/{exportId}/cancel` | `/logs/exports/{id}/cancel` | Cancel export |
350
+ | [x] | GET | `/logs/exports/{exportId}/download` | `/logs/exports/{id}/download` | Download export |
351
+ | [x] | PUT | `/logs/exports/{exportId}` | `/logs/exports/{id}` | Update export |
352
+
353
+ ---
354
+
355
+ ## 20. Providers
356
+
357
+ **Service**: `src/services/providers.service.ts`
358
+ **Docs**: [Admin API - Providers](https://portkey.ai/docs/api-reference/admin-api/control-plane/providers)
359
+
360
+ | Status | Method | Codebase Path | Docs Path | Description |
361
+ |--------|--------|---------------|-----------|-------------|
362
+ | [x] | GET | `/providers` | `/providers` | List providers |
363
+ | [x] | POST | `/providers` | `/providers` | Create provider |
364
+ | [x] | GET | `/providers/{slug}` | `/providers/{id}` | Get provider |
365
+ | [x] | PUT | `/providers/{slug}` | `/providers/{id}` | Update provider |
366
+ | [x] | DELETE | `/providers/{slug}` | `/providers/{id}` | Delete provider |
367
+
368
+ ---
369
+
370
+ ## 21. Integrations
371
+
372
+ **Service**: `src/services/integrations.service.ts`
373
+ **Docs**: [Admin API - Integrations](https://portkey.ai/docs/api-reference/admin-api/control-plane/integrations)
374
+
375
+ | Status | Method | Codebase Path | Docs Path | Description |
376
+ |--------|--------|---------------|-----------|-------------|
377
+ | [x] | GET | `/integrations` | `/integrations` | List integrations |
378
+ | [x] | POST | `/integrations` | `/integrations` | Create integration |
379
+ | [x] | GET | `/integrations/{slug}` | `/integrations/{id}` | Get integration |
380
+ | [x] | PUT | `/integrations/{slug}` | `/integrations/{id}` | Update integration |
381
+ | [x] | DELETE | `/integrations/{slug}` | `/integrations/{id}` | Delete integration |
382
+ | [x] | GET | `/integrations/{slug}/models` | `/integrations/{id}/models` | List models |
383
+ | [x] | PUT | `/integrations/{slug}/models` | `/integrations/{id}/models` | Update models |
384
+ | [x] | DELETE | `/integrations/{slug}/models?slugs={modelSlug}` | `/integrations/{slug}/models?slugs={modelSlug}` | Delete custom model |
385
+ | [x] | GET | `/integrations/{slug}/workspaces` | `/integrations/{id}/workspaces` | List workspaces |
386
+ | [x] | PUT | `/integrations/{slug}/workspaces` | `/integrations/{id}/workspaces` | Update workspaces |
387
+
388
+ ---
389
+
390
+ ## Summary
391
+
392
+ ### Legacy verification statistics (2025-12-31 snapshot)
393
+
394
+ | Status | Count | Description |
395
+ |--------|-------|-------------|
396
+ | [x] Verified | 131 | Working paths confirmed via API testing |
397
+ | [!] Discrepancy | 0 | None - all tested paths work |
398
+ | [?] Unable to verify | 20 | All return 403 (permission denied) — analytics endpoints require org-admin permissions |
399
+
400
+ ### Key Findings
401
+
402
+ 1. **`/admin/workspaces` paths WORK** - Tested with 200 responses. Docs `/workspaces` returns 400. Keep current paths.
403
+ 2. **`/admin/workspaces/{id}/users` paths WORK** - Tested with 200 responses. Docs `/members` path returns 400.
404
+ 3. **`/makeDefault` WORKS, `/publish` does NOT** - Tested with PUT. `/makeDefault` returns 200, `/publish` returns 404.
405
+ 4. **Audit Logs uses `/audit-logs`** - Already matches docs (no `/admin/` prefix in code)
406
+ 5. **Integrations uses `/integrations`** - Already matches docs (no `/admin/` prefix in code)
407
+ 6. **Users/Invites return 403** - API key lacks permissions, cannot verify path correctness
408
+
409
+ ### Test Results Reference
410
+
411
+ ```text
412
+ Endpoint Verification (2025-12-31):
413
+ - /admin/workspaces → 200 ✓
414
+ - /workspaces → 400 ✗
415
+ - /admin/users → 403 (permission)
416
+ - /users → 403 (permission)
417
+ - /integrations → 200 ✓
418
+ - /admin/integrations → 400 ✗
419
+ - /audit-logs → 403 (permission)
420
+ - /prompts/{id}/makeDefault → 200 ✓ (PUT)
421
+ - /prompts/{id}/publish → 404 ✗ (PUT)
422
+ ```
423
+
424
+ ---
425
+
426
+ ## Appendix: Official Portkey API Docs Reference
427
+
428
+ *Extracted from [Portkey Admin API Docs](https://portkey.ai/docs/api-reference/admin-api/) on 2025-12-31*
429
+
430
+ These are the paths documented by Portkey. Where they differ from what actually works (tested above), **use the tested paths**.
431
+
432
+ ### Users (Docs: `/admin/users`)
433
+ ```text
434
+ GET /v1/admin/users
435
+ GET /v1/admin/users/{userId}
436
+ PUT /v1/admin/users/{userId}
437
+ DELETE /v1/admin/users/{userId}
438
+ ```
439
+
440
+ ### User Invites (Docs: `/admin/users/invites`)
441
+ ```text
442
+ POST /v1/admin/users/invites
443
+ GET /v1/admin/users/invites
444
+ GET /v1/admin/users/invites/{invite_id}
445
+ DELETE /v1/admin/users/invites/{invite_id}
446
+ POST /v1/admin/users/invites/{invite_id}/resend
447
+ ```
448
+
449
+ ### Workspaces (Docs: `/admin/workspaces`)
450
+ ```text
451
+ POST /v1/admin/workspaces
452
+ GET /v1/admin/workspaces
453
+ GET /v1/admin/workspaces/{id}
454
+ PUT /v1/admin/workspaces/{id}
455
+ DELETE /v1/admin/workspaces/{id}
456
+ ```
457
+
458
+ ### Workspace Members (Docs: `/admin/workspaces/{id}/users`)
459
+ ```text
460
+ POST /v1/admin/workspaces/{workspaceId}/users
461
+ GET /v1/admin/workspaces/{workspaceId}/users
462
+ GET /v1/admin/workspaces/{workspaceId}/users/{userId}
463
+ PUT /v1/admin/workspaces/{workspaceId}/users/{userId}
464
+ DELETE /v1/admin/workspaces/{workspaceId}/users/{userId}
465
+ ```
466
+
467
+ ### Prompts (Docs: `/prompts`)
468
+ ```text
469
+ POST /v1/prompts
470
+ GET /v1/prompts
471
+ GET /v1/prompts/{id}
472
+ PUT /v1/prompts/{id}
473
+ DELETE /v1/prompts/{id}
474
+ PUT /v1/prompts/{id}/publish ← Docs say this, but /makeDefault works
475
+ GET /v1/prompts/{id}/versions
476
+ GET /v1/prompts/{id}/versions/{version_id}
477
+ PUT /v1/prompts/{id}/versions/{version_id}
478
+ ```
479
+
480
+ ### Prompt Partials (Docs: `/prompts/partials`)
481
+ ```text
482
+ POST /v1/prompts/partials
483
+ GET /v1/prompts/partials
484
+ GET /v1/prompts/partials/{id}
485
+ PUT /v1/prompts/partials/{id}
486
+ DELETE /v1/prompts/partials/{id}
487
+ GET /v1/prompts/partials/{id}/versions
488
+ PUT /v1/prompts/partials/{id}/publish ← Docs say this, but /makeDefault works
489
+ ```
490
+
491
+ ### Analytics - Graphs (Docs: `/analytics/graphs`)
492
+ ```text
493
+ GET /v1/analytics/graphs/cost ✓ Works (403)
494
+ GET /v1/analytics/graphs/requests ✓ Works (403)
495
+ GET /v1/analytics/graphs/tokens ✓ Works (403)
496
+ GET /v1/analytics/graphs/latency ✓ Works (403)
497
+ GET /v1/analytics/graphs/errors ✓ Works (403)
498
+ GET /v1/analytics/graphs/errors/rate ✓ Works (403)
499
+ GET /v1/analytics/graphs/cache/latency ✓ Works (403)
500
+ GET /v1/analytics/graphs/cache/hit-rate ✓ Works (403)
501
+ GET /v1/analytics/graphs/users ✓ Works (403)
502
+ # The following documented endpoints return 404 - not implemented:
503
+ # GET /v1/analytics/graphs/feedback
504
+ # GET /v1/analytics/graphs/feedback-per-models
505
+ # GET /v1/analytics/graphs/feedback-distribution
506
+ # GET /v1/analytics/graphs/requests-per-user
507
+ # GET /v1/analytics/graphs/rescued-requests
508
+ # GET /v1/analytics/graphs/status-codes
509
+ # GET /v1/analytics/graphs/unique-status-codes
510
+ # GET /v1/analytics/graphs/weighted-feedback
511
+ ```
512
+
513
+ ### Analytics - Groups (Docs: `/analytics/groups`)
514
+ ```text
515
+ GET /v1/analytics/groups/users ✓ Works
516
+ # The following documented endpoints return 404 - not implemented:
517
+ # GET /v1/analytics/groups/metadata
518
+ # GET /v1/analytics/groups/models
519
+ ```
520
+
521
+ ### Log Exports (Docs: `/log-exports`)
522
+ ```text
523
+ POST /v1/log-exports ← Docs (vs /logs/exports in code)
524
+ GET /v1/log-exports
525
+ GET /v1/log-exports/{id}
526
+ PUT /v1/log-exports/{id}
527
+ POST /v1/log-exports/{id}/start
528
+ POST /v1/log-exports/{id}/cancel
529
+ GET /v1/log-exports/{id}/download
530
+ ```
531
+
532
+ ---
533
+
534
+ ## Summary: Docs vs Reality
535
+
536
+ | What Docs Say | What Actually Works | Notes |
537
+ |---------------|---------------------|-------|
538
+ | `/workspaces` | `/admin/workspaces` | Docs path returns 400 |
539
+ | `/workspaces/{id}/members` | `/admin/workspaces/{id}/users` | Docs path returns 400 |
540
+ | `/prompts/{id}/publish` | `/prompts/{id}/makeDefault` | Docs path returns 404 |
541
+ | `/log-exports` | `/logs/exports` | Need to test |
542
+ | `/analytics/graphs/error-rate` | `/analytics/graphs/errors/rate` | ✓ Tested - works (403) |
543
+ | `/analytics/graphs/cache-hit-latency` | `/analytics/graphs/cache/latency` | ✓ Tested - works (403) |
544
+ | `/analytics/graphs/cache-hit-rate` | `/analytics/graphs/cache/hit-rate` | ✓ Tested - works (403) |
545
+ | `/analytics/graphs/feedbacks` | `/analytics/graphs/feedbacks` | ✓ Returns 403 (permissions) - endpoint exists (verified 2026-03-23) |
546
+ | `/analytics/graphs/feedbacks/*` | `/analytics/graphs/feedbacks/{ai-models,scores,weighted}` | ✓ Returns 403 - endpoints exist (verified 2026-03-23) |
547
+ | `/analytics/groups/metadata/{key}` | `/analytics/groups/metadata/{key}` | ✓ Returns 403 - endpoint exists (verified 2026-03-23) |
548
+ | `/analytics/groups/ai-models` | `/analytics/groups/ai-models` | ✓ Returns 403 - endpoint exists (verified 2026-03-23) |
549
+
550
+ **Note**: All analytics endpoints return 403 with workspace-level API keys. They require org-admin analytics permissions.
551
+
552
+ **Recommendation**: Trust the tested paths. The Portkey docs may be outdated or describe a different API version.
553
+
554
+ ---
555
+
556
+ ## New: MCP Integrations (added 2026-03-23)
557
+
558
+ **Service**: `src/services/mcp-integrations.service.ts`
559
+
560
+ | Status | Method | Path | Description |
561
+ |--------|--------|------|-------------|
562
+ | [x] | POST | `/mcp-integrations` | Create MCP integration (requires `name`, `url`, `auth_type`, `transport`) |
563
+ | [x] | GET | `/mcp-integrations` | List MCP integrations |
564
+ | [x] | GET | `/mcp-integrations/{id}` | Get MCP integration |
565
+ | [x] | PUT | `/mcp-integrations/{id}` | Update MCP integration |
566
+ | [x] | DELETE | `/mcp-integrations/{id}` | Delete MCP integration |
567
+ | [x] | GET | `/mcp-integrations/{id}/metadata` | Get sync metadata |
568
+ | [x] | GET | `/mcp-integrations/{id}/capabilities` | List capabilities |
569
+ | [x] | PUT | `/mcp-integrations/{id}/capabilities` | Update capabilities |
570
+ | [x] | GET | `/mcp-integrations/{id}/workspaces` | List workspace access |
571
+ | [x] | PUT | `/mcp-integrations/{id}/workspaces` | Update workspace access |
572
+
573
+ All verified with live API 2026-03-23. List returns `{ object: "list", total, has_more, data }`. Workspaces returns `{ workspaces, global_workspace_access, object: "integration" }`.
574
+
575
+ Create, update, and detail payloads also support `secret_mappings` for resolving `configurations.<field>` values from Portkey Secret References at runtime (added to this server 2026-08-09).
576
+
577
+ ## New: MCP Servers (added 2026-03-23)
578
+
579
+ **Service**: `src/services/mcp-servers.service.ts`
580
+
581
+ | Status | Method | Path | Description |
582
+ |--------|--------|------|-------------|
583
+ | [x] | POST | `/mcp-servers` | Create MCP server (requires `name`, `mcp_integration_id`) |
584
+ | [x] | GET | `/mcp-servers` | List MCP servers |
585
+ | [x] | GET | `/mcp-servers/{id}` | Get MCP server |
586
+ | [x] | PUT | `/mcp-servers/{id}` | Update MCP server |
587
+ | [x] | DELETE | `/mcp-servers/{id}` | Delete MCP server |
588
+ | [x] | POST | `/mcp-servers/{id}/test` | Test server connectivity |
589
+ | [x] | GET | `/mcp-servers/{id}/capabilities` | List capabilities |
590
+ | [x] | PUT | `/mcp-servers/{id}/capabilities` | Update capabilities |
591
+ | [x] | GET | `/mcp-servers/{id}/user-access` | List user access |
592
+ | [x] | PUT | `/mcp-servers/{id}/user-access` | Update user access |
593
+ | [x] | GET | `/mcp-servers/{id}/connections` | List active connections with user/workspace filters |
594
+ | [x] | DELETE | `/mcp-servers/{id}/connections` | Disconnect one user connection |
595
+
596
+ All verified with live API 2026-03-23. List returns `{ object: "list", total, data }`. Capabilities list returns `{ total, has_more, capabilities }`. User access returns `{ object: "list", default_user_access, total, has_more, data }`.
597
+
598
+ **Pagination**: `list_mcp_server_capabilities` and `list_mcp_server_user_access` accept `current_page` (page number, default 1) and `page_size` (results per page, max 100).
599
+
600
+ ## Current: Organisation guardrails and logs (added 2026-08-09)
601
+
602
+ | Status | Method | Path | Tool |
603
+ |---|---|---|---|
604
+ | [x] | GET | `/admin/organisation/defaults` | `get_organisation_defaults` |
605
+ | [x] | PUT | `/admin/organisation/defaults` | `update_organisation_defaults` |
606
+ | [x] | GET | `/workspace-exclusions/input-guardrails` | `list_input_guardrail_workspace_exclusions` |
607
+ | [x] | PUT | `/workspace-exclusions/input-guardrails` | `update_input_guardrail_workspace_exclusions` |
608
+ | [x] | GET | `/workspace-exclusions/output-guardrails` | `list_output_guardrail_workspace_exclusions` |
609
+ | [x] | PUT | `/workspace-exclusions/output-guardrails` | `update_output_guardrail_workspace_exclusions` |
610
+ | [x] | GET | `/logs/{logId}` | `get_log` |
611
+ | [x] | GET | `/logs/exports/field-restrictions?workspace_id={workspaceId}` | `get_log_export_field_restrictions` |
612
+
613
+ The versioned single-log endpoint accepts `path_format` (`v1` or `v2`), `created_at` for v2 storage paths, and the optional `hooks` log type. Workspace exclusions require an organisation service API key with the documented organisation exclusion scopes.
614
+
615
+ ## Current: SCIM group mappings (added 2026-08-09)
616
+
617
+ | Status | Method | Path | Tool |
618
+ |---|---|---|---|
619
+ | [x] | GET | `/scim/workspaces` | `list_scim_workspace_mappings` |
620
+ | [x] | POST | `/scim/workspaces` | `create_scim_workspace_mapping` |
621
+ | [x] | DELETE | `/scim/workspaces/{mappingId}` | `delete_scim_workspace_mapping` |
622
+ | [x] | GET | `/scim/groups` | `list_scim_groups` |
623
+
624
+ Mapping creation accepts a workspace role plus exactly one provisioned SCIM group ID or name. Both list endpoints support the current pagination fields; group listing also supports search.
625
+
626
+ ## Current: Model pricing and integration schemas (added 2026-08-09)
627
+
628
+ | Status | Method | Base/path | Tool |
629
+ |---|---|---|---|
630
+ | [x] | GET | `https://api.portkey.ai/model-configs/pricing/{provider}/{model}` | `get_model_pricing` |
631
+
632
+ The integration endpoints listed in section 21 now cover the current request/response schemas without adding redundant tools:
633
+
634
+ - create/update integration: `secret_mappings` and `pricing_adjustments`;
635
+ - workspace-scoped create: `create_default_provider` and `default_provider_slug`;
636
+ - model updates: custom/fine-tuned model fields, per-model host/headers, static pricing, and `allow_all_models`;
637
+ - workspace updates: global access, override behavior, usage reset, and top-level/per-workspace default-provider controls;
638
+ - list compatibility: current `{ models }` and `{ workspaces }` response keys normalize to the MCP result shape.