openapi: 3.0.3
info:
title: Stytch B2B Authentication API
version: 2.0.0
description: Stytch's B2B API for multi-tenant authentication. Supports Organizations, Members, SSO (SAML/OIDC), Magic Links,
OTP, OAuth, Discovery, Sessions, B2B RBAC, SCIM, TOTP, Recovery Codes, Passwords, Impersonation, and the B2B IDP.
contact:
name: Stytch
url: https://stytch.com/docs
license:
name: Proprietary
servers:
- url: https://api.stytch.com
description: Production
- url: https://test.stytch.com
description: Test
tags:
- name: B2b SCIM
- name: Organization
- name: Organizations
- name: Members
- name: B2b IDP
- name: Session
- name: B2b Impersonation
- name: B2b RBAC
- name: B2b Recovery Codes
- name: B2b TOTP
- name: Discovery
- name: B2b Magic Links
- name: Email
- name: B2b OAuth
- name: B2b OTP
- name: Password
- name: B2b Passwords
- name: SSO
paths:
/v1/b2b/scim/{organization_id}/connection/{connection_id}:
put:
summary: Update
operationId: api_b2b_scim_v1_b2b_scim_connection_Update
tags:
- B2B SCIM
description: Update a SCIM Connection.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/api_b2b_scim_v1_b2b_scim_connection_UpdateRequest'
parameters:
- name: organization_id
in: path
required: true
schema:
type: string
description: Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to
perform operations on an Organization, so be sure to preserve this value. You may also use the organization_slug
or organization_external_id here as a convenience.
description: Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform
operations on an Organization, so be sure to preserve this value. You may also use the organization_slug or organization_external_id
here as a convenience.
- name: connection_id
in: path
required: true
schema:
type: string
description: The ID of the SCIM connection.
description: The ID of the SCIM connection.
- name: X-Stytch-Member-Session
in: header
required: false
description: A Stytch session that can be used to run the request with the given member's permissions.
schema:
type: string
- name: X-Stytch-Member-SessionJWT
in: header
required: false
description: A Stytch Session JSON Web Token (JWT) that can be used to run the request with the given member's permissions.
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/api_b2b_scim_v1_b2b_scim_connection_UpdateResponse'
'400':
description: Bad request
'401':
description: Unauthorized
content:
application/json:
example:
status_code: 401
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: unauthorized_credentials
error_message: Unauthorized credentials.
error_url: https://stytch.com/docs/api/errors/401
'429':
description: Too Many Requests
content:
application/json:
example:
status_code: 429
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: too_many_requests
error_message: Too many requests have been made.
error_url: https://stytch.com/docs/api/errors/429
'500':
description: Internal server error
content:
application/json:
example:
status_code: 500
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: internal_server_error
error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us
know what went wrong.
error_url: https://stytch.com/docs/api/errors/500
x-code-samples:
- lang: csharp
label: C#
source: "// PUT /v1/b2b/scim/{organization_id}/connection/{connection_id}\nconst stytch = require('stytch');\n\nconst\
\ client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params =\
\ {\n organization_id: \"${organizationId}\",\n connection_id: \"${scimConnectionId}\",\n display_name: \"Example\
\ SCIM connection\",\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n },\n\
};\n\nclient.SCIM.Connection.Update(params, options)\n .then(resp => { console.log(resp) })\n .catch(err => {\
\ console.log(err) });"
- lang: go
label: Go
source: "// PUT /v1/b2b/scim/{organization_id}/connection/{connection_id}\npackage main\n\nimport (\n\t\"context\"\
\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/b2bstytchapi\"\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/scim/connection\"\
\n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\nfunc main() {\n\tclient, err := b2bstytchapi.NewClient(\n\
\t\t\"${projectId}\",\n\t\t\"${secret}\",\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"error instantiating client:\
\ %v\", err)\n\t}\n\n\tparams := &connection.UpdateParams{\n\t\tOrganizationID: \"${organizationId}\",\n\t\tConnectionID:\
\ \"${scimConnectionId}\",\n\t\tDisplayName: \"Example SCIM connection\",\n\t}\n\n\toptions := &connection.UpdateParamsOptions{\n\
\t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\",\n\t\t},\n\t}\n\n\tresp,\
\ err := client.SCIM.Connection.Update(context.Background(), params, options)\n\tif err != nil {\n\t\tlog.Fatalf(\"\
error in method call: %v\", err)\n\t}\n\n\tlog.Println(resp)\n}\n"
- lang: java
label: Java
source: "// PUT /v1/b2b/scim/{organization_id}/connection/{connection_id}\npackage com.example;\n\nimport com.stytch.java.b2b.models.scimconnection.UpdateRequest;\n\
import com.stytch.java.b2b.models.scimconnection.UpdateRequestOptions;\nimport com.stytch.java.b2b.StytchB2BClient;\n\
import com.stytch.java.common.methodoptions.Authorization;\nimport com.stytch.java.common.StytchResult;\n\npublic\
\ class Main {\n public static void main(String[] args) {\n StytchB2BClient.configure(\"${projectId}\"\
, \"${secret}\");\n\n UpdateRequest params = new UpdateRequest();\n params.setOrganizationId(\"${organizationId}\"\
);\n params.setConnectionId(\"${scimConnectionId}\");\n params.setDisplayName(\"Example SCIM connection\"\
);\n\n UpdateRequestOptions options = new UpdateRequestOptions();\n Authorization authorization =\
\ new Authorization();\n authorization.setSessionToken(\"${sessionToken}\");\n options.setAuthorization(authorization);\n\
\n Object result = StytchB2BClient.getSCIM().getConnection().update(params, options);\n if (result\
\ instanceof StytchResult.Success) {\n System.out.println(((StytchResult.Success) result).getValue());\n\
\ } else {\n System.out.println(((StytchResult.Error) result).getException());\n }\n }\n\
}"
- lang: kotlin
label: Kotlin
source: "// PUT /v1/b2b/scim/{organization_id}/connection/{connection_id}\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\
import com.stytch.java.b2b.models.scimconnection.UpdateRequest\nimport com.stytch.java.b2b.models.scimconnection.UpdateRequestOptions\n\
import com.stytch.java.common.methodoptions.Authorization\n\nfun main() {\n StytchB2BClient.configure(\n \
\ projectId = \"${projectId}\",\n secret = \"${secret}\",\n )\n\n when (\n val result =\n\
\ StytchB2BClient.scim.connection.update(\n UpdateRequest(\n organizationId\
\ = \"${organizationId}\",\n connectionId = \"${scimConnectionId}\",\n displayName\
\ = \"Example SCIM connection\",\n ),\n UpdateRequestOptions(\n \
\ Authorization(\n sessionToken = \"${sessionToken}\",\n ),\n \
\ ),\n )\n ) {\n is StytchResult.Success -> println(result.value)\n is StytchResult.Error\
\ -> println(result.exception)\n }\n}\n"
- lang: javascript
label: Node.js
source: "// PUT /v1/b2b/scim/{organization_id}/connection/{connection_id}\nconst stytch = require('stytch');\n\nconst\
\ client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params =\
\ {\n organization_id: \"${organizationId}\",\n connection_id: \"${scimConnectionId}\",\n display_name: \"Example\
\ SCIM connection\",\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n },\n\
};\n\nclient.scim.connection.update(params, options)\n .then(resp => { console.log(resp) })\n .catch(err => {\
\ console.log(err) });"
- lang: php
label: PHP
source: "$response = $client->scim->connection->update([\n 'organization_id' => '${organizationId}',\n 'connection_id'\
\ => '${scimConnectionId}',\n 'display_name' => 'Example SCIM connection',\n], [\n 'authorization' =>\
\ ['session_token' => '${sessionToken}'],\n\n]);"
- lang: python
label: Python
source: "# PUT /v1/b2b/scim/{organization_id}/connection/{connection_id}\nfrom stytch import B2BClient\nfrom stytch.b2b.models.scim_connection\
\ import UpdateRequestOptions\nfrom stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n \
\ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp = client.scim.connection.update(\n organization_id=\"\
${organizationId}\",\n connection_id=\"${scimConnectionId}\",\n display_name=\"Example SCIM connection\",\n\
\ method_options=UpdateRequestOptions(\n authorization=Authorization(\n session_token=\"${sessionToken}\"\
,\n ),\n ),\n)\n\nprint(resp)\n"
- lang: ruby
label: Ruby
source: "# PUT /v1/b2b/scim/{organization_id}/connection/{connection_id}\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\
\ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.scim.connection.update(\n organization_id:\
\ \"${organizationId}\",\n connection_id: \"${scimConnectionId}\",\n display_name: \"Example SCIM connection\"\
,\n method_options: StytchB2B::SCIM::Connection::UpdateRequestOptions.new(\n authorization: Stytch::MethodOptions::Authorization.new(session_token:\
\ '${sessionToken}')\n )\n)\n\nputs resp"
- lang: rust
label: Rust
source: "// PUT /v1/b2b/scim/{organization_id}/connection/{connection_id}\nuse stytch::b2b::client::Client;\nuse stytch::b2b::scim_connection::UpdateRequest;\n\
\nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp = client.scim.connection.update(\n\
\ UpdateRequest{\n organization_id: \"${organizationId}\",\n connection_id: \"${scimConnectionId}\"\
,\n display_name: Some(String::from(\"Example SCIM connection\")),\n ..Default::default()\n\
\ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}"
- lang: bash
label: cURL
source: "# PUT /v1/b2b/scim/{organization_id}/connection/{connection_id}\ncurl --request PUT \\\n --url https://test.stytch.com/v1/b2b/scim/${organizationId}/connection/${scimConnectionId}\
\ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n -H \"X-Stytch-Member-Session:\
\ ${sessionToken}\" \\\n -d '{\n \"display_name\": \"Example SCIM connection\"\n }'"
delete:
summary: Delete
operationId: api_b2b_scim_v1_b2b_scim_connection_Delete
tags:
- B2B SCIM
description: Deletes a SCIM Connection.
parameters:
- name: organization_id
in: path
required: true
schema:
type: string
description: Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to
perform operations on an Organization, so be sure to preserve this value. You may also use the organization_slug
or organization_external_id here as a convenience.
description: Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform
operations on an Organization, so be sure to preserve this value. You may also use the organization_slug or organization_external_id
here as a convenience.
- name: connection_id
in: path
required: true
schema:
type: string
description: The ID of the SCIM connection.
description: The ID of the SCIM connection.
- name: X-Stytch-Member-Session
in: header
required: false
description: A Stytch session that can be used to run the request with the given member's permissions.
schema:
type: string
- name: X-Stytch-Member-SessionJWT
in: header
required: false
description: A Stytch Session JSON Web Token (JWT) that can be used to run the request with the given member's permissions.
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/api_b2b_scim_v1_b2b_scim_connection_DeleteResponse'
'400':
description: Bad request
'401':
description: Unauthorized
content:
application/json:
example:
status_code: 401
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: unauthorized_credentials
error_message: Unauthorized credentials.
error_url: https://stytch.com/docs/api/errors/401
'429':
description: Too Many Requests
content:
application/json:
example:
status_code: 429
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: too_many_requests
error_message: Too many requests have been made.
error_url: https://stytch.com/docs/api/errors/429
'500':
description: Internal server error
content:
application/json:
example:
status_code: 500
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: internal_server_error
error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us
know what went wrong.
error_url: https://stytch.com/docs/api/errors/500
x-code-samples:
- lang: csharp
label: C#
source: "// DELETE /v1/b2b/scim/{organization_id}/connection/{connection_id}\nconst stytch = require('stytch');\n\n\
const client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\
\ = {\n organization_id: \"${organizationId}\",\n connection_id: \"${scimConnectionId}\",\n};\n\nconst options\
\ = {\n authorization: {\n session_token: '${sessionToken}',\n },\n};\n\nclient.SCIM.Connection.Delete(params,\
\ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err) });"
- lang: go
label: Go
source: "// DELETE /v1/b2b/scim/{organization_id}/connection/{connection_id}\npackage main\n\nimport (\n\t\"context\"\
\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/b2bstytchapi\"\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/scim/connection\"\
\n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\nfunc main() {\n\tclient, err := b2bstytchapi.NewClient(\n\
\t\t\"${projectId}\",\n\t\t\"${secret}\",\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"error instantiating client:\
\ %v\", err)\n\t}\n\n\tparams := &connection.DeleteParams{\n\t\tOrganizationID: \"${organizationId}\",\n\t\tConnectionID:\
\ \"${scimConnectionId}\",\n\t}\n\n\toptions := &connection.DeleteParamsOptions{\n\t\tAuthorization: methodoptions.Authorization{\n\
\t\t\tSessionToken: \"${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.SCIM.Connection.Delete(context.Background(),\
\ params, options)\n\tif err != nil {\n\t\tlog.Fatalf(\"error in method call: %v\", err)\n\t}\n\n\tlog.Println(resp)\n\
}\n"
- lang: java
label: Java
source: "// DELETE /v1/b2b/scim/{organization_id}/connection/{connection_id}\npackage com.example;\n\nimport com.stytch.java.b2b.models.scimconnection.DeleteRequest;\n\
import com.stytch.java.b2b.models.scimconnection.DeleteRequestOptions;\nimport com.stytch.java.b2b.StytchB2BClient;\n\
import com.stytch.java.common.methodoptions.Authorization;\nimport com.stytch.java.common.StytchResult;\n\npublic\
\ class Main {\n public static void main(String[] args) {\n StytchB2BClient.configure(\"${projectId}\"\
, \"${secret}\");\n\n DeleteRequest params = new DeleteRequest();\n params.setOrganizationId(\"${organizationId}\"\
);\n params.setConnectionId(\"${scimConnectionId}\");\n\n DeleteRequestOptions options = new DeleteRequestOptions();\n\
\ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"${sessionToken}\"\
);\n options.setAuthorization(authorization);\n\n Object result = StytchB2BClient.getSCIM().getConnection().delete(params,\
\ options);\n if (result instanceof StytchResult.Success) {\n System.out.println(((StytchResult.Success)\
\ result).getValue());\n } else {\n System.out.println(((StytchResult.Error) result).getException());\n\
\ }\n }\n}"
- lang: kotlin
label: Kotlin
source: "// DELETE /v1/b2b/scim/{organization_id}/connection/{connection_id}\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\
import com.stytch.java.b2b.models.scimconnection.DeleteRequest\nimport com.stytch.java.b2b.models.scimconnection.DeleteRequestOptions\n\
import com.stytch.java.common.methodoptions.Authorization\n\nfun main() {\n StytchB2BClient.configure(\n \
\ projectId = \"${projectId}\",\n secret = \"${secret}\",\n )\n\n when (\n val result =\n\
\ StytchB2BClient.scim.connection.delete(\n DeleteRequest(\n organizationId\
\ = \"${organizationId}\",\n connectionId = \"${scimConnectionId}\",\n ),\n \
\ DeleteRequestOptions(\n Authorization(\n sessionToken =\
\ \"${sessionToken}\",\n ),\n ),\n )\n ) {\n is StytchResult.Success\
\ -> println(result.value)\n is StytchResult.Error -> println(result.exception)\n }\n}\n"
- lang: javascript
label: Node.js
source: "// DELETE /v1/b2b/scim/{organization_id}/connection/{connection_id}\nconst stytch = require('stytch');\n\n\
const client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\
\ = {\n organization_id: \"${organizationId}\",\n connection_id: \"${scimConnectionId}\",\n};\n\nconst options\
\ = {\n authorization: {\n session_token: '${sessionToken}',\n },\n};\n\nclient.scim.connection.delete(params,\
\ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err) });"
- lang: php
label: PHP
source: "$response = $client->scim->connection->delete([\n 'organization_id' => '${organizationId}',\n 'connection_id'\
\ => '${scimConnectionId}',\n], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\n]);"
- lang: python
label: Python
source: "# DELETE /v1/b2b/scim/{organization_id}/connection/{connection_id}\nfrom stytch import B2BClient\nfrom stytch.b2b.models.scim_connection\
\ import DeleteRequestOptions\nfrom stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n \
\ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp = client.scim.connection.delete(\n organization_id=\"\
${organizationId}\",\n connection_id=\"${scimConnectionId}\",\n method_options=DeleteRequestOptions(\n \
\ authorization=Authorization(\n session_token=\"${sessionToken}\",\n ),\n ),\n)\n\nprint(resp)\n"
- lang: ruby
label: Ruby
source: "# DELETE /v1/b2b/scim/{organization_id}/connection/{connection_id}\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\
\ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.scim.connection.delete(\n organization_id:\
\ \"${organizationId}\",\n connection_id: \"${scimConnectionId}\",\n method_options: StytchB2B::SCIM::Connection::DeleteRequestOptions.new(\n\
\ authorization: Stytch::MethodOptions::Authorization.new(session_token: '${sessionToken}')\n )\n)\n\nputs resp"
- lang: rust
label: Rust
source: "// DELETE /v1/b2b/scim/{organization_id}/connection/{connection_id}\nuse stytch::b2b::client::Client;\nuse\
\ stytch::b2b::scim_connection::DeleteRequest;\n\nfn main() {\n let client = Client::new(\"${projectId}\", \"\
${secret}\").unwrap();\n let resp = client.scim.connection.delete(\n DeleteRequest{\n organization_id:\
\ \"${organizationId}\",\n connection_id: \"${scimConnectionId}\",\n ..Default::default()\n\
\ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}"
- lang: bash
label: cURL
source: "# DELETE /v1/b2b/scim/{organization_id}/connection/{connection_id}\ncurl --request DELETE \\\n --url https://test.stytch.com/v1/b2b/scim/${organizationId}/connection/${scimConnectionId}\
\ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n -H \"X-Stytch-Member-Session:\
\ ${sessionToken}\""
get:
summary: Getgroups
operationId: api_b2b_scim_v1_b2b_scim_connection_GetGroups
tags:
- B2B SCIM
description: Gets a paginated list of all SCIM Groups associated with a given Connection.
parameters:
- name: organization_id
in: path
required: true
schema:
type: string
description: Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to
perform operations on an Organization, so be sure to preserve this value. You may also use the organization_slug
or organization_external_id here as a convenience.
description: Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform
operations on an Organization, so be sure to preserve this value. You may also use the organization_slug or organization_external_id
here as a convenience.
- name: connection_id
in: path
required: true
schema:
type: string
description: The ID of the SCIM connection.
description: The ID of the SCIM connection.
- name: cursor
in: query
required: false
schema:
type: string
description: The `cursor` field allows you to paginate through your results. Each result array is limited to 1000
results. If your query returns more than 1000 results, you will need to paginate the responses using the `cursor`.
If you receive a response that includes a non-null `next_cursor` in the `results_metadata` object, repeat the
search call with the `next_cursor` value set to the `cursor` field to retrieve the next page of results. Continue
to make search calls until the `next_cursor` in the response is null.
- name: limit
in: query
required: false
schema:
type: integer
format: int32
minimum: 0
description: The number of search results to return per page. The default limit is 100. A maximum of 1000 results
can be returned by a single search request. If the total size of your result set is greater than one page size,
you must paginate the response. See the `cursor` field.
- name: X-Stytch-Member-Session
in: header
required: false
description: A Stytch session that can be used to run the request with the given member's permissions.
schema:
type: string
- name: X-Stytch-Member-SessionJWT
in: header
required: false
description: A Stytch Session JSON Web Token (JWT) that can be used to run the request with the given member's permissions.
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/api_b2b_scim_v1_b2b_scim_connection_GetGroupsResponse'
'400':
description: Bad request
'401':
description: Unauthorized
content:
application/json:
example:
status_code: 401
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: unauthorized_credentials
error_message: Unauthorized credentials.
error_url: https://stytch.com/docs/api/errors/401
'429':
description: Too Many Requests
content:
application/json:
example:
status_code: 429
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: too_many_requests
error_message: Too many requests have been made.
error_url: https://stytch.com/docs/api/errors/429
'500':
description: Internal server error
content:
application/json:
example:
status_code: 500
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: internal_server_error
error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us
know what went wrong.
error_url: https://stytch.com/docs/api/errors/500
x-code-samples:
- lang: csharp
label: C#
source: "// GET /v1/b2b/scim/{organization_id}/connection/{connection_id}\nconst stytch = require('stytch');\n\nconst\
\ client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params =\
\ {\n organization_id: \"${organizationId}\",\n connection_id: \"${scimConnectionId}\",\n};\n\nconst options =\
\ {\n authorization: {\n session_token: '${sessionToken}',\n },\n};\n\nclient.SCIM.Connection.GetGroups(params,\
\ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err) });"
- lang: go
label: Go
source: "// GET /v1/b2b/scim/{organization_id}/connection/{connection_id}\npackage main\n\nimport (\n\t\"context\"\
\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/b2bstytchapi\"\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/scim/connection\"\
\n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\nfunc main() {\n\tclient, err := b2bstytchapi.NewClient(\n\
\t\t\"${projectId}\",\n\t\t\"${secret}\",\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"error instantiating client:\
\ %v\", err)\n\t}\n\n\tparams := &connection.GetGroupsParams{\n\t\tOrganizationID: \"${organizationId}\",\n\t\t\
ConnectionID: \"${scimConnectionId}\",\n\t}\n\n\toptions := &connection.GetGroupsParamsOptions{\n\t\tAuthorization:\
\ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.SCIM.Connection.GetGroups(context.Background(),\
\ params, options)\n\tif err != nil {\n\t\tlog.Fatalf(\"error in method call: %v\", err)\n\t}\n\n\tlog.Println(resp)\n\
}\n"
- lang: java
label: Java
source: "// GET /v1/b2b/scim/{organization_id}/connection/{connection_id}\npackage com.example;\n\nimport com.stytch.java.b2b.models.scimconnection.GetGroupsRequest;\n\
import com.stytch.java.b2b.models.scimconnection.GetGroupsRequestOptions;\nimport com.stytch.java.b2b.StytchB2BClient;\n\
import com.stytch.java.common.methodoptions.Authorization;\nimport com.stytch.java.common.StytchResult;\n\npublic\
\ class Main {\n public static void main(String[] args) {\n StytchB2BClient.configure(\"${projectId}\"\
, \"${secret}\");\n\n GetGroupsRequest params = new GetGroupsRequest();\n params.setOrganizationId(\"\
${organizationId}\");\n params.setConnectionId(\"${scimConnectionId}\");\n\n GetGroupsRequestOptions\
\ options = new GetGroupsRequestOptions();\n Authorization authorization = new Authorization();\n \
\ authorization.setSessionToken(\"${sessionToken}\");\n options.setAuthorization(authorization);\n\n \
\ Object result = StytchB2BClient.getSCIM().getConnection().getGroups(params, options);\n if (result instanceof\
\ StytchResult.Success) {\n System.out.println(((StytchResult.Success) result).getValue());\n }\
\ else {\n System.out.println(((StytchResult.Error) result).getException());\n }\n }\n}"
- lang: kotlin
label: Kotlin
source: "// GET /v1/b2b/scim/{organization_id}/connection/{connection_id}\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\
import com.stytch.java.b2b.models.scimconnection.GetGroupsRequest\nimport com.stytch.java.b2b.models.scimconnection.GetGroupsRequestOptions\n\
import com.stytch.java.common.methodoptions.Authorization\n\nfun main() {\n StytchB2BClient.configure(\n \
\ projectId = \"${projectId}\",\n secret = \"${secret}\",\n )\n\n when (\n val result =\n\
\ StytchB2BClient.scim.connection.getGroups(\n GetGroupsRequest(\n \
\ organizationId = \"${organizationId}\",\n connectionId = \"${scimConnectionId}\",\n \
\ ),\n GetGroupsRequestOptions(\n Authorization(\n \
\ sessionToken = \"${sessionToken}\",\n ),\n ),\n )\n ) {\n\
\ is StytchResult.Success -> println(result.value)\n is StytchResult.Error -> println(result.exception)\n\
# --- truncated at 32 KB (1423 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/stytch/refs/heads/main/openapi/stytch-b2b-openapi.yml