Skip to content

Commit a5721ff

Browse files
authored
Merge pull request #139 from Portkey-AI/fix/workspace_user_schema_changes
feat: scim group mappings endpoints definitions
2 parents 362674e + b347c5b commit a5721ff

1 file changed

Lines changed: 261 additions & 1 deletion

File tree

openapi.yaml

Lines changed: 261 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ tags:
139139
- name: Secret-References
140140
description: Create, List, Retrieve, Update, and Delete secret references to external secret managers.
141141

142-
143142
paths:
144143
# Note: When adding an endpoint, make sure you also add it in the `groups` section, in the end of this file,
145144
# under the appropriate group
@@ -15566,6 +15565,238 @@ paths:
1556615565
})
1556715566
console.log(workspace);
1556815567

15568+
/scim/workspaces:
15569+
servers: *ControlPlaneServers
15570+
get:
15571+
tags:
15572+
- Workspaces
15573+
summary: List SCIM Group to Workspace Mappings
15574+
description: |
15575+
List all mappings between SCIM groups and workspaces for the organisation.
15576+
Optionally filter by workspace, SCIM group, or role.
15577+
parameters:
15578+
- name: workspace_id
15579+
in: query
15580+
required: false
15581+
schema:
15582+
type: string
15583+
description: Filter mappings by workspace ID or slug.
15584+
- name: scim_group_id
15585+
in: query
15586+
required: false
15587+
schema:
15588+
type: string
15589+
description: Filter mappings by SCIM group ID.
15590+
- name: role
15591+
in: query
15592+
required: false
15593+
schema:
15594+
type: string
15595+
enum:
15596+
- admin
15597+
- member
15598+
- manager
15599+
description: Filter mappings by role.
15600+
responses:
15601+
"200":
15602+
description: OK
15603+
headers:
15604+
Content-Type:
15605+
schema:
15606+
type: string
15607+
example: application/json
15608+
content:
15609+
application/json:
15610+
schema:
15611+
type: object
15612+
properties:
15613+
mappings:
15614+
type: array
15615+
items:
15616+
type: object
15617+
properties:
15618+
id:
15619+
type: string
15620+
description: Unique ID of the SCIM workspace mapping.
15621+
workspace_id:
15622+
type: string
15623+
description: ID of the mapped workspace.
15624+
scim_group:
15625+
type: string
15626+
description: Display name of the SCIM group.
15627+
scim_group_id:
15628+
type: string
15629+
description: ID of the SCIM group.
15630+
role:
15631+
type: string
15632+
enum:
15633+
- admin
15634+
- member
15635+
- manager
15636+
description: Role assigned to group members in the workspace.
15637+
total_count:
15638+
type: integer
15639+
description: Total number of mappings returned.
15640+
example:
15641+
mappings:
15642+
- id: "d290f1ee-6c54-4b01-90e6-d701748f0851"
15643+
workspace_id: "ws_my-workspace"
15644+
scim_group: "Engineering Team"
15645+
scim_group_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
15646+
role: "member"
15647+
total_count: 1
15648+
x-code-samples:
15649+
- lang: curl
15650+
label: Default
15651+
source: |
15652+
curl -X GET https://api.portkey.ai/v1/scim/workspaces \
15653+
-H "x-portkey-api-key: PORTKEY_API_KEY"
15654+
- lang: curl
15655+
label: Filter by workspace
15656+
source: |
15657+
curl -X GET "https://api.portkey.ai/v1/scim/workspaces?workspace_id=ws_my-workspace" \
15658+
-H "x-portkey-api-key: PORTKEY_API_KEY"
15659+
- lang: curl
15660+
label: Self-Hosted
15661+
source: |
15662+
curl -X GET SELF_HOSTED_CONTROL_PLANE_URL/scim/workspaces \
15663+
-H "x-portkey-api-key: PORTKEY_API_KEY"
15664+
post:
15665+
tags:
15666+
- Workspaces
15667+
summary: Create SCIM Group to Workspace Mapping
15668+
description: |
15669+
Create a mapping between a SCIM group and a workspace.
15670+
You can either reference an existing SCIM group by ID, or provide a group name
15671+
to pre-create the SCIM group before the IdP provisions it.
15672+
requestBody:
15673+
required: true
15674+
content:
15675+
application/json:
15676+
schema:
15677+
type: object
15678+
required:
15679+
- workspace_id
15680+
- role
15681+
properties:
15682+
workspace_id:
15683+
type: string
15684+
description: ID or slug (ws_ prefix) of the workspace to map the SCIM group to.
15685+
role:
15686+
type: string
15687+
enum:
15688+
- admin
15689+
- member
15690+
- manager
15691+
description: Role assigned to group members in the workspace.
15692+
scim_group_id:
15693+
type: string
15694+
description: ID of an existing SCIM group. Required if scim_group_name is not provided.
15695+
scim_group_name:
15696+
type: string
15697+
description: Display name for the SCIM group. If the group doesn't exist, it will be created. Required if scim_group_id is not provided. Must not match the pattern-based auto-provisioning format (e.g. ws-name-role-admin).
15698+
oneOf:
15699+
- required:
15700+
- scim_group_id
15701+
- required:
15702+
- scim_group_name
15703+
examples:
15704+
pre_create_group:
15705+
summary: Pre-create a SCIM group and map it
15706+
value:
15707+
scim_group_name: "Engineering Team"
15708+
workspace_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
15709+
role: admin
15710+
responses:
15711+
"200":
15712+
description: OK
15713+
headers:
15714+
Content-Type:
15715+
schema:
15716+
type: string
15717+
example: application/json
15718+
content:
15719+
application/json:
15720+
schema:
15721+
$ref: "#/components/schemas/ScimWorkspaceMapping"
15722+
x-code-samples:
15723+
- lang: curl
15724+
label: Default
15725+
source: |
15726+
curl -X POST https://api.portkey.ai/v1/scim/workspaces \
15727+
-H "x-portkey-api-key: PORTKEY_API_KEY" \
15728+
-H "Content-Type: application/json" \
15729+
-d '{
15730+
"scim_group_name": "Engineering Team",
15731+
"workspace_id": "ws_my-workspace",
15732+
"role": "member"
15733+
}'
15734+
- lang: curl
15735+
label: With existing group
15736+
source: |
15737+
curl -X POST https://api.portkey.ai/v1/scim/workspaces \
15738+
-H "x-portkey-api-key: PORTKEY_API_KEY" \
15739+
-H "Content-Type: application/json" \
15740+
-d '{
15741+
"scim_group_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
15742+
"workspace_id": "ws_my-workspace",
15743+
"role": "admin"
15744+
}'
15745+
- lang: curl
15746+
label: Self-Hosted
15747+
source: |
15748+
curl -X POST SELF_HOSTED_CONTROL_PLANE_URL/scim/workspaces \
15749+
-H "x-portkey-api-key: PORTKEY_API_KEY" \
15750+
-H "Content-Type: application/json" \
15751+
-d '{
15752+
"scim_group_name": "Engineering Team",
15753+
"workspace_id": "ws_my-workspace",
15754+
"role": "member"
15755+
}'
15756+
15757+
/scim/workspaces/{scimWorkspaceGroupId}:
15758+
servers: *ControlPlaneServers
15759+
delete:
15760+
tags:
15761+
- Workspaces
15762+
summary: Delete SCIM Group to Workspace Mapping
15763+
description: Remove a SCIM group to workspace mapping. This archives the mapping but does not delete the SCIM group or workspace.
15764+
parameters:
15765+
- name: scimWorkspaceGroupId
15766+
in: path
15767+
required: true
15768+
schema:
15769+
type: string
15770+
description: ID of the SCIM workspace mapping to delete
15771+
responses:
15772+
"200":
15773+
description: OK
15774+
headers:
15775+
Content-Type:
15776+
schema:
15777+
type: string
15778+
example: application/json
15779+
content:
15780+
application/json:
15781+
schema:
15782+
type: object
15783+
properties:
15784+
success:
15785+
type: boolean
15786+
example:
15787+
success: true
15788+
x-code-samples:
15789+
- lang: curl
15790+
label: Default
15791+
source: |
15792+
curl -X DELETE https://api.portkey.ai/v1/scim/workspaces/MAPPING_ID \
15793+
-H "x-portkey-api-key: PORTKEY_API_KEY"
15794+
- lang: curl
15795+
label: Self-Hosted
15796+
source: |
15797+
curl -X DELETE SELF_HOSTED_CONTROL_PLANE_URL/scim/workspaces/MAPPING_ID \
15798+
-H "x-portkey-api-key: PORTKEY_API_KEY"
15799+
1556915800
/mcp-integrations:
1557015801
servers: *ControlPlaneServers
1557115802
post:
@@ -33270,6 +33501,35 @@ components:
3327033501
items:
3327133502
$ref: "#/components/schemas/RateLimits"
3327233503

33504+
ScimWorkspaceMapping:
33505+
type: object
33506+
properties:
33507+
id:
33508+
type: string
33509+
description: Unique ID of the mapping
33510+
workspace_id:
33511+
type: string
33512+
description: ID of the mapped workspace
33513+
scim_group:
33514+
type: string
33515+
description: Display name of the SCIM group
33516+
role:
33517+
type: string
33518+
enum:
33519+
- admin
33520+
- member
33521+
- manager
33522+
description: Role assigned to group members
33523+
scim_group_id:
33524+
type: string
33525+
description: ID of the SCIM group
33526+
example:
33527+
id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
33528+
workspace_id: "ws-12345"
33529+
scim_group: "Engineering Team"
33530+
role: "member"
33531+
scim_group_id: "d290f1ee-6c54-4b01-90e6-d701748f0851"
33532+
3327333533
Collection:
3327433534
type: object
3327533535
properties:

0 commit comments

Comments
 (0)