openapi: 3.0.3 info: title: Stytch API description: The Stytch API provides endpoints for authentication and user management. version: 2.0.0 contact: name: Stytch Support url: https://stytch.com/docs email: support@stytch.com servers: - url: https://api.stytch.com description: Production server - url: https://test.stytch.com description: Test server security: - basicAuth: [] paths: /v1/connected_apps/clients/{client_id}: get: summary: Get operationId: api_connectedapps_v1_connected_apps_clients_Get tags: - Connected Apps description: Retrieve details of a specific Connected App by `client_id`. parameters: - name: client_id in: path required: true schema: type: string description: The ID of the Connected App client. description: The ID of the Connected App client. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_GetResponse' '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/connected_apps/clients/{client_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleConnectedAppClientID}\"\ ,\n};\n\nclient.ConnectedApp.Clients.Get(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/connected_apps/clients/{client_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/consumer/connectedapps/clients\"\ \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 := &clients.GetParams{\n\t\tClientID:\ \ \"${exampleConnectedAppClientID}\",\n\t}\n\n\tresp, err := client.ConnectedApp.Clients.Get(context.Background(),\ \ params)\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/connected_apps/clients/{client_id}\npackage com.example;\n\ \nimport com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.connectedappsclients.GetRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ GetRequest params = new GetRequest();\n params.setClientId(\"\ ${exampleConnectedAppClientID}\");\n\n Object result = StytchB2BClient.getConnectedApp().getClients().get(params);\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/connected_apps/clients/{client_id}\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.connectedappsclients.GetRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.connectedApp.clients.get(\n \ \ GetRequest(\n clientId = \"${exampleConnectedAppClientID}\"\ ,\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: "// GET /v1/connected_apps/clients/{client_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleConnectedAppClientID}\"\ ,\n};\n\nclient.connectedApp.clients.get(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->connected_app->clients->get([\n 'client_id'\ \ => '${exampleConnectedAppClientID}',\n]);" - lang: python label: Python source: "# GET /v1/connected_apps/clients/{client_id}\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.connected_app.clients.get(\n\ \ client_id=\"${exampleConnectedAppClientID}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/connected_apps/clients/{client_id}\nrequire 'stytch'\n\n\ client = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.connected_app.clients.get(\n client_id:\ \ \"${exampleConnectedAppClientID}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/connected_apps/clients/{client_id}\nuse stytch::b2b::client::Client;\n\ use stytch::consumer::connected_apps_clients::GetRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.connected_app.clients.get(\n GetRequest{\n\ \ client_id: \"${exampleConnectedAppClientID}\",\n \ \ ..Default::default()\n }\n ).await;\n println!(\"The response\ \ is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/connected_apps/clients/{client_id}\ncurl --request GET\ \ \\\n --url https://test.stytch.com/v1/connected_apps/clients/${exampleConnectedAppClientID}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" put: summary: Update operationId: api_connectedapps_v1_connected_apps_clients_Update tags: - Connected Apps description: Updates mutable fields of a Connected App. Cannot update Client Type, Client ID, or Secrets. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_UpdateRequest' parameters: - name: client_id in: path required: true schema: type: string description: The ID of the client. description: The ID of the client. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_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/connected_apps/clients/{client_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleM2MClientID}\"\ ,\n client_name: \"My Sample Client\",\n client_description: \"My sample\ \ client for testing out Connected Apps\",\n redirect_urls: [\"https://example.com/callback\"\ ],\n full_access_allowed: false,\n};\n\nclient.ConnectedApp.Clients.Update(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// PUT /v1/connected_apps/clients/{client_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/consumer/connectedapps/clients\"\ \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 := &clients.UpdateParams{\n\t\tClientID:\ \ \"${exampleM2MClientID}\",\n\t\tClientName: \"My Sample\ \ Client\",\n\t\tClientDescription: \"My sample client for testing out Connected\ \ Apps\",\n\t\tRedirectURLs: []string{\"https://example.com/callback\"\ },\n\t\tFullAccessAllowed: false,\n\t}\n\n\tresp, err := client.ConnectedApp.Clients.Update(context.Background(),\ \ params)\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/connected_apps/clients/{client_id}\npackage com.example;\n\ \nimport com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.connectedappsclients.UpdateRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ UpdateRequest params = new UpdateRequest();\n params.setClientId(\"\ ${exampleM2MClientID}\");\n params.setClientName(\"My Sample Client\"\ );\n params.setClientDescription(\"My sample client for testing out\ \ Connected Apps\");\n params.setRedirectURLs(new String(\"https://example.com/callback\"\ ));\n params.setFullAccessAllowed(false);\n\n Object result\ \ = StytchB2BClient.getConnectedApp().getClients().update(params);\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/connected_apps/clients/{client_id}\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.connectedappsclients.UpdateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.connectedApp.clients.update(\n \ \ UpdateRequest(\n clientId = \"${exampleM2MClientID}\"\ ,\n clientName = \"My Sample Client\",\n \ \ clientDescription = \"My sample client for testing out Connected\ \ Apps\",\n redirectURLs = arrayOf(\"https://example.com/callback\"\ ),\n fullAccessAllowed = false,\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/connected_apps/clients/{client_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleM2MClientID}\"\ ,\n client_name: \"My Sample Client\",\n client_description: \"My sample\ \ client for testing out Connected Apps\",\n redirect_urls: [\"https://example.com/callback\"\ ],\n full_access_allowed: false,\n};\n\nclient.connectedApp.clients.update(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->connected_app->clients->update([\n 'client_id'\ \ => '${exampleM2MClientID}',\n 'client_name' => 'My Sample Client',\n\ \ 'client_description' => 'My sample client for testing out Connected\ \ Apps',\n 'redirect_urls' => ['https://example.com/callback'],\n \ \ 'full_access_allowed' => false,\n]);" - lang: python label: Python source: "# PUT /v1/connected_apps/clients/{client_id}\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.connected_app.clients.update(\n\ \ client_id=\"${exampleM2MClientID}\",\n client_name=\"My Sample Client\"\ ,\n client_description=\"My sample client for testing out Connected Apps\"\ ,\n redirect_urls=[\"https://example.com/callback\"],\n full_access_allowed=False,\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# PUT /v1/connected_apps/clients/{client_id}\nrequire 'stytch'\n\n\ client = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.connected_app.clients.update(\n client_id:\ \ \"${exampleM2MClientID}\",\n client_name: \"My Sample Client\",\n client_description:\ \ \"My sample client for testing out Connected Apps\",\n redirect_urls:\ \ ['https://example.com/callback'],\n full_access_allowed: false\n \n\ )\n\nputs resp" - lang: rust label: Rust source: "// PUT /v1/connected_apps/clients/{client_id}\nuse stytch::b2b::client::Client;\n\ use stytch::consumer::connected_apps_clients::UpdateRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.connected_app.clients.update(\n UpdateRequest{\n\ \ client_id: \"${exampleM2MClientID}\",\n client_name:\ \ Some(String::from(\"My Sample Client\")),\n client_description:\ \ Some(String::from(\"My sample client for testing out Connected Apps\"\ )),\n redirect_urls: vec![\"https://example.com/callback\"],\n\ \ full_access_allowed: false,\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# PUT /v1/connected_apps/clients/{client_id}\ncurl --request PUT\ \ \\\n --url https://test.stytch.com/v1/connected_apps/clients/${exampleM2MClientID}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"client_name\": \"My Sample Client\",\n \"client_description\"\ : \"My sample client for testing out Connected Apps\",\n \"redirect_urls\"\ : [\"https://example.com/callback\"],\n \"full_access_allowed\": false\n\ \ }'" delete: summary: Delete operationId: api_connectedapps_v1_connected_apps_clients_Delete tags: - Connected Apps description: Deletes a Connected App. parameters: - name: client_id in: path required: true schema: type: string description: The ID of the client. description: The ID of the client. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_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/connected_apps/clients/{client_id}\nconst stytch =\ \ require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n client_id:\ \ \"${exampleM2MClientID}\",\n};\n\nclient.ConnectedApp.Clients.Delete(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// DELETE /v1/connected_apps/clients/{client_id}\npackage main\n\n\ import (\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/consumer/connectedapps/clients\"\ \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 := &clients.DeleteParams{\n\t\tClientID:\ \ \"${exampleM2MClientID}\",\n\t}\n\n\tresp, err := client.ConnectedApp.Clients.Delete(context.Background(),\ \ params)\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/connected_apps/clients/{client_id}\npackage com.example;\n\ \nimport com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.connectedappsclients.DeleteRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ DeleteRequest params = new DeleteRequest();\n params.setClientId(\"\ ${exampleM2MClientID}\");\n\n Object result = StytchB2BClient.getConnectedApp().getClients().delete(params);\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/connected_apps/clients/{client_id}\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.connectedappsclients.DeleteRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.connectedApp.clients.delete(\n \ \ DeleteRequest(\n clientId = \"${exampleM2MClientID}\"\ ,\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/connected_apps/clients/{client_id}\nconst stytch =\ \ require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n client_id:\ \ \"${exampleM2MClientID}\",\n};\n\nclient.connectedApp.clients.delete(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->connected_app->clients->delete([\n 'client_id'\ \ => '${exampleM2MClientID}',\n]);" - lang: python label: Python source: "# DELETE /v1/connected_apps/clients/{client_id}\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.connected_app.clients.delete(\n\ \ client_id=\"${exampleM2MClientID}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/connected_apps/clients/{client_id}\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.connected_app.clients.delete(\n client_id:\ \ \"${exampleM2MClientID}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/connected_apps/clients/{client_id}\nuse stytch::b2b::client::Client;\n\ use stytch::consumer::connected_apps_clients::DeleteRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.connected_app.clients.delete(\n DeleteRequest{\n\ \ client_id: \"${exampleM2MClientID}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# DELETE /v1/connected_apps/clients/{client_id}\ncurl --request DELETE\ \ \\\n --url https://test.stytch.com/v1/connected_apps/clients/${exampleM2MClientID}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/connected_apps/clients/search: post: summary: Search operationId: api_connectedapps_v1_connected_apps_clients_Search tags: - Connected Apps description: Search for Connected Apps. Supports cursor-based pagination. Specific filters coming soon. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_SearchRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_SearchResponse' '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: "// POST /v1/connected_apps/clients/search\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n limit: 10,\n};\n\nclient.ConnectedApp.Clients.Search(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/connected_apps/clients/search\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/consumer/connectedapps/clients\"\ \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 := &clients.SearchParams{\n\t\tLimit:\ \ 10,\n\t}\n\n\tresp, err := client.ConnectedApp.Clients.Search(context.Background(),\ \ params)\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: "// POST /v1/connected_apps/clients/search\npackage com.example;\n\ \nimport com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.connectedappsclients.SearchRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ SearchRequest params = new SearchRequest();\n params.setLimit(10);\n\ \n Object result = StytchB2BClient.getConnectedApp().getClients().search(params);\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: "// POST /v1/connected_apps/clients/search\npackage com.example\n\n\ import com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.connectedappsclients.SearchRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.connectedApp.clients.search(\n \ \ SearchRequest(\n limit = 10,\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: "// POST /v1/connected_apps/clients/search\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n limit: 10,\n};\n\nclient.connectedApp.clients.search(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->connected_app->clients->search([\n 'limit'\ \ => 10,\n]);" - lang: python label: Python source: "# POST /v1/connected_apps/clients/search\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.connected_app.clients.search(\n limit=10,\n)\n\n\ print(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/connected_apps/clients/search\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.connected_app.clients.search(\n limit:\ \ 10\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/connected_apps/clients/search\nuse stytch::b2b::client::Client;\n\ use stytch::consumer::connected_apps_clients::SearchRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.connected_app.clients.search(\n SearchRequest{\n\ \ limit: 10,\n ..Default::default()\n }\n \ \ ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/connected_apps/clients/search\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/connected_apps/clients/search \\\n \ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"limit\": 10\n }'" /v1/connected_apps/clients: post: summary: Create operationId: api_connectedapps_v1_connected_apps_clients_Create tags: - Connected Apps description: 'Creates a new Connected App. If the Connected App `client_type` is `first_party` or `third_party` a `client_secret` is returned. **Important:** This is the only time you will be able to view the generated `client_secret` in the API response. Stytch stores a hash of the `client_secret` and cannot recover the value if lost. Be sure to persist the `client_secret` in a secure location. If the `client_secret` is lost, you will need to trigger a secret rotation flow to receive another one.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_CreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_CreateResponse' '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: "// POST /v1/connected_apps/clients\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_type: \"first_party\"\ ,\n client_name: \"My Sample Client\",\n client_description: \"My sample\ \ client for testing out Connected Apps\",\n redirect_urls: [\"https://example.com/callback\"\ ],\n full_access_allowed: false,\n};\n\nclient.ConnectedApp.Clients.Create(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/connected_apps/clients\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/consumer/connectedapps/clients\"\ \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 := &clients.CreateParams{\n\t\tClientType:\ \ clients.CreateRequestClientTypeFirstParty,\n\t\tClientName: \ \ \"My Sample Client\",\n\t\tClientDescription: \"My sample client for\ \ testing out Connected Apps\",\n\t\tRedirectURLs: []string{\"https://example.com/callback\"\ },\n\t\tFullAccessAllowed: false,\n\t}\n\n\tresp, err := client.ConnectedApp.Clients.Create(context.Background(),\ \ params)\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: "// POST /v1/connected_apps/clients\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.connectedappsclients.CreateRequest;\n\ import com.stytch.java.consumer.models.connectedappsclients.CreateRequestClientType;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ CreateRequest params = new CreateRequest();\n params.setClientType(CreateRequestClientType.FIRST_PARTY);\n\ \ params.setClientName(\"My Sample Client\");\n params.setClientDescription(\"\ My sample client for testing out Connected Apps\");\n params.setRedirectURLs(new\ \ String(\"https://example.com/callback\"));\n params.setFullAccessAllowed(false);\n\ \n Object result = StytchB2BClient.getConnectedApp().getClients().create(params);\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: "// POST /v1/connected_apps/clients\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.connectedappsclients.CreateRequest\n\ import com.stytch.java.consumer.models.connectedappsclients.CreateRequestClientType\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.connectedApp.clients.create(\n \ \ CreateRequest(\n clientType = CreateRequestClientType.FIRST_PARTY,\n\ \ clientName = \"My Sample Client\",\n \ \ clientDescription = \"My sample client for testing out Connected\ \ Apps\",\n redirectURLs = arrayOf(\"https://example.com/callback\"\ ),\n fullAccessAllowed = false,\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: "// POST /v1/connected_apps/clients\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_type: \"first_party\"\ ,\n client_name: \"My Sample Client\",\n client_description: \"My sample\ \ client for testing out Connected Apps\",\n redirect_urls: [\"https://example.com/callback\"\ ],\n full_access_allowed: false,\n};\n\nclient.connectedApp.clients.create(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->connected_app->clients->create([\n 'client_type'\ \ => 'first_party',\n 'client_name' => 'My Sample Client',\n 'client_description'\ \ => 'My sample client for testing out Connected Apps',\n 'redirect_urls'\ \ => ['https://example.com/callback'],\n 'full_access_allowed' => false,\n\ ]);" - lang: python label: Python source: "# POST /v1/connected_apps/clients\nfrom stytch import B2BClient\n\ from stytch.consumer.models.connected_apps_clients import CreateRequestClientType\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.connected_app.clients.create(\n client_type=CreateRequestClientType.FIRST_PARTY,\n\ \ client_name=\"My Sample Client\",\n client_description=\"My sample\ \ client for testing out Connected Apps\",\n redirect_urls=[\"https://example.com/callback\"\ ],\n full_access_allowed=False,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/connected_apps/clients\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.connected_app.clients.create(\n\ \ client_type: \"first_party\",\n client_name: \"My Sample Client\",\n\ \ client_description: \"My sample client for testing out Connected Apps\"\ ,\n redirect_urls: ['https://example.com/callback'],\n full_access_allowed:\ \ false\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/connected_apps/clients\nuse stytch::b2b::client::Client;\n\ use stytch::consumer::connected_apps_clients::CreateRequestClientType;\n\ use stytch::consumer::connected_apps_clients::CreateRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.connected_app.clients.create(\n CreateRequest{\n\ \ client_type: CreateRequestClientType::FIRST_PARTY,\n \ \ client_name: Some(String::from(\"My Sample Client\")),\n \ \ client_description: Some(String::from(\"My sample client for testing\ \ out Connected Apps\")),\n redirect_urls: vec![\"https://example.com/callback\"\ ],\n full_access_allowed: false,\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/connected_apps/clients\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/connected_apps/clients \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"client_type\"\ : \"first_party\",\n \"client_name\": \"My Sample Client\",\n \"client_description\"\ : \"My sample client for testing out Connected Apps\",\n \"redirect_urls\"\ : [\"https://example.com/callback\"],\n \"full_access_allowed\": false\n\ \ }'" /v1/connected_apps/clients/{client_id}/secrets/rotate/start: post: summary: Rotatestart operationId: api_connectedapps_v1_connected_apps_clients_secrets_RotateStart tags: - Clients description: 'Initiate the rotation of a Connected App client secret. After this endpoint is called, both the client''s `client_secret` and `next_client_secret` will be valid. To complete the secret rotation flow, update all usages of `client_secret` to `next_client_secret` and call the Rotate Secret Endpoint to complete the flow. Secret rotation can be cancelled using the Cancel Secret Rotation endpoint. **Important:** This is the only time you will be able to view the generated `next_client_secret` in the API response. Stytch stores a hash of the `next_client_secret` and cannot recover the value if lost. Be sure to persist the `next_client_secret` in a secure location. If the `next_client_secret` is lost, you will need to trigger a secret rotation flow to receive another one.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_secrets_RotateStartRequest' parameters: - name: client_id in: path required: true schema: type: string description: The ID of the client. description: The ID of the client. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_secrets_RotateStartResponse' '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: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate/start\n\ const stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n client_id: \"${exampleM2MClientID}\",\n};\n\nclient.ConnectedApp.Clients.Secrets.RotateStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate/start\n\ package 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/consumer/connectedapps/clients/secrets\"\ \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 := &secrets.RotateStartParams{\n\t\ \tClientID: \"${exampleM2MClientID}\",\n\t}\n\n\tresp, err := client.ConnectedApp.Clients.Secrets.RotateStart(context.Background(),\ \ params)\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: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate/start\n\ package com.example;\n\nimport com.stytch.java.b2b.StytchB2BClient;\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.connectedappsclientssecrets.RotateStartRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ RotateStartRequest params = new RotateStartRequest();\n params.setClientId(\"\ ${exampleM2MClientID}\");\n\n Object result = StytchB2BClient.getConnectedApp().getClients().getSecrets().rotateStart(params);\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: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate/start\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.consumer.models.connectedappsclientssecrets.RotateStartRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.connectedApp.clients.secrets.rotateStart(\n\ \ RotateStartRequest(\n clientId = \"\ ${exampleM2MClientID}\",\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: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate/start\n\ const stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n client_id: \"${exampleM2MClientID}\",\n};\n\nclient.connectedApp.clients.secrets.rotateStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->connected_app->clients->secrets->rotate_start([\n\ \ 'client_id' => '${exampleM2MClientID}',\n]);" - lang: python label: Python source: "# POST /v1/connected_apps/clients/{client_id}/secrets/rotate/start\n\ from stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.connected_app.clients.secrets.rotate_start(\n\ \ client_id=\"${exampleM2MClientID}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/connected_apps/clients/{client_id}/secrets/rotate/start\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.connected_app.clients.secrets.rotate_start(\n\ \ client_id: \"${exampleM2MClientID}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate/start\n\ use stytch::b2b::client::Client;\nuse stytch::consumer::connected_apps_clients_secrets::RotateStartRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.connected_app.clients.secrets.rotate_start(\n\ \ RotateStartRequest{\n client_id: \"${exampleM2MClientID}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/connected_apps/clients/{client_id}/secrets/rotate/start\n\ curl --request POST \\\n --url https://test.stytch.com/v1/connected_apps/clients/${exampleM2MClientID}/secrets/rotate/start\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/connected_apps/clients/{client_id}/secrets/rotate/cancel: post: summary: Rotatecancel operationId: api_connectedapps_v1_connected_apps_clients_secrets_RotateCancel tags: - Clients description: Cancel the rotation of a Connected App client secret started with the Start Secret Rotation Endpoint. After this endpoint is called, the client's `next_client_secret` is discarded and only the original `client_secret` will be valid. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_secrets_RotateCancelRequest' parameters: - name: client_id in: path required: true schema: type: string description: The ID of the client. description: The ID of the client. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_secrets_RotateCancelResponse' '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: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate/cancel\n\ const stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n client_id: \"${exampleM2MClientID}\",\n};\n\nclient.ConnectedApp.Clients.Secrets.RotateCancel(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate/cancel\n\ package 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/consumer/connectedapps/clients/secrets\"\ \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 := &secrets.RotateCancelParams{\n\t\ \tClientID: \"${exampleM2MClientID}\",\n\t}\n\n\tresp, err := client.ConnectedApp.Clients.Secrets.RotateCancel(context.Background(),\ \ params)\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: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate/cancel\n\ package com.example;\n\nimport com.stytch.java.b2b.StytchB2BClient;\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.connectedappsclientssecrets.RotateCancelRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ RotateCancelRequest params = new RotateCancelRequest();\n \ \ params.setClientId(\"${exampleM2MClientID}\");\n\n Object result\ \ = StytchB2BClient.getConnectedApp().getClients().getSecrets().rotateCancel(params);\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: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate/cancel\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.consumer.models.connectedappsclientssecrets.RotateCancelRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.connectedApp.clients.secrets.rotateCancel(\n\ \ RotateCancelRequest(\n clientId = \"\ ${exampleM2MClientID}\",\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: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate/cancel\n\ const stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n client_id: \"${exampleM2MClientID}\",\n};\n\nclient.connectedApp.clients.secrets.rotateCancel(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->connected_app->clients->secrets->rotate_cancel([\n\ \ 'client_id' => '${exampleM2MClientID}',\n]);" - lang: python label: Python source: "# POST /v1/connected_apps/clients/{client_id}/secrets/rotate/cancel\n\ from stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.connected_app.clients.secrets.rotate_cancel(\n\ \ client_id=\"${exampleM2MClientID}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/connected_apps/clients/{client_id}/secrets/rotate/cancel\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.connected_app.clients.secrets.rotate_cancel(\n\ \ client_id: \"${exampleM2MClientID}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate/cancel\n\ use stytch::b2b::client::Client;\nuse stytch::consumer::connected_apps_clients_secrets::RotateCancelRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.connected_app.clients.secrets.rotate_cancel(\n\ \ RotateCancelRequest{\n client_id: \"${exampleM2MClientID}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/connected_apps/clients/{client_id}/secrets/rotate/cancel\n\ curl --request POST \\\n --url https://test.stytch.com/v1/connected_apps/clients/${exampleM2MClientID}/secrets/rotate/cancel\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/connected_apps/clients/{client_id}/secrets/rotate: post: summary: Rotate operationId: api_connectedapps_v1_connected_apps_clients_secrets_Rotate tags: - Clients description: 'Complete the rotation of a Connected App client secret started with the Rotate Secret Start Endpoint. After this endpoint is called, the client''s `next_client_secret` becomes its `client_secret` and the previous `client_secret` will no longer be valid.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_secrets_RotateRequest' parameters: - name: client_id in: path required: true schema: type: string description: The ID of the client. description: The ID of the client. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_connectedapps_v1_connected_apps_clients_secrets_RotateResponse' '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: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate\nconst\ \ stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n client_id: \"${exampleM2MClientID}\",\n};\n\nclient.ConnectedApp.Clients.Secrets.Rotate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate\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/consumer/connectedapps/clients/secrets\"\ \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 := &secrets.RotateParams{\n\t\tClientID:\ \ \"${exampleM2MClientID}\",\n\t}\n\n\tresp, err := client.ConnectedApp.Clients.Secrets.Rotate(context.Background(),\ \ params)\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: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate\npackage\ \ com.example;\n\nimport com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.connectedappsclientssecrets.RotateRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ RotateRequest params = new RotateRequest();\n params.setClientId(\"\ ${exampleM2MClientID}\");\n\n Object result = StytchB2BClient.getConnectedApp().getClients().getSecrets().rotate(params);\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: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate\npackage\ \ com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.connectedappsclientssecrets.RotateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.connectedApp.clients.secrets.rotate(\n\ \ RotateRequest(\n clientId = \"${exampleM2MClientID}\"\ ,\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: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate\nconst\ \ stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n client_id: \"${exampleM2MClientID}\",\n};\n\nclient.connectedApp.clients.secrets.rotate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->connected_app->clients->secrets->rotate([\n\ \ 'client_id' => '${exampleM2MClientID}',\n]);" - lang: python label: Python source: "# POST /v1/connected_apps/clients/{client_id}/secrets/rotate\nfrom\ \ stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.connected_app.clients.secrets.rotate(\n\ \ client_id=\"${exampleM2MClientID}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/connected_apps/clients/{client_id}/secrets/rotate\nrequire\ \ 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.connected_app.clients.secrets.rotate(\n\ \ client_id: \"${exampleM2MClientID}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/connected_apps/clients/{client_id}/secrets/rotate\nuse\ \ stytch::b2b::client::Client;\nuse stytch::consumer::connected_apps_clients_secrets::RotateRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.connected_app.clients.secrets.rotate(\n\ \ RotateRequest{\n client_id: \"${exampleM2MClientID}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/connected_apps/clients/{client_id}/secrets/rotate\ncurl\ \ --request POST \\\n --url https://test.stytch.com/v1/connected_apps/clients/${exampleM2MClientID}/secrets/rotate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /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}\n\ const 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\n\ client.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}\n\ package 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\t\ OrganizationID: \"${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}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.scimconnection.UpdateRequest;\n\ import com.stytch.java.b2b.models.scimconnection.UpdateRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import 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}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ 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}\n\ const 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\n\ client.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}\n\ from 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}\n\ require '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}\n\ use 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}\n\ curl --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}\n\ const 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.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}\n\ package 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\t\ OrganizationID: \"${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}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.scimconnection.DeleteRequest;\n\ import com.stytch.java.b2b.models.scimconnection.DeleteRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import 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}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ 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}\n\ const 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.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}\n\ from 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}\n\ require '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}\n\ use 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}\n\ curl --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}\n\ const 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}\n\ package 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\tConnectionID: \"${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}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.scimconnection.GetGroupsRequest;\n\ import com.stytch.java.b2b.models.scimconnection.GetGroupsRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import 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}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ 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 }\n}\n" - lang: javascript label: Node.js source: "// GET /v1/b2b/scim/{organization_id}/connection/{connection_id}\n\ const 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: php label: PHP source: "$response = $client->scim->connection->get_groups([\n 'organization_id'\ \ => '${organizationId}',\n 'connection_id' => '${scimConnectionId}',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# GET /v1/b2b/scim/{organization_id}/connection/{connection_id}\n\ from stytch import B2BClient\nfrom stytch.b2b.models.scim_connection import\ \ GetGroupsRequestOptions\nfrom stytch.shared.method_options import Authorization\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.scim.connection.get_groups(\n organization_id=\"\ ${organizationId}\",\n connection_id=\"${scimConnectionId}\",\n method_options=GetGroupsRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/scim/{organization_id}/connection/{connection_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.scim.connection.get_groups(\n\ \ organization_id: \"${organizationId}\",\n connection_id: \"${scimConnectionId}\"\ ,\n method_options: StytchB2B::SCIM::Connection::GetGroupsRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/scim/{organization_id}/connection/{connection_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::scim_connection::GetGroupsRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.scim.connection.get_groups(\n \ \ GetGroupsRequest{\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: "# GET /v1/b2b/scim/{organization_id}/connection/{connection_id}\n\ curl --request GET \\\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}\"" /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/start: post: summary: Rotatestart operationId: api_b2b_scim_v1_b2b_scim_connection_RotateStart tags: - B2B Scim description: Start a SCIM token rotation. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_scim_v1_b2b_scim_connection_RotateStartRequest' 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_RotateStartResponse' '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: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/start\n\ const 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.RotateStart(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/start\n\ package 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.RotateStartParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tConnectionID: \"${scimConnectionId}\"\ ,\n\t}\n\n\toptions := &connection.RotateStartParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.SCIM.Connection.RotateStart(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: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/start\n\ package com.example;\n\nimport com.stytch.java.b2b.models.scimconnection.RotateStartRequest;\n\ import com.stytch.java.b2b.models.scimconnection.RotateStartRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n RotateStartRequest params = new\ \ RotateStartRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n params.setConnectionId(\"${scimConnectionId}\");\n\n \ \ RotateStartRequestOptions options = new RotateStartRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getSCIM().getConnection().rotateStart(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: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/start\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.scimconnection.RotateStartRequest\nimport com.stytch.java.b2b.models.scimconnection.RotateStartRequestOptions\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.rotateStart(\n \ \ RotateStartRequest(\n organizationId = \"${organizationId}\"\ ,\n connectionId = \"${scimConnectionId}\",\n \ \ ),\n RotateStartRequestOptions(\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: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/start\n\ const 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.rotateStart(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->scim->connection->rotate_start([\n 'organization_id'\ \ => '${organizationId}',\n 'connection_id' => '${scimConnectionId}',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/start\n\ from stytch import B2BClient\nfrom stytch.b2b.models.scim_connection import\ \ RotateStartRequestOptions\nfrom stytch.shared.method_options import Authorization\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.scim.connection.rotate_start(\n organization_id=\"\ ${organizationId}\",\n connection_id=\"${scimConnectionId}\",\n method_options=RotateStartRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/start\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.scim.connection.rotate_start(\n\ \ organization_id: \"${organizationId}\",\n connection_id: \"${scimConnectionId}\"\ ,\n method_options: StytchB2B::SCIM::Connection::RotateStartRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/start\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::scim_connection::RotateStartRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.scim.connection.rotate_start(\n \ \ RotateStartRequest{\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: "# POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/start\n\ curl --request POST \\\n --url https://test.stytch.com/v1/b2b/scim/${organizationId}/connection/${scimConnectionId}/rotate/start\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/complete: post: summary: Rotatecomplete operationId: api_b2b_scim_v1_b2b_scim_connection_RotateComplete tags: - B2B Scim description: Completes a SCIM token rotation. This will complete the current token rotation process and update the active token to be the new token supplied in the [start SCIM token rotation](https://stytch.com/docs/b2b/api/scim-rotate-token-start) response. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_scim_v1_b2b_scim_connection_RotateCompleteRequest' 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_RotateCompleteResponse' '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: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/complete\n\ const 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.RotateComplete(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/complete\n\ package 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.RotateCompleteParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tConnectionID: \"${scimConnectionId}\"\ ,\n\t}\n\n\toptions := &connection.RotateCompleteParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.SCIM.Connection.RotateComplete(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: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/complete\n\ package com.example;\n\nimport com.stytch.java.b2b.models.scimconnection.RotateCompleteRequest;\n\ import com.stytch.java.b2b.models.scimconnection.RotateCompleteRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n RotateCompleteRequest params\ \ = new RotateCompleteRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n params.setConnectionId(\"${scimConnectionId}\");\n\n \ \ RotateCompleteRequestOptions options = new RotateCompleteRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getSCIM().getConnection().rotateComplete(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: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/complete\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.scimconnection.RotateCompleteRequest\nimport\ \ com.stytch.java.b2b.models.scimconnection.RotateCompleteRequestOptions\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.rotateComplete(\n \ \ RotateCompleteRequest(\n organizationId =\ \ \"${organizationId}\",\n connectionId = \"${scimConnectionId}\"\ ,\n ),\n RotateCompleteRequestOptions(\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: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/complete\n\ const 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.rotateComplete(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->scim->connection->rotate_complete([\n 'organization_id'\ \ => '${organizationId}',\n 'connection_id' => '${scimConnectionId}',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/complete\n\ from stytch import B2BClient\nfrom stytch.b2b.models.scim_connection import\ \ RotateCompleteRequestOptions\nfrom stytch.shared.method_options import\ \ Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.scim.connection.rotate_complete(\n\ \ organization_id=\"${organizationId}\",\n connection_id=\"${scimConnectionId}\"\ ,\n method_options=RotateCompleteRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/complete\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.scim.connection.rotate_complete(\n\ \ organization_id: \"${organizationId}\",\n connection_id: \"${scimConnectionId}\"\ ,\n method_options: StytchB2B::SCIM::Connection::RotateCompleteRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/complete\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::scim_connection::RotateCompleteRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.scim.connection.rotate_complete(\n \ \ RotateCompleteRequest{\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: "# POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/complete\n\ curl --request POST \\\n --url https://test.stytch.com/v1/b2b/scim/${organizationId}/connection/${scimConnectionId}/rotate/complete\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/cancel: post: summary: Rotatecancel operationId: api_b2b_scim_v1_b2b_scim_connection_RotateCancel tags: - B2B Scim description: Cancel a SCIM token rotation. This will cancel the current token rotation process, keeping the original token active. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_scim_v1_b2b_scim_connection_RotateCancelRequest' 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_RotateCancelResponse' '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: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/cancel\n\ const 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.RotateCancel(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/cancel\n\ package 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.RotateCancelParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tConnectionID: \"${scimConnectionId}\"\ ,\n\t}\n\n\toptions := &connection.RotateCancelParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.SCIM.Connection.RotateCancel(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: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/cancel\n\ package com.example;\n\nimport com.stytch.java.b2b.models.scimconnection.RotateCancelRequest;\n\ import com.stytch.java.b2b.models.scimconnection.RotateCancelRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n RotateCancelRequest params =\ \ new RotateCancelRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n params.setConnectionId(\"${scimConnectionId}\");\n\n \ \ RotateCancelRequestOptions options = new RotateCancelRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getSCIM().getConnection().rotateCancel(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: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/cancel\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.scimconnection.RotateCancelRequest\nimport\ \ com.stytch.java.b2b.models.scimconnection.RotateCancelRequestOptions\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.rotateCancel(\n \ \ RotateCancelRequest(\n organizationId = \"\ ${organizationId}\",\n connectionId = \"${scimConnectionId}\"\ ,\n ),\n RotateCancelRequestOptions(\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: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/cancel\n\ const 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.rotateCancel(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->scim->connection->rotate_cancel([\n 'organization_id'\ \ => '${organizationId}',\n 'connection_id' => '${scimConnectionId}',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/cancel\n\ from stytch import B2BClient\nfrom stytch.b2b.models.scim_connection import\ \ RotateCancelRequestOptions\nfrom stytch.shared.method_options import Authorization\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.scim.connection.rotate_cancel(\n organization_id=\"\ ${organizationId}\",\n connection_id=\"${scimConnectionId}\",\n method_options=RotateCancelRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/cancel\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.scim.connection.rotate_cancel(\n\ \ organization_id: \"${organizationId}\",\n connection_id: \"${scimConnectionId}\"\ ,\n method_options: StytchB2B::SCIM::Connection::RotateCancelRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/cancel\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::scim_connection::RotateCancelRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.scim.connection.rotate_cancel(\n \ \ RotateCancelRequest{\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: "# POST /v1/b2b/scim/{organization_id}/connection/{connection_id}/rotate/cancel\n\ curl --request POST \\\n --url https://test.stytch.com/v1/b2b/scim/${organizationId}/connection/${scimConnectionId}/rotate/cancel\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/scim/{organization_id}/connection: post: summary: Create operationId: api_b2b_scim_v1_b2b_scim_connection_Create tags: - B2B Scim description: Create a new SCIM Connection. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_scim_v1_b2b_scim_connection_CreateRequest' 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: 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_CreateResponse' '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: "// POST /v1/b2b/scim/{organization_id}/connection\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 display_name: \"Example SCIM connection\",\n\ };\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.SCIM.Connection.Create(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/scim/{organization_id}/connection\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.CreateParams{\n\t\t\ OrganizationID: \"${organizationId}\",\n\t\tDisplayName: \"Example SCIM\ \ connection\",\n\t}\n\n\toptions := &connection.CreateParamsOptions{\n\t\ \tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.SCIM.Connection.Create(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: "// POST /v1/b2b/scim/{organization_id}/connection\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.scimconnection.CreateRequest;\nimport\ \ com.stytch.java.b2b.models.scimconnection.CreateRequestOptions;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n CreateRequest params = new CreateRequest();\n\ \ params.setOrganizationId(\"${organizationId}\");\n params.setDisplayName(\"\ Example SCIM connection\");\n\n CreateRequestOptions options = new\ \ CreateRequestOptions();\n Authorization authorization = new Authorization();\n\ \ authorization.setSessionToken(\"${sessionToken}\");\n options.setAuthorization(authorization);\n\ \n Object result = StytchB2BClient.getSCIM().getConnection().create(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: "// POST /v1/b2b/scim/{organization_id}/connection\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.scimconnection.CreateRequest\n\ import com.stytch.java.b2b.models.scimconnection.CreateRequestOptions\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.create(\n \ \ CreateRequest(\n organizationId = \"${organizationId}\"\ ,\n displayName = \"Example SCIM connection\",\n \ \ ),\n CreateRequestOptions(\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: "// POST /v1/b2b/scim/{organization_id}/connection\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 display_name: \"Example SCIM connection\",\n\ };\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.scim.connection.create(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->scim->connection->create([\n 'organization_id'\ \ => '${organizationId}',\n 'display_name' => 'Example SCIM connection',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# POST /v1/b2b/scim/{organization_id}/connection\nfrom stytch import\ \ B2BClient\nfrom stytch.b2b.models.scim_connection import CreateRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.scim.connection.create(\n organization_id=\"${organizationId}\"\ ,\n display_name=\"Example SCIM connection\",\n method_options=CreateRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/scim/{organization_id}/connection\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.scim.connection.create(\n organization_id:\ \ \"${organizationId}\",\n display_name: \"Example SCIM connection\",\n\ \ method_options: StytchB2B::SCIM::Connection::CreateRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/scim/{organization_id}/connection\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::scim_connection::CreateRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.scim.connection.create(\n CreateRequest{\n \ \ organization_id: \"${organizationId}\",\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: "# POST /v1/b2b/scim/{organization_id}/connection\ncurl --request\ \ POST \\\n --url https://test.stytch.com/v1/b2b/scim/${organizationId}/connection\ \ \\\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 }'" get: summary: Get operationId: api_b2b_scim_v1_b2b_scim_connection_Get tags: - B2B Scim description: Get 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: 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_GetResponse' '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\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};\n\nconst options = {\n authorization: {\n\ \ session_token: '${sessionToken}',\n },\n};\n\nclient.SCIM.Connection.Get(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\npackage main\n\n\ import (\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.GetParams{\n\t\tOrganizationID:\ \ \"${organizationId}\",\n\t}\n\n\toptions := &connection.GetParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.SCIM.Connection.Get(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\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.scimconnection.GetRequest;\nimport com.stytch.java.b2b.models.scimconnection.GetRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n GetRequest params = new GetRequest();\n\ \ params.setOrganizationId(\"${organizationId}\");\n\n GetRequestOptions\ \ options = new GetRequestOptions();\n Authorization authorization\ \ = new Authorization();\n authorization.setSessionToken(\"${sessionToken}\"\ );\n options.setAuthorization(authorization);\n\n Object result\ \ = StytchB2BClient.getSCIM().getConnection().get(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\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.scimconnection.GetRequest\n\ import com.stytch.java.b2b.models.scimconnection.GetRequestOptions\nimport\ \ 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.get(\n GetRequest(\n\ \ organizationId = \"${organizationId}\",\n \ \ ),\n GetRequestOptions(\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: "// GET /v1/b2b/scim/{organization_id}/connection\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};\n\nconst options = {\n authorization: {\n\ \ session_token: '${sessionToken}',\n },\n};\n\nclient.scim.connection.get(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->scim->connection->get([\n 'organization_id'\ \ => '${organizationId}',\n], [\n 'authorization' => ['session_token'\ \ => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# GET /v1/b2b/scim/{organization_id}/connection\nfrom stytch import\ \ B2BClient\nfrom stytch.b2b.models.scim_connection import GetRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.scim.connection.get(\n organization_id=\"${organizationId}\"\ ,\n method_options=GetRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/scim/{organization_id}/connection\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.scim.connection.get(\n organization_id:\ \ \"${organizationId}\",\n method_options: StytchB2B::SCIM::Connection::GetRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/scim/{organization_id}/connection\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::scim_connection::GetRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.scim.connection.get(\n GetRequest{\n organization_id:\ \ \"${organizationId}\",\n ..Default::default()\n }\n\ \ ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/b2b/scim/{organization_id}/connection\ncurl --request GET\ \ \\\n --url https://test.stytch.com/v1/b2b/scim/${organizationId}/connection\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/organizations: post: summary: Create operationId: api_organization_v1_Create tags: - Organization description: 'Creates an Organization. An `organization_name` and a unique `organization_slug` are required. If no Organization authentication setting parameters are passed in, `email_invites` will default to `ALL_ALLOWED` so that the Organization has a way to add Members. Otherwise, `email_invites` will default to `NOT_ALLOWED`. *See the [Organization authentication settings](https://stytch.com/docs/b2b/api/org-auth-settings) resource to learn more about fields like `email_jit_provisioning`, `email_invites`, `sso_jit_provisioning`, etc., and their behaviors.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_CreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_CreateResponse' '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: "// POST /v1/b2b/organizations\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n organization_name: \"\ ${organizationName}\",\n organization_slug: \"${organizationSlug}\",\n\ \ organization_external_id: \"my-external-id\",\n};\n\nclient.Organizations.Create(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/organizations\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/organizations\"\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 := &organizations.CreateParams{\n\t\ \tOrganizationName: \"${organizationName}\",\n\t\tOrganizationSlug:\ \ \"${organizationSlug}\",\n\t\tOrganizationExternalID: \"my-external-id\"\ ,\n\t}\n\n\tresp, err := client.Organizations.Create(context.Background(),\ \ params)\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: "// POST /v1/b2b/organizations\npackage com.example;\n\nimport com.stytch.java.b2b.models.organizations.CreateRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ CreateRequest params = new CreateRequest();\n params.setOrganizationName(\"\ ${organizationName}\");\n params.setOrganizationSlug(\"${organizationSlug}\"\ );\n params.setOrganizationExternalId(\"my-external-id\");\n\n \ \ Object result = StytchB2BClient.getOrganizations().create(params);\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: "// POST /v1/b2b/organizations\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.b2b.models.organizations.CreateRequest\n\nfun main()\ \ {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.organizations.create(\n \ \ CreateRequest(\n organizationName = \"${organizationName}\"\ ,\n organizationSlug = \"${organizationSlug}\",\n \ \ organizationExternalId = \"my-external-id\",\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: "// POST /v1/b2b/organizations\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n organization_name: \"\ ${organizationName}\",\n organization_slug: \"${organizationSlug}\",\n\ \ organization_external_id: \"my-external-id\",\n};\n\nclient.organizations.create(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->create([\n 'organization_name'\ \ => '${organizationName}',\n 'organization_slug' => '${organizationSlug}',\n\ \ 'organization_external_id' => 'my-external-id',\n]);" - lang: python label: Python source: "# POST /v1/b2b/organizations\nfrom stytch import B2BClient\n\nclient\ \ = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.organizations.create(\n organization_name=\"${organizationName}\"\ ,\n organization_slug=\"${organizationSlug}\",\n organization_external_id=\"\ my-external-id\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/organizations\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.organizations.create(\n\ \ organization_name: \"${organizationName}\",\n organization_slug: \"\ ${organizationSlug}\",\n organization_external_id: \"my-external-id\"\n\ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/organizations\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::organizations::CreateRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.organizations.create(\n CreateRequest{\n organization_name:\ \ \"${organizationName}\",\n organization_slug: Some(String::from(\"\ ${organizationSlug}\")),\n organization_external_id: Some(String::from(\"\ my-external-id\")),\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/organizations\ncurl --request POST \\\n --url https://test.stytch.com/v1/b2b/organizations\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"organization_name\": \"${organizationName}\",\n \ \ \"organization_slug\": \"${organizationSlug}\",\n \"organization_external_id\"\ : \"my-external-id\"\n }'" /v1/b2b/organizations/{organization_id}: get: summary: Get operationId: api_organization_v1_Get tags: - Organization description: Returns an Organization specified by `organization_id`. 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. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_GetResponse' '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/organizations/{organization_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};\n\nclient.Organizations.Get(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/b2b/organizations/{organization_id}\npackage main\n\n\ import (\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/organizations\"\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 := &organizations.GetParams{\n\t\t\ OrganizationID: \"${organizationId}\",\n\t}\n\n\tresp, err := client.Organizations.Get(context.Background(),\ \ params)\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/organizations/{organization_id}\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.organizations.GetRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n GetRequest params = new GetRequest();\n\ \ params.setOrganizationId(\"${organizationId}\");\n\n Object\ \ result = StytchB2BClient.getOrganizations().get(params);\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/organizations/{organization_id}\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.organizations.GetRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.organizations.get(\n GetRequest(\n\ \ organizationId = \"${organizationId}\",\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: "// GET /v1/b2b/organizations/{organization_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};\n\nclient.organizations.get(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->organizations->get([\n 'organization_id'\ \ => '${organizationId}',\n]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/{organization_id}\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.organizations.get(\n organization_id=\"\ ${organizationId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/{organization_id}\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.organizations.get(\n organization_id:\ \ \"${organizationId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/{organization_id}\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::organizations::GetRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.organizations.get(\n GetRequest{\n organization_id:\ \ \"${organizationId}\",\n ..Default::default()\n }\n\ \ ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/{organization_id}\ncurl --request GET\ \ \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" put: summary: Update operationId: api_organization_v1_Update tags: - Organization description: 'Updates an Organization specified by `organization_id`. An Organization must always have at least one auth setting set to either `RESTRICTED` or `ALL_ALLOWED` in order to provision new Members. *See the [Organization authentication settings](https://stytch.com/docs/b2b/api/org-auth-settings) resource to learn more about fields like `email_jit_provisioning`, `email_invites`, `sso_jit_provisioning`, etc., and their behaviors.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_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: 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_organization_v1_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/organizations/{organization_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 organization_name: \"${organizationName}\",\n organization_external_id:\ \ \"my-new-external-id\",\n email_jit_provisioning: \"ALL_ALLOWED\",\n\ };\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.Organizations.Update(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// PUT /v1/b2b/organizations/{organization_id}\npackage main\n\n\ import (\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/organizations\"\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 := &organizations.UpdateParams{\n\t\ \tOrganizationID: \"${organizationId}\",\n\t\tOrganizationName:\ \ \"${organizationName}\",\n\t\tOrganizationExternalID: \"my-new-external-id\"\ ,\n\t\tEmailJITProvisioning: \"ALL_ALLOWED\",\n\t}\n\n\toptions := &organizations.UpdateParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.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/organizations/{organization_id}\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.organizations.UpdateRequest;\nimport\ \ com.stytch.java.b2b.models.organizations.UpdateRequestOptions;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import 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.setOrganizationName(\"\ ${organizationName}\");\n params.setOrganizationExternalId(\"my-new-external-id\"\ );\n params.setEmailJITProvisioning(\"ALL_ALLOWED\");\n\n \ \ UpdateRequestOptions options = new UpdateRequestOptions();\n Authorization\ \ authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().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/organizations/{organization_id}\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.organizations.UpdateRequest\n\ import com.stytch.java.b2b.models.organizations.UpdateRequestOptions\nimport\ \ 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.organizations.update(\n \ \ UpdateRequest(\n organizationId = \"${organizationId}\"\ ,\n organizationName = \"${organizationName}\",\n \ \ organizationExternalId = \"my-new-external-id\",\n \ \ emailJITProvisioning = \"ALL_ALLOWED\",\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/organizations/{organization_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 organization_name: \"${organizationName}\",\n organization_external_id:\ \ \"my-new-external-id\",\n email_jit_provisioning: \"ALL_ALLOWED\",\n\ };\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.organizations.update(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->organizations->update([\n 'organization_id'\ \ => '${organizationId}',\n 'organization_name' => '${organizationName}',\n\ \ 'organization_external_id' => 'my-new-external-id',\n 'email_jit_provisioning'\ \ => 'ALL_ALLOWED',\n], [\n 'authorization' => ['session_token' =>\ \ '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# PUT /v1/b2b/organizations/{organization_id}\nfrom stytch import\ \ B2BClient\nfrom stytch.b2b.models.organizations import UpdateRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.organizations.update(\n organization_id=\"${organizationId}\"\ ,\n organization_name=\"${organizationName}\",\n organization_external_id=\"\ my-new-external-id\",\n email_jit_provisioning=\"ALL_ALLOWED\",\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/organizations/{organization_id}\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.organizations.update(\n organization_id:\ \ \"${organizationId}\",\n organization_name: \"${organizationName}\",\n\ \ organization_external_id: \"my-new-external-id\",\n email_jit_provisioning:\ \ \"ALL_ALLOWED\",\n method_options: StytchB2B::Organizations::UpdateRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// PUT /v1/b2b/organizations/{organization_id}\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::organizations::UpdateRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.organizations.update(\n UpdateRequest{\n organization_id:\ \ \"${organizationId}\",\n organization_name: Some(String::from(\"\ ${organizationName}\")),\n organization_external_id: Some(String::from(\"\ my-new-external-id\")),\n email_jit_provisioning: Some(String::from(\"\ ALL_ALLOWED\")),\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# PUT /v1/b2b/organizations/{organization_id}\ncurl --request PUT\ \ \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"organization_name\": \"${organizationName}\",\n \"organization_external_id\"\ : \"my-new-external-id\",\n \"email_jit_provisioning\": \"ALL_ALLOWED\"\ \n }'" delete: summary: Delete operationId: api_organization_v1_Delete tags: - Organization description: Deletes an Organization specified by `organization_id`. All Members of the Organization will also be deleted. 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: 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_organization_v1_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/organizations/{organization_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};\n\nconst options = {\n authorization: {\n\ \ session_token: '${sessionToken}',\n },\n};\n\nclient.Organizations.Delete(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// DELETE /v1/b2b/organizations/{organization_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/organizations\"\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 := &organizations.DeleteParams{\n\t\ \tOrganizationID: \"${organizationId}\",\n\t}\n\n\toptions := &organizations.DeleteParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.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/organizations/{organization_id}\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.organizations.DeleteRequest;\nimport\ \ com.stytch.java.b2b.models.organizations.DeleteRequestOptions;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import 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\n DeleteRequestOptions\ \ options = new DeleteRequestOptions();\n Authorization authorization\ \ = new Authorization();\n authorization.setSessionToken(\"${sessionToken}\"\ );\n options.setAuthorization(authorization);\n\n Object result\ \ = StytchB2BClient.getOrganizations().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/organizations/{organization_id}\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.organizations.DeleteRequest\n\ import com.stytch.java.b2b.models.organizations.DeleteRequestOptions\nimport\ \ 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.organizations.delete(\n \ \ DeleteRequest(\n organizationId = \"${organizationId}\"\ ,\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/organizations/{organization_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};\n\nconst options = {\n authorization: {\n\ \ session_token: '${sessionToken}',\n },\n};\n\nclient.organizations.delete(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->delete([\n 'organization_id'\ \ => '${organizationId}',\n], [\n 'authorization' => ['session_token'\ \ => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# DELETE /v1/b2b/organizations/{organization_id}\nfrom stytch import\ \ B2BClient\nfrom stytch.b2b.models.organizations import DeleteRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.organizations.delete(\n organization_id=\"${organizationId}\"\ ,\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/organizations/{organization_id}\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.organizations.delete(\n organization_id:\ \ \"${organizationId}\",\n method_options: StytchB2B::Organizations::DeleteRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/b2b/organizations/{organization_id}\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::organizations::DeleteRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.organizations.delete(\n DeleteRequest{\n organization_id:\ \ \"${organizationId}\",\n ..Default::default()\n }\n\ \ ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# DELETE /v1/b2b/organizations/{organization_id}\ncurl --request\ \ DELETE \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/organizations/search: post: summary: Search operationId: api_organization_v1_Search tags: - Organization description: ' **Warning**: This endpoint is not recommended for use in login flows. Scaling issues may occur, as search performance may vary from ~150 milliseconds to 9 seconds depending on query complexity and rate limits are set to 100 requests/minute. Search across your Organizations. Returns an array of Organization objects.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_SearchRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_SearchResponse' '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 /v1/b2b/organizations/{organization_id}/metrics: get: summary: Metrics operationId: api_organization_v1_Metrics tags: - Organization parameters: - name: organization_id in: path required: true schema: type: string responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_MetricsResponse' '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/organizations/{organization_id}/metrics\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n organization_id:\ \ \"TODO_MISSING_EXAMPLE_VALUE\",\n};\n\nclient.Organizations.Metrics(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/b2b/organizations/{organization_id}/metrics\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/organizations\"\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 := &organizations.MetricsParams{\n\ \t\tOrganizationID: \"TODO_MISSING_EXAMPLE_VALUE\",\n\t}\n\n\tresp, err\ \ := client.Organizations.Metrics(context.Background(), params)\n\tif err\ \ != nil {\n\t\tlog.Fatalf(\"error in method call: %v\", err)\n\t}\n\n\t\ log.Println(resp)\n}\n" - lang: java label: Java source: "// GET /v1/b2b/organizations/{organization_id}/metrics\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.organizations.MetricsRequest;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ MetricsRequest params = new MetricsRequest();\n params.setOrganizationId(\"\ TODO_MISSING_EXAMPLE_VALUE\");\n\n Object result = StytchB2BClient.getOrganizations().metrics(params);\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/organizations/{organization_id}/metrics\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.organizations.MetricsRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.organizations.metrics(\n \ \ MetricsRequest(\n organizationId = \"TODO_MISSING_EXAMPLE_VALUE\"\ ,\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: "// GET /v1/b2b/organizations/{organization_id}/metrics\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n organization_id:\ \ \"TODO_MISSING_EXAMPLE_VALUE\",\n};\n\nclient.organizations.metrics(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->metrics([\n 'organization_id'\ \ => 'TODO_MISSING_EXAMPLE_VALUE',\n]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/{organization_id}/metrics\nfrom stytch\ \ import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.metrics(\n\ \ organization_id=\"TODO_MISSING_EXAMPLE_VALUE\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/{organization_id}/metrics\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.organizations.metrics(\n organization_id:\ \ \"TODO_MISSING_EXAMPLE_VALUE\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/{organization_id}/metrics\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::organizations::MetricsRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.organizations.metrics(\n MetricsRequest{\n \ \ organization_id: \"TODO_MISSING_EXAMPLE_VALUE\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/{organization_id}/metrics\ncurl --request\ \ GET \\\n --url https://test.stytch.com/v1/b2b/organizations/TODO_MISSING_EXAMPLE_VALUE/metrics\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/organizations/{organization_id}/connected_apps: get: summary: Connectedapps operationId: api_organization_v1_ConnectedApps tags: - Organization description: 'Retrieves a list of Connected Apps for the Organization that have been installed by Members. Installation comprises successful completion of an authorization flow with a Connected App that has not been revoked. Connected Apps may be uninstalled if an Organization changes its `first_party_connected_apps_allowed_type` or `third_party_connected_apps_allowed_type` policies.' 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: 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_organization_v1_ConnectedAppsResponse' '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/organizations/{organization_id}/connected_apps\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};\n\nconst options =\ \ {\n authorization: {\n session_token: '${sessionToken}',\n },\n};\n\ \nclient.Organizations.ConnectedApps(params, options)\n .then(resp => {\ \ console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/b2b/organizations/{organization_id}/connected_apps\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/organizations\"\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 := &organizations.ConnectedAppsParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t}\n\n\toptions := &organizations.ConnectedAppsParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.ConnectedApps(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/organizations/{organization_id}/connected_apps\npackage\ \ com.example;\n\nimport com.stytch.java.b2b.models.organizations.ConnectedAppsRequest;\n\ import com.stytch.java.b2b.models.organizations.ConnectedAppsRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ConnectedAppsRequest params =\ \ new ConnectedAppsRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n\n ConnectedAppsRequestOptions options = new ConnectedAppsRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().connectedApps(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/organizations/{organization_id}/connected_apps\npackage\ \ com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.organizations.ConnectedAppsRequest\n\ import com.stytch.java.b2b.models.organizations.ConnectedAppsRequestOptions\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.organizations.connectedApps(\n \ \ ConnectedAppsRequest(\n organizationId = \"\ ${organizationId}\",\n ),\n ConnectedAppsRequestOptions(\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: "// GET /v1/b2b/organizations/{organization_id}/connected_apps\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};\n\nconst options =\ \ {\n authorization: {\n session_token: '${sessionToken}',\n },\n};\n\ \nclient.organizations.connectedApps(params, options)\n .then(resp => {\ \ console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->organizations->connected_apps([\n 'organization_id'\ \ => '${organizationId}',\n], [\n 'authorization' => ['session_token'\ \ => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/{organization_id}/connected_apps\nfrom\ \ stytch import B2BClient\nfrom stytch.b2b.models.organizations import ConnectedAppsRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.organizations.connected_apps(\n organization_id=\"${organizationId}\"\ ,\n method_options=ConnectedAppsRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/{organization_id}/connected_apps\nrequire\ \ 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.connected_apps(\n\ \ organization_id: \"${organizationId}\",\n method_options: StytchB2B::Organizations::ConnectedAppsRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/{organization_id}/connected_apps\nuse\ \ stytch::b2b::client::Client;\nuse stytch::b2b::organizations::ConnectedAppsRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.connected_apps(\n \ \ ConnectedAppsRequest{\n organization_id: \"${organizationId}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/{organization_id}/connected_apps\ncurl\ \ --request GET \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/connected_apps\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/organizations/{organization_id}/connected_apps/{connected_app_id}: get: summary: Getconnectedapp operationId: api_organization_v1_GetConnectedApp tags: - Organization description: 'Get Connected App for Organization retrieves information about the specified Connected App as well as a list of the Organization''s Members who have the App installed along with the scopes they requested at completion of their last authorization with the App.' 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: connected_app_id in: path required: true schema: type: string description: The ID of the Connected App. description: The ID of the Connected App. - 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_organization_v1_GetConnectedAppResponse' '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/organizations/{organization_id}/connected_apps/{connected_app_id}\n\ const 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 connected_app_id: \"\ ${exampleConnectedAppClientID}\",\n};\n\nconst options = {\n authorization:\ \ {\n session_token: '${sessionToken}',\n },\n};\n\nclient.Organizations.GetConnectedApp(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/b2b/organizations/{organization_id}/connected_apps/{connected_app_id}\n\ package 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/organizations\"\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 := &organizations.GetConnectedAppParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tConnectedAppID: \"${exampleConnectedAppClientID}\"\ ,\n\t}\n\n\toptions := &organizations.GetConnectedAppParamsOptions{\n\t\t\ Authorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.GetConnectedApp(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/organizations/{organization_id}/connected_apps/{connected_app_id}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizations.GetConnectedAppRequest;\n\ import com.stytch.java.b2b.models.organizations.GetConnectedAppRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n GetConnectedAppRequest params\ \ = new GetConnectedAppRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n params.setConnectedAppId(\"${exampleConnectedAppClientID}\"\ );\n\n GetConnectedAppRequestOptions options = new GetConnectedAppRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().getConnectedApp(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/organizations/{organization_id}/connected_apps/{connected_app_id}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizations.GetConnectedAppRequest\nimport\ \ com.stytch.java.b2b.models.organizations.GetConnectedAppRequestOptions\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.organizations.getConnectedApp(\n \ \ GetConnectedAppRequest(\n organizationId =\ \ \"${organizationId}\",\n connectedAppId = \"${exampleConnectedAppClientID}\"\ ,\n ),\n GetConnectedAppRequestOptions(\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: "// GET /v1/b2b/organizations/{organization_id}/connected_apps/{connected_app_id}\n\ const 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 connected_app_id: \"\ ${exampleConnectedAppClientID}\",\n};\n\nconst options = {\n authorization:\ \ {\n session_token: '${sessionToken}',\n },\n};\n\nclient.organizations.getConnectedApp(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->get_connected_app([\n 'organization_id'\ \ => '${organizationId}',\n 'connected_app_id' => '${exampleConnectedAppClientID}',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/{organization_id}/connected_apps/{connected_app_id}\n\ from stytch import B2BClient\nfrom stytch.b2b.models.organizations import\ \ GetConnectedAppRequestOptions\nfrom stytch.shared.method_options import\ \ Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.get_connected_app(\n\ \ organization_id=\"${organizationId}\",\n connected_app_id=\"${exampleConnectedAppClientID}\"\ ,\n method_options=GetConnectedAppRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/{organization_id}/connected_apps/{connected_app_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.get_connected_app(\n\ \ organization_id: \"${organizationId}\",\n connected_app_id: \"${exampleConnectedAppClientID}\"\ ,\n method_options: StytchB2B::Organizations::GetConnectedAppRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/{organization_id}/connected_apps/{connected_app_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations::GetConnectedAppRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.get_connected_app(\n \ \ GetConnectedAppRequest{\n organization_id: \"${organizationId}\"\ ,\n connected_app_id: \"${exampleConnectedAppClientID}\",\n \ \ ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/{organization_id}/connected_apps/{connected_app_id}\n\ curl --request GET \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/connected_apps/${exampleConnectedAppClientID}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/organizations/{organization_id}/external_id: delete: summary: Deleteexternalid operationId: api_organization_v1_DeleteExternalId tags: - Organization parameters: - name: organization_id in: path required: true schema: type: string - 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_organization_v1_DeleteExternalIdResponse' '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/organizations/{organization_id}/external_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: \"TODO_MISSING_EXAMPLE_VALUE\",\n};\n\nconst options\ \ = {\n authorization: {\n session_token: '${sessionToken}',\n },\n\ };\n\nclient.Organizations.DeleteExternalId(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/b2b/organizations/{organization_id}/external_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/organizations\"\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 := &organizations.DeleteExternalIDParams{\n\ \t\tOrganizationID: \"TODO_MISSING_EXAMPLE_VALUE\",\n\t}\n\n\toptions :=\ \ &organizations.DeleteExternalIDParamsOptions{\n\t\tAuthorization: methodoptions.Authorization{\n\ \t\t\tSessionToken: \"${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err :=\ \ client.Organizations.DeleteExternalID(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/organizations/{organization_id}/external_id\npackage\ \ com.example;\n\nimport com.stytch.java.b2b.models.organizations.DeleteExternalIdRequest;\n\ import com.stytch.java.b2b.models.organizations.DeleteExternalIdRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteExternalIdRequest params\ \ = new DeleteExternalIdRequest();\n params.setOrganizationId(\"\ TODO_MISSING_EXAMPLE_VALUE\");\n\n DeleteExternalIdRequestOptions\ \ options = new DeleteExternalIdRequestOptions();\n Authorization\ \ authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().deleteExternalId(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/organizations/{organization_id}/external_id\npackage\ \ com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.organizations.DeleteExternalIdRequest\n\ import com.stytch.java.b2b.models.organizations.DeleteExternalIdRequestOptions\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.organizations.deleteExternalId(\n \ \ DeleteExternalIdRequest(\n organizationId\ \ = \"TODO_MISSING_EXAMPLE_VALUE\",\n ),\n \ \ DeleteExternalIdRequestOptions(\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/organizations/{organization_id}/external_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: \"TODO_MISSING_EXAMPLE_VALUE\",\n};\n\nconst options\ \ = {\n authorization: {\n session_token: '${sessionToken}',\n },\n\ };\n\nclient.organizations.deleteExternalId(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->organizations->delete_external_id([\n 'organization_id'\ \ => 'TODO_MISSING_EXAMPLE_VALUE',\n], [\n 'authorization' => ['session_token'\ \ => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# DELETE /v1/b2b/organizations/{organization_id}/external_id\nfrom\ \ stytch import B2BClient\nfrom stytch.b2b.models.organizations import DeleteExternalIdRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.organizations.delete_external_id(\n organization_id=\"TODO_MISSING_EXAMPLE_VALUE\"\ ,\n method_options=DeleteExternalIdRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/b2b/organizations/{organization_id}/external_id\nrequire\ \ 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.delete_external_id(\n\ \ organization_id: \"TODO_MISSING_EXAMPLE_VALUE\",\n method_options: StytchB2B::Organizations::DeleteExternalIdRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/b2b/organizations/{organization_id}/external_id\nuse\ \ stytch::b2b::client::Client;\nuse stytch::b2b::organizations::DeleteExternalIdRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.delete_external_id(\n \ \ DeleteExternalIdRequest{\n organization_id: \"TODO_MISSING_EXAMPLE_VALUE\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# DELETE /v1/b2b/organizations/{organization_id}/external_id\ncurl\ \ --request DELETE \\\n --url https://test.stytch.com/v1/b2b/organizations/TODO_MISSING_EXAMPLE_VALUE/external_id\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/organizations/{organization_id}/members/{member_id}: put: summary: Update operationId: api_organization_v1_organizations_members_Update tags: - Organizations description: Updates a Member specified by `organization_id` and `member_id`. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - 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_organization_v1_organizations_members_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/organizations/{organization_id}/members/{member_id}\n\ const 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 member_id: \"${memberId}\"\ ,\n name: \"Jane Doe\",\n external_id: \"my-new-external-id\",\n};\n\n\ const options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.Organizations.Members.Update(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// PUT /v1/b2b/organizations/{organization_id}/members/{member_id}\n\ package 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/organizations/members\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &members.UpdateParams{\n\t\tOrganizationID:\ \ \"${organizationId}\",\n\t\tMemberID: \"${memberId}\",\n\t\tName:\ \ \"Jane Doe\",\n\t\tExternalID: \"my-new-external-id\",\n\ \t}\n\n\toptions := &members.UpdateParamsOptions{\n\t\tAuthorization: methodoptions.Authorization{\n\ \t\t\tSessionToken: \"${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err :=\ \ client.Organizations.Members.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/organizations/{organization_id}/members/{member_id}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.UpdateRequest;\n\ import com.stytch.java.b2b.models.organizationsmembers.UpdateRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import 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.setMemberId(\"\ ${memberId}\");\n params.setName(\"Jane Doe\");\n params.setExternalId(\"\ my-new-external-id\");\n\n UpdateRequestOptions options = new UpdateRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().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/organizations/{organization_id}/members/{member_id}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.UpdateRequest\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.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.organizations.members.update(\n \ \ UpdateRequest(\n organizationId = \"${organizationId}\"\ ,\n memberId = \"${memberId}\",\n \ \ name = \"Jane Doe\",\n externalId = \"my-new-external-id\"\ ,\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/organizations/{organization_id}/members/{member_id}\n\ const 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 member_id: \"${memberId}\"\ ,\n name: \"Jane Doe\",\n external_id: \"my-new-external-id\",\n};\n\n\ const options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.organizations.members.update(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->organizations->members->update([\n 'organization_id'\ \ => '${organizationId}',\n 'member_id' => '${memberId}',\n 'name'\ \ => 'Jane Doe',\n 'external_id' => 'my-new-external-id',\n], [\n \ \ 'authorization' => ['session_token' => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# PUT /v1/b2b/organizations/{organization_id}/members/{member_id}\n\ from stytch import B2BClient\nfrom stytch.b2b.models.organizations_members\ \ import UpdateRequestOptions\nfrom stytch.shared.method_options import\ \ Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.update(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n name=\"Jane Doe\",\n external_id=\"my-new-external-id\",\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/organizations/{organization_id}/members/{member_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.update(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ ,\n name: \"Jane Doe\",\n external_id: \"my-new-external-id\",\n method_options:\ \ StytchB2B::Organizations::Members::UpdateRequestOptions.new(\n authorization:\ \ Stytch::MethodOptions::Authorization.new(session_token: '${sessionToken}')\n\ \ )\n)\n\nputs resp" - lang: rust label: Rust source: "// PUT /v1/b2b/organizations/{organization_id}/members/{member_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members::UpdateRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.update(\n \ \ UpdateRequest{\n organization_id: \"${organizationId}\",\n\ \ member_id: \"${memberId}\",\n name: Some(String::from(\"\ Jane Doe\")),\n external_id: Some(String::from(\"my-new-external-id\"\ )),\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# PUT /v1/b2b/organizations/{organization_id}/members/{member_id}\n\ curl --request PUT \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"name\": \"Jane Doe\",\n \"external_id\": \"my-new-external-id\"\n\ \ }'" delete: summary: Delete operationId: api_organization_v1_organizations_members_Delete tags: - Organizations description: Deletes a Member specified by `organization_id` and `member_id`. 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - 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_organization_v1_organizations_members_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/organizations/{organization_id}/members/{member_id}\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.Organizations.Members.Delete(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}\n\ package 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/organizations/members\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &members.DeleteParams{\n\t\tOrganizationID:\ \ \"${organizationId}\",\n\t\tMemberID: \"${memberId}\",\n\t}\n\n\t\ options := &members.DeleteParamsOptions{\n\t\tAuthorization: methodoptions.Authorization{\n\ \t\t\tSessionToken: \"${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err :=\ \ client.Organizations.Members.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/organizations/{organization_id}/members/{member_id}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.DeleteRequest;\n\ import com.stytch.java.b2b.models.organizationsmembers.DeleteRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import 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.setMemberId(\"\ ${memberId}\");\n\n DeleteRequestOptions options = new DeleteRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().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/organizations/{organization_id}/members/{member_id}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.DeleteRequest\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.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.organizations.members.delete(\n \ \ DeleteRequest(\n organizationId = \"${organizationId}\"\ ,\n memberId = \"${memberId}\",\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/organizations/{organization_id}/members/{member_id}\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.organizations.members.delete(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->organizations->members->delete([\n 'organization_id'\ \ => '${organizationId}',\n 'member_id' => '${memberId}',\n], [\n \ \ 'authorization' => ['session_token' => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}\n\ from stytch import B2BClient\nfrom stytch.b2b.models.organizations_members\ \ import DeleteRequestOptions\nfrom stytch.shared.method_options import\ \ Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.delete(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\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/organizations/{organization_id}/members/{member_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.delete(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ ,\n method_options: StytchB2B::Organizations::Members::DeleteRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members::DeleteRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.delete(\n \ \ DeleteRequest{\n organization_id: \"${organizationId}\",\n\ \ member_id: \"${memberId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}\n\ curl --request DELETE \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/organizations/{organization_id}/members/{member_id}/reactivate: put: summary: Reactivate operationId: api_organization_v1_organizations_members_Reactivate tags: - Organizations description: 'Reactivates a deleted Member''s status and its associated email status (if applicable) to active, specified by `organization_id` and `member_id`. This endpoint will only work for Members with at least one verified email where their `email_address_verified` is `true`. Note that this endpoint does not accept an `external_id`. The Stytch `member_id` must be provided.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_ReactivateRequest' 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. - 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_organization_v1_organizations_members_ReactivateResponse' '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/organizations/{organization_id}/members/{member_id}/reactivate\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.Organizations.Members.Reactivate(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// PUT /v1/b2b/organizations/{organization_id}/members/{member_id}/reactivate\n\ package 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/organizations/members\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &members.ReactivateParams{\n\t\t\ OrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t}\n\n\toptions := &members.ReactivateParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.Members.Reactivate(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/organizations/{organization_id}/members/{member_id}/reactivate\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.ReactivateRequest;\n\ import com.stytch.java.b2b.models.organizationsmembers.ReactivateRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ReactivateRequest params = new\ \ ReactivateRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n params.setMemberId(\"${memberId}\");\n\n ReactivateRequestOptions\ \ options = new ReactivateRequestOptions();\n Authorization authorization\ \ = new Authorization();\n authorization.setSessionToken(\"${sessionToken}\"\ );\n options.setAuthorization(authorization);\n\n Object result\ \ = StytchB2BClient.getOrganizations().getMembers().reactivate(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/organizations/{organization_id}/members/{member_id}/reactivate\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.ReactivateRequest\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.ReactivateRequestOptions\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.organizations.members.reactivate(\n \ \ ReactivateRequest(\n organizationId = \"\ ${organizationId}\",\n memberId = \"${memberId}\",\n\ \ ),\n ReactivateRequestOptions(\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/organizations/{organization_id}/members/{member_id}/reactivate\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.organizations.members.reactivate(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->reactivate([\n 'organization_id'\ \ => '${organizationId}',\n 'member_id' => '${memberId}',\n], [\n \ \ 'authorization' => ['session_token' => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# PUT /v1/b2b/organizations/{organization_id}/members/{member_id}/reactivate\n\ from stytch import B2BClient\nfrom stytch.b2b.models.organizations_members\ \ import ReactivateRequestOptions\nfrom stytch.shared.method_options import\ \ Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.reactivate(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n method_options=ReactivateRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# PUT /v1/b2b/organizations/{organization_id}/members/{member_id}/reactivate\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.reactivate(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ ,\n method_options: StytchB2B::Organizations::Members::ReactivateRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// PUT /v1/b2b/organizations/{organization_id}/members/{member_id}/reactivate\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members::ReactivateRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.reactivate(\n \ \ ReactivateRequest{\n organization_id: \"${organizationId}\"\ ,\n member_id: \"${memberId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# PUT /v1/b2b/organizations/{organization_id}/members/{member_id}/reactivate\n\ curl --request PUT \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}/reactivate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/organizations/{organization_id}/members/mfa_phone_numbers/{member_id}: delete: summary: Deletemfaphonenumber operationId: api_organization_v1_organizations_members_DeleteMFAPhoneNumber tags: - Organizations description: "Delete a Member's MFA phone number. \n\nTo change a Member's phone\ \ number, you must first call this endpoint to delete the existing phone number.\n\ \nExisting Member Sessions that include a phone number authentication factor\ \ will not be revoked if the phone number is deleted, and MFA will not be\ \ enforced until the Member logs in again.\nIf you wish to enforce MFA immediately\ \ after a phone number is deleted, you can do so by prompting the Member to\ \ enter a new phone number\nand calling the [OTP SMS send](https://stytch.com/docs/b2b/api/otp-sms-send)\ \ endpoint, then calling the [OTP SMS Authenticate](https://stytch.com/docs/b2b/api/authenticate-otp-sms)\ \ endpoint." 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - 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_organization_v1_organizations_members_DeleteMFAPhoneNumberResponse' '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/organizations/{organization_id}/members/mfa_phone_numbers/{member_id}\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.Organizations.Members.DeleteMFAPhoneNumber(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// DELETE /v1/b2b/organizations/{organization_id}/members/mfa_phone_numbers/{member_id}\n\ package 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/organizations/members\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &members.DeleteMFAPhoneNumberParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t}\n\n\toptions := &members.DeleteMFAPhoneNumberParamsOptions{\n\t\t\ Authorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.Members.DeleteMFAPhoneNumber(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/organizations/{organization_id}/members/mfa_phone_numbers/{member_id}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.DeleteMFAPhoneNumberRequest;\n\ import com.stytch.java.b2b.models.organizationsmembers.DeleteMFAPhoneNumberRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteMFAPhoneNumberRequest params\ \ = new DeleteMFAPhoneNumberRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setMemberId(\"${memberId}\");\n\n\ \ DeleteMFAPhoneNumberRequestOptions options = new DeleteMFAPhoneNumberRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().deleteMFAPhoneNumber(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/organizations/{organization_id}/members/mfa_phone_numbers/{member_id}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.DeleteMFAPhoneNumberRequest\n\ import com.stytch.java.b2b.models.organizationsmembers.DeleteMFAPhoneNumberRequestOptions\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.organizations.members.deleteMFAPhoneNumber(\n\ \ DeleteMFAPhoneNumberRequest(\n organizationId\ \ = \"${organizationId}\",\n memberId = \"${memberId}\"\ ,\n ),\n DeleteMFAPhoneNumberRequestOptions(\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/organizations/{organization_id}/members/mfa_phone_numbers/{member_id}\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.organizations.members.deleteMFAPhoneNumber(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->delete_mfa_phone_number([\n\ \ 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# DELETE /v1/b2b/organizations/{organization_id}/members/mfa_phone_numbers/{member_id}\n\ from stytch import B2BClient\nfrom stytch.b2b.models.organizations_members\ \ import DeleteMFAPhoneNumberRequestOptions\nfrom stytch.shared.method_options\ \ import Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.delete_mfa_phone_number(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n method_options=DeleteMFAPhoneNumberRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/b2b/organizations/{organization_id}/members/mfa_phone_numbers/{member_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.delete_mfa_phone_number(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ ,\n method_options: StytchB2B::Organizations::Members::DeleteMFAPhoneNumberRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/b2b/organizations/{organization_id}/members/mfa_phone_numbers/{member_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members::DeleteMFAPhoneNumberRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.delete_mfa_phone_number(\n\ \ DeleteMFAPhoneNumberRequest{\n organization_id: \"${organizationId}\"\ ,\n member_id: \"${memberId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# DELETE /v1/b2b/organizations/{organization_id}/members/mfa_phone_numbers/{member_id}\n\ curl --request DELETE \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/mfa_phone_numbers/${memberId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/organizations/{organization_id}/members/{member_id}/totp: delete: summary: Deletetotp operationId: api_organization_v1_organizations_members_DeleteTOTP tags: - Organizations description: 'Delete a Member''s MFA TOTP registration. To mint a new registration for a Member, you must first call this endpoint to delete the existing registration. Existing Member Sessions that include the TOTP authentication factor will not be revoked if the registration is deleted, and MFA will not be enforced until the Member logs in again.' 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - 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_organization_v1_organizations_members_DeleteTOTPResponse' '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/organizations/{organization_id}/members/{member_id}/totp\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.Organizations.Members.DeleteTOTP(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}/totp\n\ package 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/organizations/members\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &members.DeleteTOTPParams{\n\t\t\ OrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t}\n\n\toptions := &members.DeleteTOTPParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.Members.DeleteTOTP(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/organizations/{organization_id}/members/{member_id}/totp\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.DeleteTOTPRequest;\n\ import com.stytch.java.b2b.models.organizationsmembers.DeleteTOTPRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteTOTPRequest params = new\ \ DeleteTOTPRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n params.setMemberId(\"${memberId}\");\n\n DeleteTOTPRequestOptions\ \ options = new DeleteTOTPRequestOptions();\n Authorization authorization\ \ = new Authorization();\n authorization.setSessionToken(\"${sessionToken}\"\ );\n options.setAuthorization(authorization);\n\n Object result\ \ = StytchB2BClient.getOrganizations().getMembers().deleteTOTP(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/organizations/{organization_id}/members/{member_id}/totp\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.DeleteTOTPRequest\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.DeleteTOTPRequestOptions\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.organizations.members.deleteTOTP(\n \ \ DeleteTOTPRequest(\n organizationId = \"\ ${organizationId}\",\n memberId = \"${memberId}\",\n\ \ ),\n DeleteTOTPRequestOptions(\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/organizations/{organization_id}/members/{member_id}/totp\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.organizations.members.deleteTOTP(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->delete_totp([\n 'organization_id'\ \ => '${organizationId}',\n 'member_id' => '${memberId}',\n], [\n \ \ 'authorization' => ['session_token' => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}/totp\n\ from stytch import B2BClient\nfrom stytch.b2b.models.organizations_members\ \ import DeleteTOTPRequestOptions\nfrom stytch.shared.method_options import\ \ Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.delete_totp(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n method_options=DeleteTOTPRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}/totp\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.delete_totp(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ ,\n method_options: StytchB2B::Organizations::Members::DeleteTOTPRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}/totp\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members::DeleteTOTPRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.delete_totp(\n\ \ DeleteTOTPRequest{\n organization_id: \"${organizationId}\"\ ,\n member_id: \"${memberId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}/totp\n\ curl --request DELETE \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}/totp\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/organizations/members/search: post: summary: Search operationId: api_organization_v1_organizations_members_Search tags: - Organizations description: ' **Warning**: This endpoint is not recommended for use in login flows. Scaling issues may occur, as search performance may vary from ~150 milliseconds to 9 seconds depending on query complexity and rate limits are set to 100 requests/minute. Search for Members within specified Organizations. An array with at least one `organization_id` is required. Submitting an empty `query` returns all non-deleted Members within the specified Organizations. All fuzzy search filters require a minimum of three characters.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_SearchRequest' parameters: - 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_organization_v1_organizations_members_SearchResponse' '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: "// POST /v1/b2b/organizations/members/search\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n organization_ids: [\"\ ${organizationId}\"],\n};\n\nconst options = {\n authorization: {\n \ \ session_token: '${sessionToken}',\n },\n};\n\nclient.Organizations.Members.Search(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/organizations/members/search\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/organizations/members\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &members.SearchParams{\n\t\tOrganizationIds:\ \ []string{\"${organizationId}\"},\n\t}\n\n\toptions := &members.SearchParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.Members.Search(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: "// POST /v1/b2b/organizations/members/search\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.organizationsmembers.SearchRequest;\n\ import com.stytch.java.b2b.models.organizationsmembers.SearchRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n SearchRequest params = new SearchRequest();\n\ \ params.setOrganizationIds(new String(\"${organizationId}\"));\n\ \n SearchRequestOptions options = new SearchRequestOptions();\n \ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().search(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: "// POST /v1/b2b/organizations/members/search\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.organizationsmembers.SearchRequest\n\ import com.stytch.java.b2b.models.organizationsmembers.SearchRequestOptions\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.organizations.members.search(\n \ \ SearchRequest(\n organizationIds = arrayOf(\"\ ${organizationId}\"),\n ),\n SearchRequestOptions(\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: "// POST /v1/b2b/organizations/members/search\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n organization_ids: [\"\ ${organizationId}\"],\n};\n\nconst options = {\n authorization: {\n \ \ session_token: '${sessionToken}',\n },\n};\n\nclient.organizations.members.search(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->search([\n 'organization_ids'\ \ => ['${organizationId}'],\n], [\n 'authorization' => ['session_token'\ \ => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# POST /v1/b2b/organizations/members/search\nfrom stytch import B2BClient\n\ from stytch.b2b.models.organizations_members import SearchRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.organizations.members.search(\n organization_ids=[\"${organizationId}\"\ ],\n method_options=SearchRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/organizations/members/search\nrequire 'stytch'\n\n\ client = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.organizations.members.search(\n organization_ids:\ \ ['${organizationId}'],\n method_options: StytchB2B::Organizations::Members::SearchRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/organizations/members/search\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::organizations_members::SearchRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.organizations.members.search(\n SearchRequest{\n\ \ organization_ids: vec![\"${organizationId}\"],\n \ \ ..Default::default()\n }\n ).await;\n println!(\"The response\ \ is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/organizations/members/search\ncurl --request POST\ \ \\\n --url https://test.stytch.com/v1/b2b/organizations/members/search\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"organization_ids\": [\"${organizationId}\"]\n }'" /v1/b2b/organizations/{organization_id}/members/passwords/{member_password_id}: delete: summary: Deletepassword operationId: api_organization_v1_organizations_members_DeletePassword tags: - Organizations description: "Delete a Member's password. \n\nThis endpoint only works for Organization-scoped\ \ passwords. For cross-org password Projects, use [Require Password Reset\ \ By Email](https://stytch.com/docs/b2b/api/passwords-require-reset-by-email)\ \ instead." 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: member_password_id in: path required: true schema: type: string description: Globally unique UUID that identifies a Member's password. description: Globally unique UUID that identifies a Member's password. - 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_organization_v1_organizations_members_DeletePasswordResponse' '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/organizations/{organization_id}/members/passwords/{member_password_id}\n\ const 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 member_password_id:\ \ \"${exampleMemberPasswordId}\",\n};\n\nconst options = {\n authorization:\ \ {\n session_token: '${sessionToken}',\n },\n};\n\nclient.Organizations.Members.DeletePassword(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// DELETE /v1/b2b/organizations/{organization_id}/members/passwords/{member_password_id}\n\ package 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/organizations/members\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &members.DeletePasswordParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tMemberPasswordID: \"${exampleMemberPasswordId}\"\ ,\n\t}\n\n\toptions := &members.DeletePasswordParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.Members.DeletePassword(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/organizations/{organization_id}/members/passwords/{member_password_id}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.DeletePasswordRequest;\n\ import com.stytch.java.b2b.models.organizationsmembers.DeletePasswordRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeletePasswordRequest params\ \ = new DeletePasswordRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n params.setMemberPasswordId(\"${exampleMemberPasswordId}\");\n\ \n DeletePasswordRequestOptions options = new DeletePasswordRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().deletePassword(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/organizations/{organization_id}/members/passwords/{member_password_id}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.DeletePasswordRequest\n\ import com.stytch.java.b2b.models.organizationsmembers.DeletePasswordRequestOptions\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.organizations.members.deletePassword(\n\ \ DeletePasswordRequest(\n organizationId\ \ = \"${organizationId}\",\n memberPasswordId = \"${exampleMemberPasswordId}\"\ ,\n ),\n DeletePasswordRequestOptions(\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/organizations/{organization_id}/members/passwords/{member_password_id}\n\ const 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 member_password_id:\ \ \"${exampleMemberPasswordId}\",\n};\n\nconst options = {\n authorization:\ \ {\n session_token: '${sessionToken}',\n },\n};\n\nclient.organizations.members.deletePassword(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->delete_password([\n\ \ 'organization_id' => '${organizationId}',\n 'member_password_id'\ \ => '${exampleMemberPasswordId}',\n], [\n 'authorization' => ['session_token'\ \ => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# DELETE /v1/b2b/organizations/{organization_id}/members/passwords/{member_password_id}\n\ from stytch import B2BClient\nfrom stytch.b2b.models.organizations_members\ \ import DeletePasswordRequestOptions\nfrom stytch.shared.method_options\ \ import Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.delete_password(\n\ \ organization_id=\"${organizationId}\",\n member_password_id=\"${exampleMemberPasswordId}\"\ ,\n method_options=DeletePasswordRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/b2b/organizations/{organization_id}/members/passwords/{member_password_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.delete_password(\n\ \ organization_id: \"${organizationId}\",\n member_password_id: \"${exampleMemberPasswordId}\"\ ,\n method_options: StytchB2B::Organizations::Members::DeletePasswordRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/b2b/organizations/{organization_id}/members/passwords/{member_password_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members::DeletePasswordRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.delete_password(\n\ \ DeletePasswordRequest{\n organization_id: \"${organizationId}\"\ ,\n member_password_id: \"${exampleMemberPasswordId}\",\n \ \ ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# DELETE /v1/b2b/organizations/{organization_id}/members/passwords/{member_password_id}\n\ curl --request DELETE \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/passwords/${exampleMemberPasswordId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/organizations/members/dangerously_get/{member_id}: get: summary: Dangerouslyget operationId: api_organization_v1_organizations_members_DangerouslyGet tags: - Organizations description: Get a Member by `member_id`. This endpoint does not require an `organization_id`, enabling you to get members across organizations. This is a dangerous operation. Incorrect use may open you up to indirect object reference (IDOR) attacks. We recommend using the [Get Member](https://stytch.com/docs/b2b/api/get-member) API instead. parameters: - name: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. - name: include_deleted in: query required: false schema: type: boolean description: Whether to include deleted Members in the response. Defaults to false. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_GetResponse' '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/organizations/members/dangerously_get/{member_id}\n\ const stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n member_id: \"${memberId}\",\n};\n\nclient.Organizations.Members.DangerouslyGet(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/b2b/organizations/members/dangerously_get/{member_id}\n\ package 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/organizations/members\"\ \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 := &members.DangerouslyGetParams{\n\ \t\tMemberID: \"${memberId}\",\n\t}\n\n\tresp, err := client.Organizations.Members.DangerouslyGet(context.Background(),\ \ params)\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/organizations/members/dangerously_get/{member_id}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.DangerouslyGetRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ DangerouslyGetRequest params = new DangerouslyGetRequest();\n \ \ params.setMemberId(\"${memberId}\");\n\n Object result = StytchB2BClient.getOrganizations().getMembers().dangerouslyGet(params);\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/organizations/members/dangerously_get/{member_id}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.DangerouslyGetRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.organizations.members.dangerouslyGet(\n\ \ DangerouslyGetRequest(\n memberId =\ \ \"${memberId}\",\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: "// GET /v1/b2b/organizations/members/dangerously_get/{member_id}\n\ const stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n member_id: \"${memberId}\",\n};\n\nclient.organizations.members.dangerouslyGet(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->dangerously_get([\n\ \ 'member_id' => '${memberId}',\n]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/members/dangerously_get/{member_id}\n\ from stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.dangerously_get(\n\ \ member_id=\"${memberId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/members/dangerously_get/{member_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.dangerously_get(\n\ \ member_id: \"${memberId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/members/dangerously_get/{member_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members::DangerouslyGetRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.dangerously_get(\n\ \ DangerouslyGetRequest{\n member_id: \"${memberId}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/members/dangerously_get/{member_id}\n\ curl --request GET \\\n --url https://test.stytch.com/v1/b2b/organizations/members/dangerously_get/${memberId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/organizations/{organization_id}/members/{member_id}/oidc_providers: get: summary: Oidcproviders operationId: api_organization_v1_organizations_members_OIDCProviders tags: - Organizations description: "Retrieve the saved OIDC access tokens and ID tokens for a member.\ \ After a successful OIDC login, Stytch will save the \nissued access token\ \ and ID token from the identity provider. If a refresh token has been issued,\ \ Stytch will refresh the \naccess token automatically." 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - name: include_refresh_token in: query required: false schema: type: boolean description: Whether to return the refresh token Stytch has stored for the OAuth Provider. Defaults to false. **Important:** If your application exchanges the refresh token, Stytch may not be able to automatically refresh access tokens in the future. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_OIDCProvidersResponse' '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/organizations/{organization_id}/members/{member_id}/oidc_providers\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nclient.Organizations.Members.OIDCProviders(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oidc_providers\n\ package 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/organizations/members\"\ \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 := &members.OIDCProviderInformationParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t}\n\n\tresp, err := client.Organizations.Members.OIDCProviders(context.Background(),\ \ params)\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/organizations/{organization_id}/members/{member_id}/oidc_providers\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.OIDCProviderInformationRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ OIDCProviderInformationRequest params = new OIDCProviderInformationRequest();\n\ \ params.setOrganizationId(\"${organizationId}\");\n params.setMemberId(\"\ ${memberId}\");\n\n Object result = StytchB2BClient.getOrganizations().getMembers().oidcProviders(params);\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/organizations/{organization_id}/members/{member_id}/oidc_providers\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.OIDCProviderInformationRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.organizations.members.oidcProviders(\n\ \ OIDCProviderInformationRequest(\n organizationId\ \ = \"${organizationId}\",\n memberId = \"${memberId}\"\ ,\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: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oidc_providers\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nclient.organizations.members.oidcProviders(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->organizations->members->oidc_providers([\n \ \ 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n\ ]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oidc_providers\n\ from stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.oidc_providers(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oidc_providers\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.oidc_providers(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oidc_providers\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members::OIDCProviderInformationRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.oidc_providers(\n\ \ OIDCProviderInformationRequest{\n organization_id: \"\ ${organizationId}\",\n member_id: \"${memberId}\",\n \ \ ..Default::default()\n }\n ).await;\n println!(\"The response\ \ is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oidc_providers\n\ curl --request GET \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}/oidc_providers\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/organizations/{organization_id}/members/{member_id}/unlink_retired_email: post: summary: Unlinkretiredemail operationId: api_organization_v1_organizations_members_UnlinkRetiredEmail tags: - Organizations description: "Unlinks a retired email address from a Member specified by their\ \ `organization_id` and `member_id`. The email address\nto be retired can\ \ be identified in the request body by either its `email_id`, its `email_address`,\ \ or both. If using\nboth identifiers they must refer to the same email.\n\ \nA previously active email address can be marked as retired in one of two\ \ ways:\n\n- It's replaced with a new primary email address during an explicit\ \ Member update.\n- A new email address is surfaced by an OAuth, SAML or OIDC\ \ provider. In this case the new email address becomes the\n Member's primary\ \ email address and the old primary email address is retired.\n\nA retired\ \ email address cannot be used by other Members in the same Organization.\ \ However, unlinking retired email\naddresses allows them to be subsequently\ \ re-used by other Organization Members. Retired email addresses can be viewed\n\ on the [Member object](https://stytch.com/docs/b2b/api/member-object)." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_UnlinkRetiredEmailRequest' 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - 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_organization_v1_organizations_members_UnlinkRetiredEmailResponse' '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: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/unlink_retired_email\n\ const 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 member_id: \"${memberId}\"\ ,\n email_id: \"${emailId}\",\n email_address: \"${email}\",\n};\n\nconst\ \ options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.Organizations.Members.UnlinkRetiredEmail(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/unlink_retired_email\n\ package 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/organizations/members\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &members.UnlinkRetiredEmailParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t\tEmailID: \"${emailId}\",\n\t\tEmailAddress: \"${email}\"\ ,\n\t}\n\n\toptions := &members.UnlinkRetiredEmailParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.Members.UnlinkRetiredEmail(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: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/unlink_retired_email\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.UnlinkRetiredEmailRequest;\n\ import com.stytch.java.b2b.models.organizationsmembers.UnlinkRetiredEmailRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n UnlinkRetiredEmailRequest params\ \ = new UnlinkRetiredEmailRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setMemberId(\"${memberId}\");\n \ \ params.setEmailId(\"${emailId}\");\n params.setEmailAddress(\"\ ${email}\");\n\n UnlinkRetiredEmailRequestOptions options = new UnlinkRetiredEmailRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().unlinkRetiredEmail(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: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/unlink_retired_email\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.UnlinkRetiredEmailRequest\n\ import com.stytch.java.b2b.models.organizationsmembers.UnlinkRetiredEmailRequestOptions\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.organizations.members.unlinkRetiredEmail(\n\ \ UnlinkRetiredEmailRequest(\n organizationId\ \ = \"${organizationId}\",\n memberId = \"${memberId}\"\ ,\n emailId = \"${emailId}\",\n emailAddress\ \ = \"${email}\",\n ),\n UnlinkRetiredEmailRequestOptions(\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: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/unlink_retired_email\n\ const 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 member_id: \"${memberId}\"\ ,\n email_id: \"${emailId}\",\n email_address: \"${email}\",\n};\n\nconst\ \ options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.organizations.members.unlinkRetiredEmail(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->unlink_retired_email([\n\ \ 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n\ \ 'email_id' => '${emailId}',\n 'email_address' => '${email}',\n],\ \ [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# POST /v1/b2b/organizations/{organization_id}/members/{member_id}/unlink_retired_email\n\ from stytch import B2BClient\nfrom stytch.b2b.models.organizations_members\ \ import UnlinkRetiredEmailRequestOptions\nfrom stytch.shared.method_options\ \ import Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.unlink_retired_email(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n email_id=\"${emailId}\",\n email_address=\"${email}\",\n method_options=UnlinkRetiredEmailRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/organizations/{organization_id}/members/{member_id}/unlink_retired_email\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.unlink_retired_email(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ ,\n email_id: \"${emailId}\",\n email_address: \"${email}\",\n method_options:\ \ StytchB2B::Organizations::Members::UnlinkRetiredEmailRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/unlink_retired_email\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members::UnlinkRetiredEmailRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.unlink_retired_email(\n\ \ UnlinkRetiredEmailRequest{\n organization_id: \"${organizationId}\"\ ,\n member_id: \"${memberId}\",\n email_id: Some(String::from(\"\ ${emailId}\")),\n email_address: Some(String::from(\"${email}\"\ )),\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/organizations/{organization_id}/members/{member_id}/unlink_retired_email\n\ curl --request POST \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}/unlink_retired_email\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"email_id\": \"${emailId}\",\n \"email_address\": \"${email}\"\n\ \ }'" /v1/b2b/organizations/{organization_id}/members/{member_id}/start_email_update: post: summary: Startemailupdate operationId: api_organization_v1_organizations_members_StartEmailUpdate tags: - Organizations description: 'Starts a self-serve email update for a Member specified by their `organization_id` and `member_id`. To perform a self-serve update, members must be active and have an active, verified email address. The new email address must meet the following requirements: - Must not be in use by another member (retired emails count as used until they are [unlinked](https://stytch.com/docs/b2b/api/unlink-retired-member-email)) - Must not be updating for another member (i.e. two members cannot attempt to update to the same email at once) The member will receive an Email Magic Link (or Email OTP Code, if `EMAIL_OTP` is specified as the delivery method) that expires in 5 minutes. If they do not verify their new email address in that timeframe, the email will be freed up for other members to use. If using Email Magic Links, the magic link will redirect to your `login_redirect_url` (or the configured default if one isn''t provided), and you should invoke the [Authenticate Magic Link](https://stytch.com/docs/b2b/api/authenticate-magic-link) endpoint as normal to complete the flow. If using Email OTP Codes, you should invoke the [Authenticate Email OTP Code](https://stytch.com/docs/b2b/api/authenticate-email-otp) endpoint as normal to complete the flow. Make sure to pass the new email address to the endpoint.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_StartEmailUpdateRequest' 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - 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_organization_v1_organizations_members_StartEmailUpdateResponse' '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: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/start_email_update\n\ const 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 member_id: \"${memberId}\"\ ,\n email_address: \"${email}\",\n};\n\nconst options = {\n authorization:\ \ {\n session_token: '${sessionToken}',\n },\n};\n\nclient.Organizations.Members.StartEmailUpdate(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/start_email_update\n\ package 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/organizations/members\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &members.StartEmailUpdateParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t\tEmailAddress: \"${email}\",\n\t}\n\n\toptions := &members.StartEmailUpdateParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.Members.StartEmailUpdate(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: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/start_email_update\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.StartEmailUpdateRequest;\n\ import com.stytch.java.b2b.models.organizationsmembers.StartEmailUpdateRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n StartEmailUpdateRequest params\ \ = new StartEmailUpdateRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setMemberId(\"${memberId}\");\n \ \ params.setEmailAddress(\"${email}\");\n\n StartEmailUpdateRequestOptions\ \ options = new StartEmailUpdateRequestOptions();\n Authorization\ \ authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().startEmailUpdate(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: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/start_email_update\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.StartEmailUpdateRequest\n\ import com.stytch.java.b2b.models.organizationsmembers.StartEmailUpdateRequestOptions\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.organizations.members.startEmailUpdate(\n\ \ StartEmailUpdateRequest(\n organizationId\ \ = \"${organizationId}\",\n memberId = \"${memberId}\"\ ,\n emailAddress = \"${email}\",\n ),\n\ \ StartEmailUpdateRequestOptions(\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: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/start_email_update\n\ const 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 member_id: \"${memberId}\"\ ,\n email_address: \"${email}\",\n};\n\nconst options = {\n authorization:\ \ {\n session_token: '${sessionToken}',\n },\n};\n\nclient.organizations.members.startEmailUpdate(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->start_email_update([\n\ \ 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n\ \ 'email_address' => '${email}',\n], [\n 'authorization' => ['session_token'\ \ => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# POST /v1/b2b/organizations/{organization_id}/members/{member_id}/start_email_update\n\ from stytch import B2BClient\nfrom stytch.b2b.models.organizations_members\ \ import StartEmailUpdateRequestOptions\nfrom stytch.shared.method_options\ \ import Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.start_email_update(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n email_address=\"${email}\",\n method_options=StartEmailUpdateRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/organizations/{organization_id}/members/{member_id}/start_email_update\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.start_email_update(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ ,\n email_address: \"${email}\",\n method_options: StytchB2B::Organizations::Members::StartEmailUpdateRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/start_email_update\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members::StartEmailUpdateRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.start_email_update(\n\ \ StartEmailUpdateRequest{\n organization_id: \"${organizationId}\"\ ,\n member_id: \"${memberId}\",\n email_address: \"\ ${email}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/organizations/{organization_id}/members/{member_id}/start_email_update\n\ curl --request POST \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}/start_email_update\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"email_address\": \"${email}\"\n }'" /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps: get: summary: Getconnectedapps operationId: api_organization_v1_organizations_members_GetConnectedApps tags: - Organizations description: 'Member Get Connected Apps retrieves a list of Connected Apps with which the Member has successfully completed an authorization flow. If the Member revokes a Connected App''s access (e.g. via the Revoke Connected App endpoint) then the Connected App will no longer be returned in the response. A Connected App''s access may also be revoked if the Organization''s allowed Connected App policy changes.' 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - 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_organization_v1_organizations_members_GetConnectedAppsResponse' '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/organizations/{organization_id}/members/{member_id}/connected_apps\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.Organizations.Members.GetConnectedApps(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps\n\ package 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/organizations/members\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &members.GetConnectedAppsParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t}\n\n\toptions := &members.GetConnectedAppsParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.Members.GetConnectedApps(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/organizations/{organization_id}/members/{member_id}/connected_apps\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.GetConnectedAppsRequest;\n\ import com.stytch.java.b2b.models.organizationsmembers.GetConnectedAppsRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n GetConnectedAppsRequest params\ \ = new GetConnectedAppsRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setMemberId(\"${memberId}\");\n\n\ \ GetConnectedAppsRequestOptions options = new GetConnectedAppsRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().getConnectedApps(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/organizations/{organization_id}/members/{member_id}/connected_apps\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.GetConnectedAppsRequest\n\ import com.stytch.java.b2b.models.organizationsmembers.GetConnectedAppsRequestOptions\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.organizations.members.getConnectedApps(\n\ \ GetConnectedAppsRequest(\n organizationId\ \ = \"${organizationId}\",\n memberId = \"${memberId}\"\ ,\n ),\n GetConnectedAppsRequestOptions(\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: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.organizations.members.getConnectedApps(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->get_connected_apps([\n\ \ 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps\n\ from stytch import B2BClient\nfrom stytch.b2b.models.organizations_members\ \ import GetConnectedAppsRequestOptions\nfrom stytch.shared.method_options\ \ import Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.get_connected_apps(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n method_options=GetConnectedAppsRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.get_connected_apps(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ ,\n method_options: StytchB2B::Organizations::Members::GetConnectedAppsRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members::GetConnectedAppsRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.get_connected_apps(\n\ \ GetConnectedAppsRequest{\n organization_id: \"${organizationId}\"\ ,\n member_id: \"${memberId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps\n\ curl --request GET \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}/connected_apps\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/organizations/{organization_id}/members/{member_id}/external_id: delete: summary: Deleteexternalid operationId: api_organization_v1_organizations_members_DeleteExternalId tags: - Organizations parameters: - name: organization_id in: path required: true schema: type: string - name: member_id in: path required: true schema: type: string - 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_organization_v1_organizations_members_DeleteExternalIdResponse' '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/organizations/{organization_id}/members/{member_id}/external_id\n\ const stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n organization_id: \"TODO_MISSING_EXAMPLE_VALUE\",\n member_id:\ \ \"TODO_MISSING_EXAMPLE_VALUE\",\n};\n\nconst options = {\n authorization:\ \ {\n session_token: '${sessionToken}',\n },\n};\n\nclient.Organizations.Members.DeleteExternalId(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}/external_id\n\ package 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/organizations/members\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &members.DeleteExternalIDParams{\n\ \t\tOrganizationID: \"TODO_MISSING_EXAMPLE_VALUE\",\n\t\tMemberID: \ \ \"TODO_MISSING_EXAMPLE_VALUE\",\n\t}\n\n\toptions := &members.DeleteExternalIDParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.Members.DeleteExternalID(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/organizations/{organization_id}/members/{member_id}/external_id\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.DeleteExternalIdRequest;\n\ import com.stytch.java.b2b.models.organizationsmembers.DeleteExternalIdRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteExternalIdRequest params\ \ = new DeleteExternalIdRequest();\n params.setOrganizationId(\"\ TODO_MISSING_EXAMPLE_VALUE\");\n params.setMemberId(\"TODO_MISSING_EXAMPLE_VALUE\"\ );\n\n DeleteExternalIdRequestOptions options = new DeleteExternalIdRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().deleteExternalId(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/organizations/{organization_id}/members/{member_id}/external_id\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembers.DeleteExternalIdRequest\n\ import com.stytch.java.b2b.models.organizationsmembers.DeleteExternalIdRequestOptions\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.organizations.members.deleteExternalId(\n\ \ DeleteExternalIdRequest(\n organizationId\ \ = \"TODO_MISSING_EXAMPLE_VALUE\",\n memberId = \"TODO_MISSING_EXAMPLE_VALUE\"\ ,\n ),\n DeleteExternalIdRequestOptions(\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/organizations/{organization_id}/members/{member_id}/external_id\n\ const stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n organization_id: \"TODO_MISSING_EXAMPLE_VALUE\",\n member_id:\ \ \"TODO_MISSING_EXAMPLE_VALUE\",\n};\n\nconst options = {\n authorization:\ \ {\n session_token: '${sessionToken}',\n },\n};\n\nclient.organizations.members.deleteExternalId(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->delete_external_id([\n\ \ 'organization_id' => 'TODO_MISSING_EXAMPLE_VALUE',\n 'member_id'\ \ => 'TODO_MISSING_EXAMPLE_VALUE',\n], [\n 'authorization' => ['session_token'\ \ => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}/external_id\n\ from stytch import B2BClient\nfrom stytch.b2b.models.organizations_members\ \ import DeleteExternalIdRequestOptions\nfrom stytch.shared.method_options\ \ import Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.delete_external_id(\n\ \ organization_id=\"TODO_MISSING_EXAMPLE_VALUE\",\n member_id=\"TODO_MISSING_EXAMPLE_VALUE\"\ ,\n method_options=DeleteExternalIdRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}/external_id\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.delete_external_id(\n\ \ organization_id: \"TODO_MISSING_EXAMPLE_VALUE\",\n member_id: \"TODO_MISSING_EXAMPLE_VALUE\"\ ,\n method_options: StytchB2B::Organizations::Members::DeleteExternalIdRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}/external_id\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members::DeleteExternalIdRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.delete_external_id(\n\ \ DeleteExternalIdRequest{\n organization_id: \"TODO_MISSING_EXAMPLE_VALUE\"\ ,\n member_id: \"TODO_MISSING_EXAMPLE_VALUE\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# DELETE /v1/b2b/organizations/{organization_id}/members/{member_id}/external_id\n\ curl --request DELETE \\\n --url https://test.stytch.com/v1/b2b/organizations/TODO_MISSING_EXAMPLE_VALUE/members/TODO_MISSING_EXAMPLE_VALUE/external_id\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/organizations/{organization_id}/members: post: summary: Create operationId: api_organization_v1_organizations_members_Create tags: - Organizations description: Creates a Member. An `organization_id` and `email_address` are required. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_CreateRequest' 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: 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_organization_v1_organizations_members_CreateResponse' '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: "// POST /v1/b2b/organizations/{organization_id}/members\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 email_address: \"${email}\",\n external_id:\ \ \"my-external-id\",\n};\n\nconst options = {\n authorization: {\n \ \ session_token: '${sessionToken}',\n },\n};\n\nclient.Organizations.Members.Create(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/organizations/{organization_id}/members\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/organizations/members\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &members.CreateParams{\n\t\tOrganizationID:\ \ \"${organizationId}\",\n\t\tEmailAddress: \"${email}\",\n\t\tExternalID:\ \ \"my-external-id\",\n\t}\n\n\toptions := &members.CreateParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.Organizations.Members.Create(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: "// POST /v1/b2b/organizations/{organization_id}/members\npackage\ \ com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembers.CreateRequest;\n\ import com.stytch.java.b2b.models.organizationsmembers.CreateRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n CreateRequest params = new CreateRequest();\n\ \ params.setOrganizationId(\"${organizationId}\");\n params.setEmailAddress(\"\ ${email}\");\n params.setExternalId(\"my-external-id\");\n\n \ \ CreateRequestOptions options = new CreateRequestOptions();\n \ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().create(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: "// POST /v1/b2b/organizations/{organization_id}/members\npackage\ \ com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.organizationsmembers.CreateRequest\n\ import com.stytch.java.b2b.models.organizationsmembers.CreateRequestOptions\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.organizations.members.create(\n \ \ CreateRequest(\n organizationId = \"${organizationId}\"\ ,\n emailAddress = \"${email}\",\n \ \ externalId = \"my-external-id\",\n ),\n \ \ CreateRequestOptions(\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: "// POST /v1/b2b/organizations/{organization_id}/members\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 email_address: \"${email}\",\n external_id:\ \ \"my-external-id\",\n};\n\nconst options = {\n authorization: {\n \ \ session_token: '${sessionToken}',\n },\n};\n\nclient.organizations.members.create(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->create([\n 'organization_id'\ \ => '${organizationId}',\n 'email_address' => '${email}',\n 'external_id'\ \ => 'my-external-id',\n], [\n 'authorization' => ['session_token'\ \ => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# POST /v1/b2b/organizations/{organization_id}/members\nfrom stytch\ \ import B2BClient\nfrom stytch.b2b.models.organizations_members import\ \ CreateRequestOptions\nfrom stytch.shared.method_options import Authorization\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.organizations.members.create(\n organization_id=\"\ ${organizationId}\",\n email_address=\"${email}\",\n external_id=\"\ my-external-id\",\n method_options=CreateRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/organizations/{organization_id}/members\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.organizations.members.create(\n organization_id:\ \ \"${organizationId}\",\n email_address: \"${email}\",\n external_id:\ \ \"my-external-id\",\n method_options: StytchB2B::Organizations::Members::CreateRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/organizations/{organization_id}/members\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::organizations_members::CreateRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.organizations.members.create(\n CreateRequest{\n\ \ organization_id: \"${organizationId}\",\n email_address:\ \ \"${email}\",\n external_id: Some(String::from(\"my-external-id\"\ )),\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/organizations/{organization_id}/members\ncurl --request\ \ POST \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"email_address\": \"${email}\",\n \"external_id\": \"my-external-id\"\ \n }'" /v1/b2b/organizations/{organization_id}/member: get: summary: Get operationId: api_organization_v1_organizations_members_Get tags: - Organizations description: Get a Member by `member_id` or `email_address`. 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: member_id in: query required: false schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - name: email_address in: query required: false schema: type: string description: The email address of the Member. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_GetResponse' '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/organizations/{organization_id}/member\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 email_address: \"${email}\",\n};\n\nclient.Organizations.Members.Get(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/b2b/organizations/{organization_id}/member\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/organizations/members\"\ \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 := &members.GetParams{\n\t\tOrganizationID:\ \ \"${organizationId}\",\n\t\tEmailAddress: \"${email}\",\n\t}\n\n\tresp,\ \ err := client.Organizations.Members.Get(context.Background(), params)\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/organizations/{organization_id}/member\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.organizationsmembers.GetRequest;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ GetRequest params = new GetRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setEmailAddress(\"${email}\");\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().get(params);\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/organizations/{organization_id}/member\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.organizationsmembers.GetRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.organizations.members.get(\n \ \ GetRequest(\n organizationId = \"${organizationId}\"\ ,\n emailAddress = \"${email}\",\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: "// GET /v1/b2b/organizations/{organization_id}/member\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 email_address: \"${email}\",\n};\n\nclient.organizations.members.get(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->get([\n 'organization_id'\ \ => '${organizationId}',\n 'email_address' => '${email}',\n]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/{organization_id}/member\nfrom stytch\ \ import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.get(\n\ \ organization_id=\"${organizationId}\",\n email_address=\"${email}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/{organization_id}/member\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.organizations.members.get(\n organization_id:\ \ \"${organizationId}\",\n email_address: \"${email}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/{organization_id}/member\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::organizations_members::GetRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.organizations.members.get(\n GetRequest{\n\ \ organization_id: \"${organizationId}\",\n email_address:\ \ Some(String::from(\"${email}\")),\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/{organization_id}/member\ncurl --request\ \ GET \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/member\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n --get \\\n --data-urlencode 'email_address=${email}'" /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/google: get: summary: Google operationId: api_organization_v1_organizations_members_oauth_providers_Google tags: - Members description: "Retrieve the saved Google access token and ID token for a member.\ \ After a successful OAuth login, Stytch will save the \nissued access token\ \ and ID token from the identity provider. If a refresh token has been issued,\ \ Stytch will refresh the \naccess token automatically.\n\nGoogle One Tap\ \ does not return access tokens. If the member has only authenticated through\ \ Google One Tap and not through a regular Google OAuth flow, this endpoint\ \ will not return any tokens.\n\n__Note:__ Google does not issue a refresh\ \ token on every login, and refresh tokens may expire if unused.\nTo force\ \ a refresh token to be issued, pass the `?provider_prompt=consent` query\ \ param into the\n[Start Google OAuth flow](https://stytch.com/docs/b2b/api/oauth-google-start)\ \ endpoint." 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - name: include_refresh_token in: query required: false schema: type: boolean description: Whether to return the refresh token Stytch has stored for the OAuth Provider. Defaults to false. **Important:** If your application exchanges the refresh token, Stytch may not be able to automatically refresh access tokens in the future. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_oauth_providers_GoogleResponse' '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/organizations/{organization_id}/members/{member_id}/oauth_providers/google\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nclient.Organizations.Members.OAuthProviders.Google(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/google\n\ package 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/organizations/members/oauthproviders\"\ \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 := &oauthproviders.ProviderInformationParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t}\n\n\tresp, err := client.Organizations.Members.OAuthProviders.Google(context.Background(),\ \ params)\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/organizations/{organization_id}/members/{member_id}/oauth_providers/google\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembersoauthproviders.ProviderInformationRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ProviderInformationRequest params = new ProviderInformationRequest();\n\ \ params.setOrganizationId(\"${organizationId}\");\n params.setMemberId(\"\ ${memberId}\");\n\n Object result = StytchB2BClient.getOrganizations().getMembers().getOAuthProviders().google(params);\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/organizations/{organization_id}/members/{member_id}/oauth_providers/google\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembersoauthproviders.ProviderInformationRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.organizations.members.oauthProviders.google(\n\ \ ProviderInformationRequest(\n organizationId\ \ = \"${organizationId}\",\n memberId = \"${memberId}\"\ ,\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: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/google\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nclient.organizations.members.oauthProviders.google(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->organizations->members->oauth_providers->google([\n\ \ 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n\ ]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/google\n\ from stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.oauth_providers.google(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/google\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.oauth_providers.google(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/google\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members_oauth_providers::ProviderInformationRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.oauth_providers.google(\n\ \ ProviderInformationRequest{\n organization_id: \"${organizationId}\"\ ,\n member_id: \"${memberId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/google\n\ curl --request GET \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}/oauth_providers/google\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/microsoft: get: summary: Microsoft operationId: api_organization_v1_organizations_members_oauth_providers_Microsoft tags: - Members description: 'Retrieve the saved Microsoft access token and ID token for a member. After a successful OAuth login, Stytch will save the issued access token and ID token from the identity provider. If a refresh token has been issued, Stytch will refresh the access token automatically.' 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - name: include_refresh_token in: query required: false schema: type: boolean description: Whether to return the refresh token Stytch has stored for the OAuth Provider. Defaults to false. **Important:** If your application exchanges the refresh token, Stytch may not be able to automatically refresh access tokens in the future. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_oauth_providers_MicrosoftResponse' '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/organizations/{organization_id}/members/{member_id}/oauth_providers/microsoft\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nclient.Organizations.Members.OAuthProviders.Microsoft(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/microsoft\n\ package 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/organizations/members/oauthproviders\"\ \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 := &oauthproviders.ProviderInformationParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t}\n\n\tresp, err := client.Organizations.Members.OAuthProviders.Microsoft(context.Background(),\ \ params)\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/organizations/{organization_id}/members/{member_id}/oauth_providers/microsoft\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembersoauthproviders.ProviderInformationRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ProviderInformationRequest params = new ProviderInformationRequest();\n\ \ params.setOrganizationId(\"${organizationId}\");\n params.setMemberId(\"\ ${memberId}\");\n\n Object result = StytchB2BClient.getOrganizations().getMembers().getOAuthProviders().microsoft(params);\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/organizations/{organization_id}/members/{member_id}/oauth_providers/microsoft\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembersoauthproviders.ProviderInformationRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.organizations.members.oauthProviders.microsoft(\n\ \ ProviderInformationRequest(\n organizationId\ \ = \"${organizationId}\",\n memberId = \"${memberId}\"\ ,\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: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/microsoft\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nclient.organizations.members.oauthProviders.microsoft(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->oauth_providers->microsoft([\n\ \ 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n\ ]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/microsoft\n\ from stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.oauth_providers.microsoft(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/microsoft\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.oauth_providers.microsoft(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/microsoft\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members_oauth_providers::ProviderInformationRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.oauth_providers.microsoft(\n\ \ ProviderInformationRequest{\n organization_id: \"${organizationId}\"\ ,\n member_id: \"${memberId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/microsoft\n\ curl --request GET \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}/oauth_providers/microsoft\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/slack: get: summary: Slack operationId: api_organization_v1_organizations_members_oauth_providers_Slack tags: - Members description: "Retrieve the saved Slack access token and ID token for a member.\ \ After a successful OAuth login, Stytch will save the \nissued access token\ \ and ID token from the identity provider." 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_oauth_providers_SlackResponse' '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/organizations/{organization_id}/members/{member_id}/oauth_providers/slack\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nclient.Organizations.Members.OAuthProviders.Slack(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/slack\n\ package 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/organizations/members/oauthproviders\"\ \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 := &oauthproviders.SlackParams{\n\t\ \tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t}\n\n\tresp, err := client.Organizations.Members.OAuthProviders.Slack(context.Background(),\ \ params)\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/organizations/{organization_id}/members/{member_id}/oauth_providers/slack\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembersoauthproviders.SlackRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ SlackRequest params = new SlackRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setMemberId(\"${memberId}\");\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().getOAuthProviders().slack(params);\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/organizations/{organization_id}/members/{member_id}/oauth_providers/slack\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembersoauthproviders.SlackRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.organizations.members.oauthProviders.slack(\n\ \ SlackRequest(\n organizationId = \"\ ${organizationId}\",\n memberId = \"${memberId}\",\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: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/slack\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nclient.organizations.members.oauthProviders.slack(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->organizations->members->oauth_providers->slack([\n\ \ 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n\ ]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/slack\n\ from stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.oauth_providers.slack(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/slack\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.oauth_providers.slack(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/slack\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members_oauth_providers::SlackRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.oauth_providers.slack(\n\ \ SlackRequest{\n organization_id: \"${organizationId}\"\ ,\n member_id: \"${memberId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/slack\n\ curl --request GET \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}/oauth_providers/slack\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/hubspot: get: summary: Hubspot operationId: api_organization_v1_organizations_members_oauth_providers_Hubspot tags: - Members description: "Retrieve the saved Hubspot access token and ID token for a member.\ \ After a successful OAuth login, Stytch will save the \nissued access token\ \ and ID token from the identity provider. If a refresh token has been issued,\ \ Stytch will refresh the \naccess token automatically." 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - name: include_refresh_token in: query required: false schema: type: boolean description: Whether to return the refresh token Stytch has stored for the OAuth Provider. Defaults to false. **Important:** If your application exchanges the refresh token, Stytch may not be able to automatically refresh access tokens in the future. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_oauth_providers_HubspotResponse' '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/organizations/{organization_id}/members/{member_id}/oauth_providers/hubspot\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nclient.Organizations.Members.OAuthProviders.Hubspot(params)\n \ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/hubspot\n\ package 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/organizations/members/oauthproviders\"\ \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 := &oauthproviders.ProviderInformationParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t}\n\n\tresp, err := client.Organizations.Members.OAuthProviders.Hubspot(context.Background(),\ \ params)\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/organizations/{organization_id}/members/{member_id}/oauth_providers/hubspot\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembersoauthproviders.ProviderInformationRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ProviderInformationRequest params = new ProviderInformationRequest();\n\ \ params.setOrganizationId(\"${organizationId}\");\n params.setMemberId(\"\ ${memberId}\");\n\n Object result = StytchB2BClient.getOrganizations().getMembers().getOAuthProviders().hubspot(params);\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/organizations/{organization_id}/members/{member_id}/oauth_providers/hubspot\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembersoauthproviders.ProviderInformationRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.organizations.members.oauthProviders.hubspot(\n\ \ ProviderInformationRequest(\n organizationId\ \ = \"${organizationId}\",\n memberId = \"${memberId}\"\ ,\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: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/hubspot\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nclient.organizations.members.oauthProviders.hubspot(params)\n \ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->oauth_providers->hubspot([\n\ \ 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n\ ]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/hubspot\n\ from stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.oauth_providers.hubspot(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/hubspot\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.oauth_providers.hubspot(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/hubspot\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members_oauth_providers::ProviderInformationRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.oauth_providers.hubspot(\n\ \ ProviderInformationRequest{\n organization_id: \"${organizationId}\"\ ,\n member_id: \"${memberId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/hubspot\n\ curl --request GET \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}/oauth_providers/hubspot\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/github: get: summary: Github operationId: api_organization_v1_organizations_members_oauth_providers_Github tags: - Members description: "Retrieve the saved GitHub access token for a Member. After a successful\ \ OAuth login, Stytch will save the \nissued access token from the identity\ \ provider. GitHub does not issue refresh tokens, but will invalidate access\n\ tokens after very long periods of inactivity." 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - name: include_refresh_token in: query required: false schema: type: boolean description: Whether to return the refresh token Stytch has stored for the OAuth Provider. Defaults to false. **Important:** If your application exchanges the refresh token, Stytch may not be able to automatically refresh access tokens in the future. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_oauth_providers_GithubResponse' '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/organizations/{organization_id}/members/{member_id}/oauth_providers/github\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nclient.Organizations.Members.OAuthProviders.Github(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/github\n\ package 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/organizations/members/oauthproviders\"\ \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 := &oauthproviders.ProviderInformationParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t}\n\n\tresp, err := client.Organizations.Members.OAuthProviders.Github(context.Background(),\ \ params)\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/organizations/{organization_id}/members/{member_id}/oauth_providers/github\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembersoauthproviders.ProviderInformationRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ProviderInformationRequest params = new ProviderInformationRequest();\n\ \ params.setOrganizationId(\"${organizationId}\");\n params.setMemberId(\"\ ${memberId}\");\n\n Object result = StytchB2BClient.getOrganizations().getMembers().getOAuthProviders().github(params);\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/organizations/{organization_id}/members/{member_id}/oauth_providers/github\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembersoauthproviders.ProviderInformationRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.organizations.members.oauthProviders.github(\n\ \ ProviderInformationRequest(\n organizationId\ \ = \"${organizationId}\",\n memberId = \"${memberId}\"\ ,\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: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/github\n\ const 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 member_id: \"${memberId}\"\ ,\n};\n\nclient.organizations.members.oauthProviders.github(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->organizations->members->oauth_providers->github([\n\ \ 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n\ ]);" - lang: python label: Python source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/github\n\ from stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.oauth_providers.github(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/github\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.oauth_providers.github(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/github\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members_oauth_providers::ProviderInformationRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.oauth_providers.github(\n\ \ ProviderInformationRequest{\n organization_id: \"${organizationId}\"\ ,\n member_id: \"${memberId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/b2b/organizations/{organization_id}/members/{member_id}/oauth_providers/github\n\ curl --request GET \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}/oauth_providers/github\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps/{connected_app_id}/revoke: post: summary: Revoke operationId: api_organization_v1_organizations_members_connected_apps_Revoke tags: - Members description: 'Revoke Connected App revokes a Connected App''s access to a Member and revokes all active tokens that have been created on the Member''s behalf. New tokens cannot be created until the Member completes a new authorization flow with the Connected App.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_organization_v1_organizations_members_connected_apps_RevokeRequest' 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. - name: connected_app_id in: path required: true schema: type: string description: The ID of the Connected App. description: The ID of the Connected App. - 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_organization_v1_organizations_members_connected_apps_RevokeResponse' '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: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps/{connected_app_id}/revoke\n\ const 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 member_id: \"${memberId}\"\ ,\n connected_app_id: \"${exampleConnectedAppClientID}\",\n};\n\nconst\ \ options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.Organizations.Members.ConnectedApps.Revoke(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps/{connected_app_id}/revoke\n\ package 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/organizations/members/connectedapps\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/methodoptions\"\n)\n\n\ func 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 := &connectedapps.RevokeParams{\n\t\ \tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t\tConnectedAppID: \"${exampleConnectedAppClientID}\",\n\t}\n\n\toptions\ \ := &connectedapps.RevokeParamsOptions{\n\t\tAuthorization: methodoptions.Authorization{\n\ \t\t\tSessionToken: \"${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err :=\ \ client.Organizations.Members.ConnectedApps.Revoke(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: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps/{connected_app_id}/revoke\n\ package com.example;\n\nimport com.stytch.java.b2b.models.organizationsmembersconnectedapps.RevokeRequest;\n\ import com.stytch.java.b2b.models.organizationsmembersconnectedapps.RevokeRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n RevokeRequest params = new RevokeRequest();\n\ \ params.setOrganizationId(\"${organizationId}\");\n params.setMemberId(\"\ ${memberId}\");\n params.setConnectedAppId(\"${exampleConnectedAppClientID}\"\ );\n\n RevokeRequestOptions options = new RevokeRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getOrganizations().getMembers().getConnectedApps().revoke(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: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps/{connected_app_id}/revoke\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.organizationsmembersconnectedapps.RevokeRequest\n\ import com.stytch.java.b2b.models.organizationsmembersconnectedapps.RevokeRequestOptions\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.organizations.members.connectedApps.revoke(\n\ \ RevokeRequest(\n organizationId = \"\ ${organizationId}\",\n memberId = \"${memberId}\",\n\ \ connectedAppId = \"${exampleConnectedAppClientID}\"\ ,\n ),\n RevokeRequestOptions(\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: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps/{connected_app_id}/revoke\n\ const 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 member_id: \"${memberId}\"\ ,\n connected_app_id: \"${exampleConnectedAppClientID}\",\n};\n\nconst\ \ options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.organizations.members.connectedApps.revoke(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->organizations->members->connected_apps->revoke([\n\ \ 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n\ \ 'connected_app_id' => '${exampleConnectedAppClientID}',\n], [\n \ \ 'authorization' => ['session_token' => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# POST /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps/{connected_app_id}/revoke\n\ from stytch import B2BClient\nfrom stytch.b2b.models.organizations_members_connected_apps\ \ import RevokeRequestOptions\nfrom stytch.shared.method_options import\ \ Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.organizations.members.connected_apps.revoke(\n\ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n connected_app_id=\"${exampleConnectedAppClientID}\",\n method_options=RevokeRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps/{connected_app_id}/revoke\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.organizations.members.connected_apps.revoke(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ ,\n connected_app_id: \"${exampleConnectedAppClientID}\",\n method_options:\ \ StytchB2B::Organizations::Members::ConnectedApps::RevokeRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps/{connected_app_id}/revoke\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::organizations_members_connected_apps::RevokeRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.organizations.members.connected_apps.revoke(\n\ \ RevokeRequest{\n organization_id: \"${organizationId}\"\ ,\n member_id: \"${memberId}\",\n connected_app_id:\ \ \"${exampleConnectedAppClientID}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/organizations/{organization_id}/members/{member_id}/connected_apps/{connected_app_id}/revoke\n\ curl --request POST \\\n --url https://test.stytch.com/v1/b2b/organizations/${organizationId}/members/${memberId}/connected_apps/${exampleConnectedAppClientID}/revoke\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/idp/oauth/authorize/start: post: summary: Authorizestart operationId: api_b2b_idp_v1_b2b_idp_oauth_AuthorizeStart tags: - B2B Idp description: 'Initiates a request for authorization of a Connected App to access a Member''s account. Call this endpoint using the query parameters from an OAuth Authorization request. This endpoint validates various fields (`scope`, `client_id`, `redirect_uri`, `prompt`, etc...) are correct and returns relevant information for rendering an OAuth Consent Screen. This endpoint returns: - A public representation of the Connected App requesting authorization - Whether _explicit_ consent must be granted before proceeding with the authorization - A list of scopes the Member has the ability to grant the Connected App Use this response to prompt the Member for consent (if necessary) before calling the [Submit OAuth Authorization](https://stytch.com/docs/b2b/api/connected-apps-oauth-authorize) endpoint. Exactly one of the following must be provided to identify the Member granting authorization: - `organization_id` + `member_id` - `session_token` - `session_jwt` If a `session_token` or `session_jwt` is passed, the OAuth Authorization will be linked to the Member''s session for tracking purposes. One of these fields must be used if the Connected App intends to complete the [Exchange Access Token](https://stytch.com/docs/b2b/api/connected-app-access-token-exchange) flow.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_idp_v1_b2b_idp_oauth_AuthorizeStartRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_idp_v1_b2b_idp_oauth_AuthorizeStartResponse' '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: "// POST /v1/b2b/idp/oauth/authorize/start\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleConnectedAppClientID}\"\ ,\n redirect_uri: \"https://app.example/oauth/callback\",\n response_type:\ \ \"code\",\n scopes: [\"openid\"],\n};\n\nclient.IDP.OAuth.AuthorizeStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/idp/oauth/authorize/start\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/idp/oauth\"\n)\n\n\ func 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 := &oauth.AuthorizeStartParams{\n\t\ \tClientID: \"${exampleConnectedAppClientID}\",\n\t\tRedirectURI: \"\ https://app.example/oauth/callback\",\n\t\tResponseType: \"code\",\n\t\t\ Scopes: []string{\"openid\"},\n\t}\n\n\tresp, err := client.IDP.OAuth.AuthorizeStart(context.Background(),\ \ params)\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: "// POST /v1/b2b/idp/oauth/authorize/start\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.idpoauth.AuthorizeStartRequest;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ AuthorizeStartRequest params = new AuthorizeStartRequest();\n \ \ params.setClientId(\"${exampleConnectedAppClientID}\");\n \ \ params.setRedirectUri(\"https://app.example/oauth/callback\");\n \ \ params.setResponseType(\"code\");\n params.setScopes(new String(\"\ openid\"));\n\n Object result = StytchB2BClient.getIDP().getOAuth().authorizeStart(params);\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: "// POST /v1/b2b/idp/oauth/authorize/start\npackage com.example\n\n\ import com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.idpoauth.AuthorizeStartRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.idp.oauth.authorizeStart(\n \ \ AuthorizeStartRequest(\n clientId = \"${exampleConnectedAppClientID}\"\ ,\n redirectUri = \"https://app.example/oauth/callback\"\ ,\n responseType = \"code\",\n scopes\ \ = arrayOf(\"openid\"),\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: "// POST /v1/b2b/idp/oauth/authorize/start\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleConnectedAppClientID}\"\ ,\n redirect_uri: \"https://app.example/oauth/callback\",\n response_type:\ \ \"code\",\n scopes: [\"openid\"],\n};\n\nclient.idp.oauth.authorizeStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->idp->oauth->authorize_start([\n 'client_id'\ \ => '${exampleConnectedAppClientID}',\n 'redirect_uri' => 'https://app.example/oauth/callback',\n\ \ 'response_type' => 'code',\n 'scopes' => ['openid'],\n]);" - lang: python label: Python source: "# POST /v1/b2b/idp/oauth/authorize/start\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.idp.oauth.authorize_start(\n client_id=\"${exampleConnectedAppClientID}\"\ ,\n redirect_uri=\"https://app.example/oauth/callback\",\n response_type=\"\ code\",\n scopes=[\"openid\"],\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/idp/oauth/authorize/start\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.idp.oauth.authorize_start(\n client_id:\ \ \"${exampleConnectedAppClientID}\",\n redirect_uri: \"https://app.example/oauth/callback\"\ ,\n response_type: \"code\",\n scopes: ['openid']\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/idp/oauth/authorize/start\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::idp_oauth::AuthorizeStartRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.idp.oauth.authorize_start(\n AuthorizeStartRequest{\n\ \ client_id: \"${exampleConnectedAppClientID}\",\n \ \ redirect_uri: \"https://app.example/oauth/callback\",\n response_type:\ \ \"code\",\n scopes: vec![\"openid\"],\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/idp/oauth/authorize/start\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/b2b/idp/oauth/authorize/start \\\n \ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"client_id\": \"${exampleConnectedAppClientID}\",\n\ \ \"redirect_uri\": \"https://app.example/oauth/callback\",\n \"response_type\"\ : \"code\",\n \"scopes\": [\"openid\"]\n }'" /v1/b2b/idp/oauth/authorize: post: summary: Authorize operationId: api_b2b_idp_v1_b2b_idp_oauth_Authorize tags: - B2B Idp description: 'Completes a request for authorization of a Connected App to access a Member''s account. Call this endpoint using the query parameters from an OAuth Authorization request, after previously validating those parameters using the [Preflight Check](https://stytch.com/docs/b2b/api/connected-apps-oauth-authorize-start) API. Note that this endpoint takes in a few additional parameters the preflight check does not- `state`, `nonce`, and `code_challenge`. If the authorization was successful, the `redirect_uri` will contain a valid `authorization_code` embedded as a query parameter. If the authorization was unsuccessful, the `redirect_uri` will contain an OAuth2.1 `error_code`. In both cases, redirect the Member to the location for the response to be consumed by the Connected App. Exactly one of the following must be provided to identify the Member granting authorization: - `organization_id` + `member_id` - `session_token` - `session_jwt` If a `session_token` or `session_jwt` is passed, the OAuth Authorization will be linked to the Member''s session for tracking purposes. One of these fields must be used if the Connected App intends to complete the [Exchange Access Token](https://stytch.com/docs/b2b/api/connected-app-access-token-exchange) flow.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_idp_v1_b2b_idp_oauth_AuthorizeRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_idp_v1_b2b_idp_oauth_AuthorizeResponse' '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: "// POST /v1/b2b/idp/oauth/authorize\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n consent_granted: true,\n\ \ scopes: [\"openid\"],\n client_id: \"${exampleConnectedAppClientID}\"\ ,\n redirect_uri: \"https://app.example/oauth/callback\",\n response_type:\ \ \"code\",\n};\n\nclient.IDP.OAuth.Authorize(params)\n .then(resp => {\ \ console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/idp/oauth/authorize\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/idp/oauth\"\n)\n\n\ func 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 := &oauth.AuthorizeParams{\n\t\tConsentGranted:\ \ true,\n\t\tScopes: []string{\"openid\"},\n\t\tClientID: \ \ \"${exampleConnectedAppClientID}\",\n\t\tRedirectURI: \"https://app.example/oauth/callback\"\ ,\n\t\tResponseType: \"code\",\n\t}\n\n\tresp, err := client.IDP.OAuth.Authorize(context.Background(),\ \ params)\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: "// POST /v1/b2b/idp/oauth/authorize\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.models.idpoauth.AuthorizeRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthorizeRequest params = new\ \ AuthorizeRequest();\n params.setConsentGranted(true);\n \ \ params.setScopes(new String(\"openid\"));\n params.setClientId(\"\ ${exampleConnectedAppClientID}\");\n params.setRedirectUri(\"https://app.example/oauth/callback\"\ );\n params.setResponseType(\"code\");\n\n Object result =\ \ StytchB2BClient.getIDP().getOAuth().authorize(params);\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: "// POST /v1/b2b/idp/oauth/authorize\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.idpoauth.AuthorizeRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.idp.oauth.authorize(\n AuthorizeRequest(\n\ \ consentGranted = true,\n scopes\ \ = arrayOf(\"openid\"),\n clientId = \"${exampleConnectedAppClientID}\"\ ,\n redirectUri = \"https://app.example/oauth/callback\"\ ,\n responseType = \"code\",\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: "// POST /v1/b2b/idp/oauth/authorize\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n consent_granted: true,\n\ \ scopes: [\"openid\"],\n client_id: \"${exampleConnectedAppClientID}\"\ ,\n redirect_uri: \"https://app.example/oauth/callback\",\n response_type:\ \ \"code\",\n};\n\nclient.idp.oauth.authorize(params)\n .then(resp => {\ \ console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->idp->oauth->authorize([\n 'consent_granted'\ \ => true,\n 'scopes' => ['openid'],\n 'client_id' => '${exampleConnectedAppClientID}',\n\ \ 'redirect_uri' => 'https://app.example/oauth/callback',\n 'response_type'\ \ => 'code',\n]);" - lang: python label: Python source: "# POST /v1/b2b/idp/oauth/authorize\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.idp.oauth.authorize(\n consent_granted=True,\n\ \ scopes=[\"openid\"],\n client_id=\"${exampleConnectedAppClientID}\"\ ,\n redirect_uri=\"https://app.example/oauth/callback\",\n response_type=\"\ code\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/idp/oauth/authorize\nrequire 'stytch'\n\nclient =\ \ StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.idp.oauth.authorize(\n consent_granted:\ \ true,\n scopes: ['openid'],\n client_id: \"${exampleConnectedAppClientID}\"\ ,\n redirect_uri: \"https://app.example/oauth/callback\",\n response_type:\ \ \"code\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/idp/oauth/authorize\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::idp_oauth::AuthorizeRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.idp.oauth.authorize(\n AuthorizeRequest{\n \ \ consent_granted: true,\n scopes: vec![\"openid\"],\n \ \ client_id: \"${exampleConnectedAppClientID}\",\n redirect_uri:\ \ \"https://app.example/oauth/callback\",\n response_type: \"\ code\",\n ..Default::default()\n }\n ).await;\n \ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/idp/oauth/authorize\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/b2b/idp/oauth/authorize \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"consent_granted\"\ : true,\n \"scopes\": [\"openid\"],\n \"client_id\": \"${exampleConnectedAppClientID}\"\ ,\n \"redirect_uri\": \"https://app.example/oauth/callback\",\n \"\ response_type\": \"code\"\n }'" /v1/users: post: summary: Create operationId: api_user_v1_Create tags: - User description: Add a User to Stytch. A `user_id` is returned in the response that can then be used to perform other operations within Stytch. An `email` or a `phone_number` is required. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_user_v1_CreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_CreateResponse' '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: "// POST /v1/users\nconst stytch = require('stytch');\n\nconst client\ \ = new stytch.Client({\n project_id: '${projectId}',\n secret: '${secret}',\n\ });\n\nconst params = {\n email: \"${email}\",\n external_id: \"my-external-id\"\ ,\n};\n\nclient.Users.Create(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/users\npackage main\n\nimport (\n\t\"context\"\n\t\"\ log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.CreateParams{\n\t\tEmail:\ \ \"${email}\",\n\t\tExternalID: \"my-external-id\",\n\t}\n\n\tresp,\ \ err := client.Users.Create(context.Background(), params)\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: "// POST /v1/users\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.users.CreateRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ CreateRequest params = new CreateRequest();\n params.setEmail(\"\ ${email}\");\n params.setExternalId(\"my-external-id\");\n\n \ \ Object result = StytchClient.getUsers().create(params);\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: "// POST /v1/users\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.users.CreateRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.create(\n CreateRequest(\n\ \ email = \"${email}\",\n externalId\ \ = \"my-external-id\",\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: "// POST /v1/users\nconst stytch = require('stytch');\n\nconst client\ \ = new stytch.Client({\n project_id: '${projectId}',\n secret: '${secret}',\n\ });\n\nconst params = {\n email: \"${email}\",\n external_id: \"my-external-id\"\ ,\n};\n\nclient.users.create(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->create([\n 'email' => '${email}',\n\ \ 'external_id' => 'my-external-id',\n]);" - lang: python label: Python source: "# POST /v1/users\nfrom stytch import Client\n\nclient = Client(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.users.create(\n email=\"${email}\",\n external_id=\"my-external-id\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/users\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.users.create(\n\ \ email: \"${email}\",\n external_id: \"my-external-id\"\n \n)\n\nputs\ \ resp" - lang: rust label: Rust source: "// POST /v1/users\nuse stytch::consumer::client::Client;\nuse stytch::consumer::users::CreateRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.users.create(\n CreateRequest{\n\ \ email: Some(String::from(\"${email}\")),\n external_id:\ \ Some(String::from(\"my-external-id\")),\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/users\ncurl --request POST \\\n --url https://test.stytch.com/v1/users\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email\": \"${email}\",\n \"external_id\": \"my-external-id\"\ \n }'" /v1/users/{user_id}: get: summary: Get operationId: api_user_v1_Get tags: - User description: Get information about a specific User. parameters: - name: user_id in: path required: true schema: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_GetResponse' '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/users/{user_id}\nconst stytch = require('stytch');\n\n\ const client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n};\n\ \nclient.Users.Get(params)\n .then(resp => { console.log(resp) })\n .catch(err\ \ => { console.log(err) });" - lang: go label: Go source: "// GET /v1/users/{user_id}\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.GetParams{\n\t\tUserID:\ \ \"${userId}\",\n\t}\n\n\tresp, err := client.Users.Get(context.Background(),\ \ params)\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/users/{user_id}\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.users.GetRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ GetRequest params = new GetRequest();\n params.setUserId(\"\ ${userId}\");\n\n Object result = StytchClient.getUsers().get(params);\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/users/{user_id}\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.users.GetRequest\n\nfun main() {\n\ \ StytchClient.configure(\n projectId = \"${projectId}\",\n \ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.get(\n GetRequest(\n\ \ userId = \"${userId}\",\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: "// GET /v1/users/{user_id}\nconst stytch = require('stytch');\n\n\ const client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n};\n\ \nclient.users.get(params)\n .then(resp => { console.log(resp) })\n .catch(err\ \ => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->get([\n 'user_id' => '${userId}',\n\ ]);" - lang: python label: Python source: "# GET /v1/users/{user_id}\nfrom stytch import Client\n\nclient =\ \ Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\",\n\ )\n\nresp = client.users.get(\n user_id=\"${userId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/users/{user_id}\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.users.get(\n\ \ user_id: \"${userId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/users/{user_id}\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::users::GetRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.users.get(\n GetRequest{\n user_id: \"${userId}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/users/{user_id}\ncurl --request GET \\\n --url https://test.stytch.com/v1/users/${userId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" put: summary: Update operationId: api_user_v1_Update tags: - User description: 'Update a User''s attributes. **Note:** In order to add a new email address or phone number to an existing User object, pass the new email address or phone number into the respective `/send` endpoint for the authentication method of your choice. If you specify the existing User''s `user_id` while calling the `/send` endpoint, the new, unverified email address or phone number will be added to the existing User object. If the user successfully authenticates within 5 minutes of the `/send` request, the new email address or phone number will be marked as verified and remain permanently on the existing Stytch User. Otherwise, it will be removed from the User object, and any subsequent login requests using that phone number will create a new User. We require this process to guard against an account takeover vulnerability.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_user_v1_UpdateRequest' parameters: - name: user_id in: path required: true schema: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_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 delete: summary: Delete operationId: api_user_v1_Delete tags: - User description: Delete a User from Stytch. parameters: - name: user_id in: path required: true schema: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_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/users/{user_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n};\n\ \nclient.Users.Delete(params)\n .then(resp => { console.log(resp) })\n\ \ .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/users/{user_id}\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.DeleteParams{\n\t\tUserID:\ \ \"${userId}\",\n\t}\n\n\tresp, err := client.Users.Delete(context.Background(),\ \ params)\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/users/{user_id}\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.users.DeleteRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ DeleteRequest params = new DeleteRequest();\n params.setUserId(\"\ ${userId}\");\n\n Object result = StytchClient.getUsers().delete(params);\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/users/{user_id}\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.users.DeleteRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.delete(\n DeleteRequest(\n\ \ userId = \"${userId}\",\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/users/{user_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n};\n\ \nclient.users.delete(params)\n .then(resp => { console.log(resp) })\n\ \ .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->delete([\n 'user_id' => '${userId}',\n\ ]);" - lang: python label: Python source: "# DELETE /v1/users/{user_id}\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.users.delete(\n user_id=\"${userId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/users/{user_id}\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.users.delete(\n\ \ user_id: \"${userId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/users/{user_id}\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::users::DeleteRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.users.delete(\n DeleteRequest{\n user_id: \"\ ${userId}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# DELETE /v1/users/{user_id}\ncurl --request DELETE \\\n --url https://test.stytch.com/v1/users/${userId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/users/search: post: summary: Search operationId: api_user_v1_Search tags: - User description: ' **Warning**: This endpoint is not recommended for use in login flows. Scaling issues may occur, as search performance may vary from ~150 milliseconds to 9 seconds depending on query complexity and rate limits are set to 150 requests/minute. Search for Users within your Stytch Project. Use the `query` object to filter by different fields. See the `query.operands.filter_value` documentation below for a list of available filters. ### Export all User data Submit an empty `query` in your Search Users request to return all of your Stytch Project''s Users. [This Github repository](https://github.com/stytchauth/stytch-node-export-users) contains a utility that leverages the Search Users endpoint to export all of your User data to a CSV or JSON file.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_user_v1_SearchRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_SearchResponse' '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 /v1/users/{user_id}/exchange_primary_factor: put: summary: Exchangeprimaryfactor operationId: api_user_v1_ExchangePrimaryFactor tags: - User description: 'Exchange a user''s email address or phone number for another. Must pass either an `email_address` or a `phone_number`. This endpoint only works if the user has exactly one factor. You are able to exchange the type of factor for another as well, i.e. exchange an `email_address` for a `phone_number`. Use this endpoint with caution as it performs an admin level action.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_user_v1_ExchangePrimaryFactorRequest' parameters: - name: user_id in: path required: true schema: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_ExchangePrimaryFactorResponse' '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/users/{user_id}/exchange_primary_factor\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.Client({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n user_id:\ \ \"${userId}\",\n};\n\nclient.Users.ExchangePrimaryFactor(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// PUT /v1/users/{user_id}/exchange_primary_factor\npackage main\n\ \nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.ExchangePrimaryFactorParams{\n\ \t\tUserID: \"${userId}\",\n\t}\n\n\tresp, err := client.Users.ExchangePrimaryFactor(context.Background(),\ \ params)\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/users/{user_id}/exchange_primary_factor\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.users.ExchangePrimaryFactorRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ExchangePrimaryFactorRequest\ \ params = new ExchangePrimaryFactorRequest();\n params.setUserId(\"\ ${userId}\");\n\n Object result = StytchClient.getUsers().exchangePrimaryFactor(params);\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/users/{user_id}/exchange_primary_factor\npackage com.example\n\ \nimport com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.users.ExchangePrimaryFactorRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.exchangePrimaryFactor(\n \ \ ExchangePrimaryFactorRequest(\n userId = \"${userId}\"\ ,\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/users/{user_id}/exchange_primary_factor\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.Client({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n user_id:\ \ \"${userId}\",\n};\n\nclient.users.exchangePrimaryFactor(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->exchange_primary_factor([\n 'user_id'\ \ => '${userId}',\n]);" - lang: python label: Python source: "# PUT /v1/users/{user_id}/exchange_primary_factor\nfrom stytch import\ \ Client\n\nclient = Client(\n project_id=\"${projectId}\",\n secret=\"\ ${secret}\",\n)\n\nresp = client.users.exchange_primary_factor(\n user_id=\"\ ${userId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# PUT /v1/users/{user_id}/exchange_primary_factor\nrequire 'stytch'\n\ \nclient = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.users.exchange_primary_factor(\n user_id:\ \ \"${userId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// PUT /v1/users/{user_id}/exchange_primary_factor\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::users::ExchangePrimaryFactorRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.users.exchange_primary_factor(\n ExchangePrimaryFactorRequest{\n\ \ user_id: \"${userId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# PUT /v1/users/{user_id}/exchange_primary_factor\ncurl --request\ \ PUT \\\n --url https://test.stytch.com/v1/users/${userId}/exchange_primary_factor\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/users/emails/{email_id}: delete: summary: Deleteemail operationId: api_user_v1_DeleteEmail tags: - User description: Delete an email from a User. parameters: - name: email_id in: path required: true schema: type: string description: The `email_id` to be deleted. description: The `email_id` to be deleted. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_DeleteEmailResponse' '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/users/emails/{email_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email_id: \"${emailId}\",\n};\n\ \nclient.Users.DeleteEmail(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/users/emails/{email_id}\npackage main\n\nimport (\n\ \t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.DeleteEmailParams{\n\t\t\ EmailID: \"${emailId}\",\n\t}\n\n\tresp, err := client.Users.DeleteEmail(context.Background(),\ \ params)\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/users/emails/{email_id}\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.users.DeleteEmailRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteEmailRequest params = new\ \ DeleteEmailRequest();\n params.setEmailId(\"${emailId}\");\n\n\ \ Object result = StytchClient.getUsers().deleteEmail(params);\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/users/emails/{email_id}\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.users.DeleteEmailRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.deleteEmail(\n DeleteEmailRequest(\n\ \ emailId = \"${emailId}\",\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/users/emails/{email_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email_id: \"${emailId}\",\n};\n\ \nclient.users.deleteEmail(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->delete_email([\n 'email_id' => '${emailId}',\n\ ]);" - lang: python label: Python source: "# DELETE /v1/users/emails/{email_id}\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.users.delete_email(\n email_id=\"${emailId}\",\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/users/emails/{email_id}\nrequire 'stytch'\n\nclient\ \ = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.users.delete_email(\n email_id: \"${emailId}\"\n \ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/users/emails/{email_id}\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::users::DeleteEmailRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.users.delete_email(\n DeleteEmailRequest{\n \ \ email_id: \"${emailId}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# DELETE /v1/users/emails/{email_id}\ncurl --request DELETE \\\n\ \ --url https://test.stytch.com/v1/users/emails/${emailId} \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json'" /v1/users/phone_numbers/{phone_id}: delete: summary: Deletephonenumber operationId: api_user_v1_DeletePhoneNumber tags: - User description: Delete a phone number from a User. parameters: - name: phone_id in: path required: true schema: type: string description: The `phone_id` to be deleted. description: The `phone_id` to be deleted. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_DeletePhoneNumberResponse' '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/users/phone_numbers/{phone_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n phone_id: \"${phoneId}\",\n};\n\ \nclient.Users.DeletePhoneNumber(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/users/phone_numbers/{phone_id}\npackage main\n\nimport\ \ (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.DeletePhoneNumberParams{\n\ \t\tPhoneID: \"${phoneId}\",\n\t}\n\n\tresp, err := client.Users.DeletePhoneNumber(context.Background(),\ \ params)\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/users/phone_numbers/{phone_id}\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.users.DeletePhoneNumberRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeletePhoneNumberRequest params\ \ = new DeletePhoneNumberRequest();\n params.setPhoneId(\"${phoneId}\"\ );\n\n Object result = StytchClient.getUsers().deletePhoneNumber(params);\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/users/phone_numbers/{phone_id}\npackage com.example\n\ \nimport com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.users.DeletePhoneNumberRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.deletePhoneNumber(\n \ \ DeletePhoneNumberRequest(\n phoneId = \"${phoneId}\"\ ,\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/users/phone_numbers/{phone_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n phone_id: \"${phoneId}\",\n};\n\ \nclient.users.deletePhoneNumber(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->delete_phone_number([\n 'phone_id'\ \ => '${phoneId}',\n]);" - lang: python label: Python source: "# DELETE /v1/users/phone_numbers/{phone_id}\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.users.delete_phone_number(\n phone_id=\"${phoneId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/users/phone_numbers/{phone_id}\nrequire 'stytch'\n\n\ client = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.users.delete_phone_number(\n phone_id:\ \ \"${phoneId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/users/phone_numbers/{phone_id}\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::users::DeletePhoneNumberRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.users.delete_phone_number(\n DeletePhoneNumberRequest{\n\ \ phone_id: \"${phoneId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# DELETE /v1/users/phone_numbers/{phone_id}\ncurl --request DELETE\ \ \\\n --url https://test.stytch.com/v1/users/phone_numbers/${phoneId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/users/webauthn_registrations/{webauthn_registration_id}: delete: summary: Deletewebauthnregistration operationId: api_user_v1_DeleteWebAuthnRegistration tags: - User description: Delete a WebAuthn registration from a User. parameters: - name: webauthn_registration_id in: path required: true schema: type: string description: The `webauthn_registration_id` to be deleted. description: The `webauthn_registration_id` to be deleted. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_DeleteWebAuthnRegistrationResponse' '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/users/webauthn_registrations/{webauthn_registration_id}\n\ const stytch = require('stytch');\n\nconst client = new stytch.Client({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n webauthn_registration_id: \"${webauthnRegistrationId}\",\n};\n\n\ client.Users.DeleteWebAuthnRegistration(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/users/webauthn_registrations/{webauthn_registration_id}\n\ package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.DeleteWebAuthnRegistrationParams{\n\ \t\tWebAuthnRegistrationID: \"${webauthnRegistrationId}\",\n\t}\n\n\tresp,\ \ err := client.Users.DeleteWebAuthnRegistration(context.Background(), params)\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/users/webauthn_registrations/{webauthn_registration_id}\n\ package com.example;\n\nimport com.stytch.java.common.StytchResult;\nimport\ \ com.stytch.java.consumer.models.users.DeleteWebAuthnRegistrationRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteWebAuthnRegistrationRequest\ \ params = new DeleteWebAuthnRegistrationRequest();\n params.setWebAuthnRegistrationId(\"\ ${webauthnRegistrationId}\");\n\n Object result = StytchClient.getUsers().deleteWebAuthnRegistration(params);\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/users/webauthn_registrations/{webauthn_registration_id}\n\ package com.example\n\nimport com.stytch.java.consumer.StytchClient\nimport\ \ com.stytch.java.consumer.models.users.DeleteWebAuthnRegistrationRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.deleteWebAuthnRegistration(\n \ \ DeleteWebAuthnRegistrationRequest(\n webauthnRegistrationId\ \ = \"${webauthnRegistrationId}\",\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/users/webauthn_registrations/{webauthn_registration_id}\n\ const stytch = require('stytch');\n\nconst client = new stytch.Client({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n webauthn_registration_id: \"${webauthnRegistrationId}\",\n};\n\n\ client.users.deleteWebAuthnRegistration(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->delete_webauthn_registration([\n 'webauthn_registration_id'\ \ => '${webauthnRegistrationId}',\n]);" - lang: python label: Python source: "# DELETE /v1/users/webauthn_registrations/{webauthn_registration_id}\n\ from stytch import Client\n\nclient = Client(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.users.delete_webauthn_registration(\n\ \ webauthn_registration_id=\"${webauthnRegistrationId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/users/webauthn_registrations/{webauthn_registration_id}\n\ require 'stytch'\n\nclient = Stytch::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.users.delete_webauthn_registration(\n\ \ webauthn_registration_id: \"${webauthnRegistrationId}\"\n \n)\n\nputs\ \ resp" - lang: rust label: Rust source: "// DELETE /v1/users/webauthn_registrations/{webauthn_registration_id}\n\ use stytch::consumer::client::Client;\nuse stytch::consumer::users::DeleteWebAuthnRegistrationRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.users.delete_webauthn_registration(\n\ \ DeleteWebAuthnRegistrationRequest{\n webauthn_registration_id:\ \ \"${webauthnRegistrationId}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# DELETE /v1/users/webauthn_registrations/{webauthn_registration_id}\n\ curl --request DELETE \\\n --url https://test.stytch.com/v1/users/webauthn_registrations/${webauthnRegistrationId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/users/biometric_registrations/{biometric_registration_id}: delete: summary: Deletebiometricregistration operationId: api_user_v1_DeleteBiometricRegistration tags: - User description: Delete a biometric registration from a User. parameters: - name: biometric_registration_id in: path required: true schema: type: string description: The `biometric_registration_id` to be deleted. description: The `biometric_registration_id` to be deleted. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_DeleteBiometricRegistrationResponse' '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/users/biometric_registrations/{biometric_registration_id}\n\ const stytch = require('stytch');\n\nconst client = new stytch.Client({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n biometric_registration_id: \"${biometricRegistrationId}\",\n};\n\ \nclient.Users.DeleteBiometricRegistration(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/users/biometric_registrations/{biometric_registration_id}\n\ package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.DeleteBiometricRegistrationParams{\n\ \t\tBiometricRegistrationID: \"${biometricRegistrationId}\",\n\t}\n\n\t\ resp, err := client.Users.DeleteBiometricRegistration(context.Background(),\ \ params)\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/users/biometric_registrations/{biometric_registration_id}\n\ package com.example;\n\nimport com.stytch.java.common.StytchResult;\nimport\ \ com.stytch.java.consumer.models.users.DeleteBiometricRegistrationRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteBiometricRegistrationRequest\ \ params = new DeleteBiometricRegistrationRequest();\n params.setBiometricRegistrationId(\"\ ${biometricRegistrationId}\");\n\n Object result = StytchClient.getUsers().deleteBiometricRegistration(params);\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/users/biometric_registrations/{biometric_registration_id}\n\ package com.example\n\nimport com.stytch.java.consumer.StytchClient\nimport\ \ com.stytch.java.consumer.models.users.DeleteBiometricRegistrationRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.deleteBiometricRegistration(\n \ \ DeleteBiometricRegistrationRequest(\n biometricRegistrationId\ \ = \"${biometricRegistrationId}\",\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/users/biometric_registrations/{biometric_registration_id}\n\ const stytch = require('stytch');\n\nconst client = new stytch.Client({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n biometric_registration_id: \"${biometricRegistrationId}\",\n};\n\ \nclient.users.deleteBiometricRegistration(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->delete_biometric_registration([\n \ \ 'biometric_registration_id' => '${biometricRegistrationId}',\n]);" - lang: python label: Python source: "# DELETE /v1/users/biometric_registrations/{biometric_registration_id}\n\ from stytch import Client\n\nclient = Client(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.users.delete_biometric_registration(\n\ \ biometric_registration_id=\"${biometricRegistrationId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/users/biometric_registrations/{biometric_registration_id}\n\ require 'stytch'\n\nclient = Stytch::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.users.delete_biometric_registration(\n\ \ biometric_registration_id: \"${biometricRegistrationId}\"\n \n)\n\n\ puts resp" - lang: rust label: Rust source: "// DELETE /v1/users/biometric_registrations/{biometric_registration_id}\n\ use stytch::consumer::client::Client;\nuse stytch::consumer::users::DeleteBiometricRegistrationRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.users.delete_biometric_registration(\n\ \ DeleteBiometricRegistrationRequest{\n biometric_registration_id:\ \ \"${biometricRegistrationId}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# DELETE /v1/users/biometric_registrations/{biometric_registration_id}\n\ curl --request DELETE \\\n --url https://test.stytch.com/v1/users/biometric_registrations/${biometricRegistrationId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/users/totps/{totp_id}: delete: summary: Deletetotp operationId: api_user_v1_DeleteTOTP tags: - User description: Delete a TOTP from a User. parameters: - name: totp_id in: path required: true schema: type: string description: The `totp_id` to be deleted. description: The `totp_id` to be deleted. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_DeleteTOTPResponse' '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/users/totps/{totp_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n totp_id: \"${totpId}\",\n};\n\ \nclient.Users.DeleteTOTP(params)\n .then(resp => { console.log(resp) })\n\ \ .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/users/totps/{totp_id}\npackage main\n\nimport (\n\t\ \"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.DeleteTOTPParams{\n\t\t\ TOTPID: \"${totpId}\",\n\t}\n\n\tresp, err := client.Users.DeleteTOTP(context.Background(),\ \ params)\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/users/totps/{totp_id}\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.users.DeleteTOTPRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteTOTPRequest params = new\ \ DeleteTOTPRequest();\n params.setTOTPId(\"${totpId}\");\n\n \ \ Object result = StytchClient.getUsers().deleteTOTP(params);\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/users/totps/{totp_id}\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.users.DeleteTOTPRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.deleteTOTP(\n DeleteTOTPRequest(\n\ \ totpId = \"${totpId}\",\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/users/totps/{totp_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n totp_id: \"${totpId}\",\n};\n\ \nclient.users.deleteTOTP(params)\n .then(resp => { console.log(resp) })\n\ \ .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->delete_totp([\n 'totp_id' => '${totpId}',\n\ ]);" - lang: python label: Python source: "# DELETE /v1/users/totps/{totp_id}\nfrom stytch import Client\n\n\ client = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.users.delete_totp(\n totp_id=\"${totpId}\",\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/users/totps/{totp_id}\nrequire 'stytch'\n\nclient =\ \ Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.users.delete_totp(\n totp_id: \"${totpId}\"\n \n\ )\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/users/totps/{totp_id}\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::users::DeleteTOTPRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.users.delete_totp(\n DeleteTOTPRequest{\n \ \ totp_id: \"${totpId}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# DELETE /v1/users/totps/{totp_id}\ncurl --request DELETE \\\n --url\ \ https://test.stytch.com/v1/users/totps/${totpId} \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json'" /v1/users/crypto_wallets/{crypto_wallet_id}: delete: summary: Deletecryptowallet operationId: api_user_v1_DeleteCryptoWallet tags: - User description: Delete a crypto wallet from a User. parameters: - name: crypto_wallet_id in: path required: true schema: type: string description: The `crypto_wallet_id` to be deleted. description: The `crypto_wallet_id` to be deleted. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_DeleteCryptoWalletResponse' '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/users/crypto_wallets/{crypto_wallet_id}\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.Client({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n crypto_wallet_id:\ \ \"${cryptoWalletId}\",\n};\n\nclient.Users.DeleteCryptoWallet(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// DELETE /v1/users/crypto_wallets/{crypto_wallet_id}\npackage main\n\ \nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.DeleteCryptoWalletParams{\n\ \t\tCryptoWalletID: \"${cryptoWalletId}\",\n\t}\n\n\tresp, err := client.Users.DeleteCryptoWallet(context.Background(),\ \ params)\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/users/crypto_wallets/{crypto_wallet_id}\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.users.DeleteCryptoWalletRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteCryptoWalletRequest params\ \ = new DeleteCryptoWalletRequest();\n params.setCryptoWalletId(\"\ ${cryptoWalletId}\");\n\n Object result = StytchClient.getUsers().deleteCryptoWallet(params);\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/users/crypto_wallets/{crypto_wallet_id}\npackage com.example\n\ \nimport com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.users.DeleteCryptoWalletRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.deleteCryptoWallet(\n \ \ DeleteCryptoWalletRequest(\n cryptoWalletId = \"${cryptoWalletId}\"\ ,\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/users/crypto_wallets/{crypto_wallet_id}\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.Client({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n crypto_wallet_id:\ \ \"${cryptoWalletId}\",\n};\n\nclient.users.deleteCryptoWallet(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->users->delete_crypto_wallet([\n 'crypto_wallet_id'\ \ => '${cryptoWalletId}',\n]);" - lang: python label: Python source: "# DELETE /v1/users/crypto_wallets/{crypto_wallet_id}\nfrom stytch\ \ import Client\n\nclient = Client(\n project_id=\"${projectId}\",\n\ \ secret=\"${secret}\",\n)\n\nresp = client.users.delete_crypto_wallet(\n\ \ crypto_wallet_id=\"${cryptoWalletId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/users/crypto_wallets/{crypto_wallet_id}\nrequire 'stytch'\n\ \nclient = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.users.delete_crypto_wallet(\n crypto_wallet_id:\ \ \"${cryptoWalletId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/users/crypto_wallets/{crypto_wallet_id}\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::users::DeleteCryptoWalletRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.users.delete_crypto_wallet(\n DeleteCryptoWalletRequest{\n\ \ crypto_wallet_id: \"${cryptoWalletId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# DELETE /v1/users/crypto_wallets/{crypto_wallet_id}\ncurl --request\ \ DELETE \\\n --url https://test.stytch.com/v1/users/crypto_wallets/${cryptoWalletId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/users/passwords/{password_id}: delete: summary: Deletepassword operationId: api_user_v1_DeletePassword tags: - User description: Delete a password from a User. parameters: - name: password_id in: path required: true schema: type: string description: The `password_id` to be deleted. description: The `password_id` to be deleted. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_DeletePasswordResponse' '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/users/passwords/{password_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n password_id: \"${passwordId}\"\ ,\n};\n\nclient.Users.DeletePassword(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/users/passwords/{password_id}\npackage main\n\nimport\ \ (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.DeletePasswordParams{\n\t\ \tPasswordID: \"${passwordId}\",\n\t}\n\n\tresp, err := client.Users.DeletePassword(context.Background(),\ \ params)\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/users/passwords/{password_id}\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.users.DeletePasswordRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeletePasswordRequest params\ \ = new DeletePasswordRequest();\n params.setPasswordId(\"${passwordId}\"\ );\n\n Object result = StytchClient.getUsers().deletePassword(params);\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/users/passwords/{password_id}\npackage com.example\n\ \nimport com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.users.DeletePasswordRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.deletePassword(\n DeletePasswordRequest(\n\ \ passwordId = \"${passwordId}\",\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/users/passwords/{password_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n password_id: \"${passwordId}\"\ ,\n};\n\nclient.users.deletePassword(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->delete_password([\n 'password_id'\ \ => '${passwordId}',\n]);" - lang: python label: Python source: "# DELETE /v1/users/passwords/{password_id}\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.users.delete_password(\n password_id=\"${passwordId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/users/passwords/{password_id}\nrequire 'stytch'\n\n\ client = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.users.delete_password(\n password_id:\ \ \"${passwordId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/users/passwords/{password_id}\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::users::DeletePasswordRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.users.delete_password(\n DeletePasswordRequest{\n\ \ password_id: \"${passwordId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# DELETE /v1/users/passwords/{password_id}\ncurl --request DELETE\ \ \\\n --url https://test.stytch.com/v1/users/passwords/${passwordId} \\\ \n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/users/oauth/{oauth_user_registration_id}: delete: summary: Deleteoauthregistration operationId: api_user_v1_DeleteOAuthRegistration tags: - User description: Delete an OAuth registration from a User. parameters: - name: oauth_user_registration_id in: path required: true schema: type: string description: The `oauth_user_registration_id` to be deleted. description: The `oauth_user_registration_id` to be deleted. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_DeleteOAuthRegistrationResponse' '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/users/oauth/{oauth_user_registration_id}\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.Client({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n oauth_user_registration_id:\ \ \"${oauthUserRegistrationId}\",\n};\n\nclient.Users.DeleteOAuthRegistration(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// DELETE /v1/users/oauth/{oauth_user_registration_id}\npackage main\n\ \nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.DeleteOAuthRegistrationParams{\n\ \t\tOAuthUserRegistrationID: \"${oauthUserRegistrationId}\",\n\t}\n\n\t\ resp, err := client.Users.DeleteOAuthRegistration(context.Background(),\ \ params)\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/users/oauth/{oauth_user_registration_id}\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.users.DeleteOAuthRegistrationRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteOAuthRegistrationRequest\ \ params = new DeleteOAuthRegistrationRequest();\n params.setOAuthUserRegistrationId(\"\ ${oauthUserRegistrationId}\");\n\n Object result = StytchClient.getUsers().deleteOAuthRegistration(params);\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/users/oauth/{oauth_user_registration_id}\npackage com.example\n\ \nimport com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.users.DeleteOAuthRegistrationRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.deleteOAuthRegistration(\n \ \ DeleteOAuthRegistrationRequest(\n oauthUserRegistrationId\ \ = \"${oauthUserRegistrationId}\",\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/users/oauth/{oauth_user_registration_id}\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.Client({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n oauth_user_registration_id:\ \ \"${oauthUserRegistrationId}\",\n};\n\nclient.users.deleteOAuthRegistration(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->users->delete_oauth_registration([\n 'oauth_user_registration_id'\ \ => '${oauthUserRegistrationId}',\n]);" - lang: python label: Python source: "# DELETE /v1/users/oauth/{oauth_user_registration_id}\nfrom stytch\ \ import Client\n\nclient = Client(\n project_id=\"${projectId}\",\n\ \ secret=\"${secret}\",\n)\n\nresp = client.users.delete_oauth_registration(\n\ \ oauth_user_registration_id=\"${oauthUserRegistrationId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/users/oauth/{oauth_user_registration_id}\nrequire 'stytch'\n\ \nclient = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.users.delete_oauth_registration(\n \ \ oauth_user_registration_id: \"${oauthUserRegistrationId}\"\n \n)\n\n\ puts resp" - lang: rust label: Rust source: "// DELETE /v1/users/oauth/{oauth_user_registration_id}\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::users::DeleteOAuthRegistrationRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.users.delete_oauth_registration(\n DeleteOAuthRegistrationRequest{\n\ \ oauth_user_registration_id: \"${oauthUserRegistrationId}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# DELETE /v1/users/oauth/{oauth_user_registration_id}\ncurl --request\ \ DELETE \\\n --url https://test.stytch.com/v1/users/oauth/${oauthUserRegistrationId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/users/{user_id}/external_id: delete: summary: Deleteexternalid operationId: api_user_v1_DeleteExternalId tags: - User parameters: - name: user_id in: path required: true schema: type: string responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_DeleteExternalIdResponse' '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/users/{user_id}/external_id\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"TODO_MISSING_EXAMPLE_VALUE\"\ ,\n};\n\nclient.Users.DeleteExternalId(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/users/{user_id}/external_id\npackage main\n\nimport\ \ (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.DeleteExternalIDParams{\n\ \t\tUserID: \"TODO_MISSING_EXAMPLE_VALUE\",\n\t}\n\n\tresp, err := client.Users.DeleteExternalID(context.Background(),\ \ params)\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/users/{user_id}/external_id\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.users.DeleteExternalIdRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteExternalIdRequest params\ \ = new DeleteExternalIdRequest();\n params.setUserId(\"TODO_MISSING_EXAMPLE_VALUE\"\ );\n\n Object result = StytchClient.getUsers().deleteExternalId(params);\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/users/{user_id}/external_id\npackage com.example\n\n\ import com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.users.DeleteExternalIdRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.deleteExternalId(\n DeleteExternalIdRequest(\n\ \ userId = \"TODO_MISSING_EXAMPLE_VALUE\",\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/users/{user_id}/external_id\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"TODO_MISSING_EXAMPLE_VALUE\"\ ,\n};\n\nclient.users.deleteExternalId(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->delete_external_id([\n 'user_id' =>\ \ 'TODO_MISSING_EXAMPLE_VALUE',\n]);" - lang: python label: Python source: "# DELETE /v1/users/{user_id}/external_id\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.users.delete_external_id(\n user_id=\"TODO_MISSING_EXAMPLE_VALUE\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/users/{user_id}/external_id\nrequire 'stytch'\n\nclient\ \ = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.users.delete_external_id(\n user_id: \"TODO_MISSING_EXAMPLE_VALUE\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/users/{user_id}/external_id\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::users::DeleteExternalIdRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.users.delete_external_id(\n DeleteExternalIdRequest{\n\ \ user_id: \"TODO_MISSING_EXAMPLE_VALUE\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# DELETE /v1/users/{user_id}/external_id\ncurl --request DELETE \\\ \n --url https://test.stytch.com/v1/users/TODO_MISSING_EXAMPLE_VALUE/external_id\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/users/{user_id}/connected_apps: get: summary: Connectedapps operationId: api_user_v1_ConnectedApps tags: - User description: 'User Get Connected Apps retrieves a list of Connected Apps with which the User has successfully completed an authorization flow. If the User revokes a Connected App''s access (e.g. via the Revoke Connected App endpoint) then the Connected App will no longer be returned in the response.' parameters: - name: user_id in: path required: true schema: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_ConnectedAppsResponse' '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/users/{user_id}/connected_apps\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n};\n\ \nclient.Users.ConnectedApps(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/users/{user_id}/connected_apps\npackage main\n\nimport\ \ (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.ConnectedAppsParams{\n\t\ \tUserID: \"${userId}\",\n\t}\n\n\tresp, err := client.Users.ConnectedApps(context.Background(),\ \ params)\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/users/{user_id}/connected_apps\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.users.ConnectedAppsRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ConnectedAppsRequest params =\ \ new ConnectedAppsRequest();\n params.setUserId(\"${userId}\");\n\ \n Object result = StytchClient.getUsers().connectedApps(params);\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/users/{user_id}/connected_apps\npackage com.example\n\n\ import com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.users.ConnectedAppsRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.connectedApps(\n ConnectedAppsRequest(\n\ \ userId = \"${userId}\",\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: "// GET /v1/users/{user_id}/connected_apps\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n};\n\ \nclient.users.connectedApps(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->connected_apps([\n 'user_id' => '${userId}',\n\ ]);" - lang: python label: Python source: "# GET /v1/users/{user_id}/connected_apps\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.users.connected_apps(\n user_id=\"${userId}\",\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/users/{user_id}/connected_apps\nrequire 'stytch'\n\nclient\ \ = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.users.connected_apps(\n user_id: \"${userId}\"\n \ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/users/{user_id}/connected_apps\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::users::ConnectedAppsRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.users.connected_apps(\n ConnectedAppsRequest{\n \ \ user_id: \"${userId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/users/{user_id}/connected_apps\ncurl --request GET \\\n\ \ --url https://test.stytch.com/v1/users/${userId}/connected_apps \\\n\ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/users/{user_id}/connected_apps/{connected_app_id}/revoke: post: summary: Revoke operationId: api_user_v1_Revoke tags: - User description: 'Revoke Connected App revokes a Connected App''s access to a User and revokes all active tokens that have been created on the User''s behalf. New tokens cannot be created until the User completes a new authorization flow with the Connected App.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_user_v1_RevokeRequest' parameters: - name: user_id in: path required: true schema: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. - name: connected_app_id in: path required: true schema: type: string description: The ID of the Connected App. description: The ID of the Connected App. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_user_v1_RevokeResponse' '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: "// POST /v1/users/{user_id}/connected_apps/{connected_app_id}/revoke\n\ const stytch = require('stytch');\n\nconst client = new stytch.Client({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n user_id: \"${userId}\",\n connected_app_id: \"${exampleConnectedAppClientID}\"\ ,\n};\n\nclient.Users.Revoke(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/users/{user_id}/connected_apps/{connected_app_id}/revoke\n\ package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/users\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &users.RevokeParams{\n\t\tUserID:\ \ \"${userId}\",\n\t\tConnectedAppID: \"${exampleConnectedAppClientID}\"\ ,\n\t}\n\n\tresp, err := client.Users.Revoke(context.Background(), params)\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: "// POST /v1/users/{user_id}/connected_apps/{connected_app_id}/revoke\n\ package com.example;\n\nimport com.stytch.java.common.StytchResult;\nimport\ \ com.stytch.java.consumer.models.users.RevokeRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ RevokeRequest params = new RevokeRequest();\n params.setUserId(\"\ ${userId}\");\n params.setConnectedAppId(\"${exampleConnectedAppClientID}\"\ );\n\n Object result = StytchClient.getUsers().revoke(params);\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: "// POST /v1/users/{user_id}/connected_apps/{connected_app_id}/revoke\n\ package com.example\n\nimport com.stytch.java.consumer.StytchClient\nimport\ \ com.stytch.java.consumer.models.users.RevokeRequest\n\nfun main() {\n\ \ StytchClient.configure(\n projectId = \"${projectId}\",\n \ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.users.revoke(\n RevokeRequest(\n\ \ userId = \"${userId}\",\n connectedAppId\ \ = \"${exampleConnectedAppClientID}\",\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: "// POST /v1/users/{user_id}/connected_apps/{connected_app_id}/revoke\n\ const stytch = require('stytch');\n\nconst client = new stytch.Client({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n user_id: \"${userId}\",\n connected_app_id: \"${exampleConnectedAppClientID}\"\ ,\n};\n\nclient.users.revoke(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->users->revoke([\n 'user_id' => '${userId}',\n\ \ 'connected_app_id' => '${exampleConnectedAppClientID}',\n]);" - lang: python label: Python source: "# POST /v1/users/{user_id}/connected_apps/{connected_app_id}/revoke\n\ from stytch import Client\n\nclient = Client(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.users.revoke(\n user_id=\"\ ${userId}\",\n connected_app_id=\"${exampleConnectedAppClientID}\",\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/users/{user_id}/connected_apps/{connected_app_id}/revoke\n\ require 'stytch'\n\nclient = Stytch::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.users.revoke(\n user_id:\ \ \"${userId}\",\n connected_app_id: \"${exampleConnectedAppClientID}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/users/{user_id}/connected_apps/{connected_app_id}/revoke\n\ use stytch::consumer::client::Client;\nuse stytch::consumer::users::RevokeRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.users.revoke(\n RevokeRequest{\n\ \ user_id: \"${userId}\",\n connected_app_id: \"${exampleConnectedAppClientID}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/users/{user_id}/connected_apps/{connected_app_id}/revoke\n\ curl --request POST \\\n --url https://test.stytch.com/v1/users/${userId}/connected_apps/${exampleConnectedAppClientID}/revoke\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/sessions: get: summary: Get operationId: api_session_v1_Get tags: - Session description: List all active Sessions for a given `user_id`. All timestamps are formatted according to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. parameters: - name: user_id in: query required: true schema: type: string description: The `user_id` to get active Sessions for. You may use an `external_id` here if one is set for the user. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_session_v1_GetResponse' '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/sessions\nconst stytch = require('stytch');\n\nconst client\ \ = new stytch.Client({\n project_id: '${projectId}',\n secret: '${secret}',\n\ });\n\nconst params = {\n user_id: \"${userId}\",\n};\n\nclient.Sessions.Get(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/sessions\npackage main\n\nimport (\n\t\"context\"\n\t\"\ log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/sessions\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &sessions.GetParams{\n\t\tUserID:\ \ \"${userId}\",\n\t}\n\n\tresp, err := client.Sessions.Get(context.Background(),\ \ params)\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/sessions\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.sessions.GetRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ GetRequest params = new GetRequest();\n params.setUserId(\"\ ${userId}\");\n\n Object result = StytchClient.getSessions().get(params);\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/sessions\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.sessions.GetRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.sessions.get(\n GetRequest(\n\ \ userId = \"${userId}\",\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: "// GET /v1/sessions\nconst stytch = require('stytch');\n\nconst client\ \ = new stytch.Client({\n project_id: '${projectId}',\n secret: '${secret}',\n\ });\n\nconst params = {\n user_id: \"${userId}\",\n};\n\nclient.sessions.get(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->sessions->get([\n 'user_id' => '${userId}',\n\ ]);" - lang: python label: Python source: "# GET /v1/sessions\nfrom stytch import Client\n\nclient = Client(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.sessions.get(\n user_id=\"${userId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/sessions\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.sessions.get(\n\ \ user_id: \"${userId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/sessions\nuse stytch::consumer::client::Client;\nuse stytch::consumer::sessions::GetRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.sessions.get(\n GetRequest{\n\ \ user_id: \"${userId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/sessions\ncurl --request GET \\\n --url https://test.stytch.com/v1/sessions\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n --get \\\n --data-urlencode 'user_id=${userId}'" /v1/sessions/authenticate: post: summary: Authenticate operationId: api_session_v1_Authenticate tags: - Session description: 'Authenticate a session token or session JWT and retrieve associated session data. If `session_duration_minutes` is included, update the lifetime of the session to be that many minutes from now. All timestamps are formatted according to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. This endpoint requires exactly one `session_jwt` or `session_token` as part of the request. If both are included, you will receive a `too_many_session_arguments` error. You may provide a JWT that needs to be refreshed and is expired according to its `exp` claim. A new JWT will be returned if both the signature and the underlying Session are still valid. See our [How to use Stytch Session JWTs](https://stytch.com/docs/guides/sessions/using-jwts) guide for more information.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_session_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_session_v1_AuthenticateResponse' '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 /v1/sessions/revoke: post: summary: Revoke operationId: api_session_v1_Revoke tags: - Session description: 'Revoke a Session, immediately invalidating all of its session tokens. You can revoke a session in three ways: using its ID, or using one of its session tokens, or one of its JWTs. This endpoint requires exactly one of those to be included in the request. It will return an error if multiple are present.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_session_v1_RevokeRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_session_v1_RevokeResponse' '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: "// POST /v1/sessions/revoke\nconst stytch = require('stytch');\n\n\ const client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n session_token: \"${sessionToken}\"\ ,\n};\n\nclient.Sessions.Revoke(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/sessions/revoke\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/sessions\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &sessions.RevokeParams{\n\t\tSessionToken:\ \ \"${sessionToken}\",\n\t}\n\n\tresp, err := client.Sessions.Revoke(context.Background(),\ \ params)\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: "// POST /v1/sessions/revoke\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.sessions.RevokeRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ RevokeRequest params = new RevokeRequest();\n params.setSessionToken(\"\ ${sessionToken}\");\n\n Object result = StytchClient.getSessions().revoke(params);\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: "// POST /v1/sessions/revoke\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.sessions.RevokeRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.sessions.revoke(\n RevokeRequest(\n\ \ sessionToken = \"${sessionToken}\",\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: "// POST /v1/sessions/revoke\nconst stytch = require('stytch');\n\n\ const client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n session_token: \"${sessionToken}\"\ ,\n};\n\nclient.sessions.revoke(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sessions->revoke([\n 'session_token' => '${sessionToken}',\n\ ]);" - lang: python label: Python source: "# POST /v1/sessions/revoke\nfrom stytch import Client\n\nclient =\ \ Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\",\n\ )\n\nresp = client.sessions.revoke(\n session_token=\"${sessionToken}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/sessions/revoke\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.sessions.revoke(\n\ \ session_token: \"${sessionToken}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/sessions/revoke\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::sessions::RevokeRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.sessions.revoke(\n RevokeRequest{\n session_token:\ \ Some(String::from(\"${sessionToken}\")),\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/sessions/revoke\ncurl --request POST \\\n --url https://test.stytch.com/v1/sessions/revoke\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"session_token\": \"${sessionToken}\"\n }'" /v1/sessions/migrate: post: summary: Migrate operationId: api_session_v1_Migrate tags: - Session description: Migrate a session from an external OIDC compliant endpoint. Stytch will call the external UserInfo endpoint defined in your Stytch Project settings in the [Dashboard](https://stytch.com/dashboard), and then perform a lookup using the `session_token`. If the response contains a valid email address, Stytch will attempt to match that email address with an existing User and create a Stytch Session. You will need to create the user before using this endpoint. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_session_v1_MigrateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_session_v1_MigrateResponse' '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: "// POST /v1/sessions/migrate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n session_token: \"${sessionToken}\"\ ,\n};\n\nclient.Sessions.Migrate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/sessions/migrate\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/sessions\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &sessions.MigrateParams{\n\t\t\ SessionToken: \"${sessionToken}\",\n\t}\n\n\tresp, err := client.Sessions.Migrate(context.Background(),\ \ params)\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: "// POST /v1/sessions/migrate\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.sessions.MigrateRequest;\nimport\ \ com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n public\ \ static void main(String[] args) {\n StytchClient.configure(\"${projectId}\"\ , \"${secret}\");\n\n MigrateRequest params = new MigrateRequest();\n\ \ params.setSessionToken(\"${sessionToken}\");\n\n Object\ \ result = StytchClient.getSessions().migrate(params);\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: "// POST /v1/sessions/migrate\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.sessions.MigrateRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.sessions.migrate(\n MigrateRequest(\n\ \ sessionToken = \"${sessionToken}\",\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: "// POST /v1/sessions/migrate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n session_token: \"${sessionToken}\"\ ,\n};\n\nclient.sessions.migrate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sessions->migrate([\n 'session_token' =>\ \ '${sessionToken}',\n]);" - lang: python label: Python source: "# POST /v1/sessions/migrate\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.sessions.migrate(\n session_token=\"${sessionToken}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/sessions/migrate\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.sessions.migrate(\n\ \ session_token: \"${sessionToken}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/sessions/migrate\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::sessions::MigrateRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.sessions.migrate(\n MigrateRequest{\n \ \ session_token: \"${sessionToken}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/sessions/migrate\ncurl --request POST \\\n --url https://test.stytch.com/v1/sessions/migrate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"session_token\": \"${sessionToken}\"\n }'" /v1/sessions/exchange_access_token: post: summary: Exchangeaccesstoken operationId: api_session_v1_ExchangeAccessToken tags: - Session description: "Use this endpoint to exchange a Connected Apps Access Token back\ \ into a Stytch Session for the underlying User. \nThis session can be used\ \ with the Stytch SDKs and APIs.\n\nThe Access Token must contain the `full_access`\ \ scope (only available to First Party clients) and must not be more than\ \ 5 minutes old. Access Tokens may only be exchanged a single time." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_session_v1_ExchangeAccessTokenRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_session_v1_ExchangeAccessTokenResponse' '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: "// POST /v1/sessions/exchange_access_token\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n access_token: \"${sessionJwt}\"\ ,\n};\n\nclient.Sessions.ExchangeAccessToken(params)\n .then(resp => {\ \ console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/sessions/exchange_access_token\npackage main\n\nimport\ \ (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/sessions\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &sessions.ExchangeAccessTokenParams{\n\ \t\tAccessToken: \"${sessionJwt}\",\n\t}\n\n\tresp, err := client.Sessions.ExchangeAccessToken(context.Background(),\ \ params)\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: "// POST /v1/sessions/exchange_access_token\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.sessions.ExchangeAccessTokenRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ExchangeAccessTokenRequest params\ \ = new ExchangeAccessTokenRequest();\n params.setAccessToken(\"\ ${sessionJwt}\");\n\n Object result = StytchClient.getSessions().exchangeAccessToken(params);\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: "// POST /v1/sessions/exchange_access_token\npackage com.example\n\ \nimport com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.sessions.ExchangeAccessTokenRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.sessions.exchangeAccessToken(\n \ \ ExchangeAccessTokenRequest(\n accessToken = \"\ ${sessionJwt}\",\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: "// POST /v1/sessions/exchange_access_token\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n access_token: \"${sessionJwt}\"\ ,\n};\n\nclient.sessions.exchangeAccessToken(params)\n .then(resp => {\ \ console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sessions->exchange_access_token([\n 'access_token'\ \ => '${sessionJwt}',\n]);" - lang: python label: Python source: "# POST /v1/sessions/exchange_access_token\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.sessions.exchange_access_token(\n access_token=\"\ ${sessionJwt}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/sessions/exchange_access_token\nrequire 'stytch'\n\nclient\ \ = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.sessions.exchange_access_token(\n access_token: \"\ ${sessionJwt}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/sessions/exchange_access_token\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::sessions::ExchangeAccessTokenRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.sessions.exchange_access_token(\n ExchangeAccessTokenRequest{\n\ \ access_token: \"${sessionJwt}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/sessions/exchange_access_token\ncurl --request POST \\\ \n --url https://test.stytch.com/v1/sessions/exchange_access_token \\\n\ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"access_token\": \"${sessionJwt}\"\n }'" /v1/sessions/jwks/{project_id}: get: summary: Getjwks operationId: api_session_v1_GetJWKS tags: - Session description: 'Get the JSON Web Key Set (JWKS) for a project. Within the JWKS, the JSON Web Keys are rotated every ~6 months. Upon rotation, new JWTs will be signed using the new key, and both keys will be returned by this endpoint for a period of 1 month. JWTs have a set lifetime of 5 minutes, so there will be a 5 minute period where some JWTs will be signed by the old keys, and some JWTs will be signed by the new keys. The correct key to use for validation is determined by matching the `kid` value of the JWT and key. If you''re using one of our [backend SDKs](https://stytch.com/docs/b2b/sdks), the JSON Web Key (JWK) rotation will be handled for you. If you''re using your own JWT validation library, many have built-in support for JWK rotation, and you''ll just need to supply this API endpoint. If not, your application should decide which JWK to use for validation by inspecting the `kid` value. See our [How to use Stytch Session JWTs](https://stytch.com/docs/guides/sessions/using-jwts) guide for more information.' parameters: - name: project_id in: path required: true schema: type: string description: The `project_id` to get the JWKS for. description: The `project_id` to get the JWKS for. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_session_v1_GetJWKSResponse' '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/sessions/jwks/{project_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n project_id: \"${projectId}\"\ ,\n};\n\nclient.Sessions.GetJWKS(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/sessions/jwks/{project_id}\npackage main\n\nimport (\n\ \t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/sessions\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &sessions.GetJWKSParams{\n\t\t\ ProjectID: \"${projectId}\",\n\t}\n\n\tresp, err := client.Sessions.GetJWKS(context.Background(),\ \ params)\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/sessions/jwks/{project_id}\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.sessions.GetJWKSRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n GetJWKSRequest params = new GetJWKSRequest();\n\ \ params.setProjectId(\"${projectId}\");\n\n Object result\ \ = StytchClient.getSessions().getJWKS(params);\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/sessions/jwks/{project_id}\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.sessions.GetJWKSRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.sessions.getJWKS(\n GetJWKSRequest(\n\ \ projectId = \"${projectId}\",\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: "// GET /v1/sessions/jwks/{project_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n project_id: \"${projectId}\"\ ,\n};\n\nclient.sessions.getJWKS(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sessions->get_jwks([\n 'project_id' => '${projectId}',\n\ ]);" - lang: python label: Python source: "# GET /v1/sessions/jwks/{project_id}\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.sessions.get_jwks(\n project_id=\"${projectId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/sessions/jwks/{project_id}\nrequire 'stytch'\n\nclient\ \ = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.sessions.get_jwks(\n project_id: \"${projectId}\"\n\ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/sessions/jwks/{project_id}\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::sessions::GetJWKSRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.sessions.get_jwks(\n GetJWKSRequest{\n \ \ project_id: \"${projectId}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/sessions/jwks/{project_id}\ncurl --request GET \\\n --url\ \ https://test.stytch.com/v1/sessions/jwks/${projectId} \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json'" /v1/sessions/attest: post: summary: Attest operationId: api_session_v1_Attest tags: - Session description: Exchange an auth token issued by a trusted identity provider for a Stytch session. You must first register a Trusted Auth Token profile in the Stytch dashboard [here](https://stytch.com/dashboard/trusted-auth-tokens). If a session token or session JWT is provided, it will add the trusted auth token as an authentication factor to the existing session. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_session_v1_AttestRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_session_v1_AttestResponse' '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: "// POST /v1/sessions/attest\nconst stytch = require('stytch');\n\n\ const client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n profile_id: \"${profileId}\"\ ,\n token: \"${trustedAuthToken}\",\n session_duration_minutes: 60,\n\ };\n\nclient.Sessions.Attest(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/sessions/attest\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/sessions\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &sessions.AttestParams{\n\t\tProfileID:\ \ \"${profileId}\",\n\t\tToken: \"${trustedAuthToken}\"\ ,\n\t\tSessionDurationMinutes: 60,\n\t}\n\n\tresp, err := client.Sessions.Attest(context.Background(),\ \ params)\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: "// POST /v1/sessions/attest\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.sessions.AttestRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ AttestRequest params = new AttestRequest();\n params.setProfileId(\"\ ${profileId}\");\n params.setToken(\"${trustedAuthToken}\");\n \ \ params.setSessionDurationMinutes(60);\n\n Object result =\ \ StytchClient.getSessions().attest(params);\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: "// POST /v1/sessions/attest\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.sessions.AttestRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.sessions.attest(\n AttestRequest(\n\ \ profileId = \"${profileId}\",\n \ \ token = \"${trustedAuthToken}\",\n sessionDurationMinutes\ \ = 60,\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: "// POST /v1/sessions/attest\nconst stytch = require('stytch');\n\n\ const client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n profile_id: \"${profileId}\"\ ,\n token: \"${trustedAuthToken}\",\n session_duration_minutes: 60,\n\ };\n\nclient.sessions.attest(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sessions->attest([\n 'profile_id' => '${profileId}',\n\ \ 'token' => '${trustedAuthToken}',\n 'session_duration_minutes' =>\ \ 60,\n]);" - lang: python label: Python source: "# POST /v1/sessions/attest\nfrom stytch import Client\n\nclient =\ \ Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\",\n\ )\n\nresp = client.sessions.attest(\n profile_id=\"${profileId}\",\n\ \ token=\"${trustedAuthToken}\",\n session_duration_minutes=60,\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/sessions/attest\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.sessions.attest(\n\ \ profile_id: \"${profileId}\",\n token: \"${trustedAuthToken}\",\n session_duration_minutes:\ \ 60\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/sessions/attest\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::sessions::AttestRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.sessions.attest(\n AttestRequest{\n profile_id:\ \ \"${profileId}\",\n token: \"${trustedAuthToken}\",\n \ \ session_duration_minutes: 60,\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/sessions/attest\ncurl --request POST \\\n --url https://test.stytch.com/v1/sessions/attest\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"profile_id\": \"${profileId}\",\n \"token\": \"\ ${trustedAuthToken}\",\n \"session_duration_minutes\": 60\n }'" /v1/b2b/sessions: get: summary: Get operationId: api_b2b_session_v1_Get tags: - Session description: Retrieves all active Sessions for a Member. parameters: - name: organization_id in: query 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. - name: member_id in: query required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_GetResponse' '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/sessions\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 member_id: \"${memberId}\",\n};\n\nclient.Sessions.Get(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/b2b/sessions\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/sessions\"\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 := &sessions.GetParams{\n\t\tOrganizationID:\ \ \"${organizationId}\",\n\t\tMemberID: \"${memberId}\",\n\t}\n\n\t\ resp, err := client.Sessions.Get(context.Background(), params)\n\tif err\ \ != nil {\n\t\tlog.Fatalf(\"error in method call: %v\", err)\n\t}\n\n\t\ log.Println(resp)\n}\n" - lang: java label: Java source: "// GET /v1/b2b/sessions\npackage com.example;\n\nimport com.stytch.java.b2b.models.sessions.GetRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ GetRequest params = new GetRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setMemberId(\"${memberId}\");\n\n\ \ Object result = StytchB2BClient.getSessions().get(params);\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/sessions\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.b2b.models.sessions.GetRequest\n\nfun main() {\n\ \ StytchB2BClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.sessions.get(\n GetRequest(\n\ \ organizationId = \"${organizationId}\",\n \ \ memberId = \"${memberId}\",\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: "// GET /v1/b2b/sessions\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 member_id: \"${memberId}\",\n};\n\nclient.sessions.get(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sessions->get([\n 'organization_id' => '${organizationId}',\n\ \ 'member_id' => '${memberId}',\n]);" - lang: python label: Python source: "# GET /v1/b2b/sessions\nfrom stytch import B2BClient\n\nclient =\ \ B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.sessions.get(\n organization_id=\"${organizationId}\"\ ,\n member_id=\"${memberId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/sessions\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.sessions.get(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/sessions\nuse stytch::b2b::client::Client;\nuse stytch::b2b::sessions::GetRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.sessions.get(\n GetRequest{\n\ \ organization_id: \"${organizationId}\",\n member_id:\ \ \"${memberId}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/b2b/sessions\ncurl --request GET \\\n --url https://test.stytch.com/v1/b2b/sessions\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n --get \\\n --data-urlencode 'organization_id=${organizationId}'\ \ \\\n --data-urlencode 'member_id=${memberId}'" /v1/b2b/sessions/authenticate: post: summary: Authenticate operationId: api_b2b_session_v1_Authenticate tags: - Session description: 'Authenticates a Session and updates its lifetime by the specified `session_duration_minutes`. If the `session_duration_minutes` is not specified, a Session will not be extended. This endpoint requires either a `session_jwt` or `session_token` be included in the request. It will return an error if both are present. You may provide a JWT that needs to be refreshed and is expired according to its `exp` claim. A new JWT will be returned if both the signature and the underlying Session are still valid. See our [How to use Stytch Session JWTs](https://stytch.com/docs/b2b/guides/sessions/resources/using-jwts) guide for more information. If an `authorization_check` object is passed in, this method will also check if the Member is authorized to perform the given action on the given Resource in the specified Organization. A Member is authorized if their Member Session contains a Role, assigned [explicitly or implicitly](https://stytch.com/docs/b2b/guides/rbac/role-assignment), with adequate permissions. In addition, the `organization_id` passed in the authorization check must match the Member''s Organization. If the Member is not authorized to perform the specified action on the specified Resource, or if the `organization_id` does not match the Member''s Organization, a 403 error will be thrown. Otherwise, the response will contain a list of Roles that satisfied the authorization check.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_AuthenticateResponse' '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: "// POST /v1/b2b/sessions/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n session_token: \"${sessionToken}\"\ ,\n};\n\nclient.Sessions.Authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/sessions/authenticate\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/sessions\"\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 := &sessions.AuthenticateParams{\n\ \t\tSessionToken: \"${sessionToken}\",\n\t}\n\n\tresp, err := client.Sessions.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/b2b/sessions/authenticate\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.models.sessions.AuthenticateRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthenticateRequest params =\ \ new AuthenticateRequest();\n params.setSessionToken(\"${sessionToken}\"\ );\n\n Object result = StytchB2BClient.getSessions().authenticate(params);\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: "// POST /v1/b2b/sessions/authenticate\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.sessions.AuthenticateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.sessions.authenticate(\n \ \ AuthenticateRequest(\n sessionToken = \"${sessionToken}\"\ ,\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: "// POST /v1/b2b/sessions/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n session_token: \"${sessionToken}\"\ ,\n};\n\nclient.sessions.authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sessions->authenticate([\n 'session_token'\ \ => '${sessionToken}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/sessions/authenticate\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.sessions.authenticate(\n session_token=\"${sessionToken}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/sessions/authenticate\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.sessions.authenticate(\n session_token:\ \ \"${sessionToken}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/sessions/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::sessions::AuthenticateRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.sessions.authenticate(\n AuthenticateRequest{\n \ \ session_token: Some(String::from(\"${sessionToken}\")),\n \ \ ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/sessions/authenticate\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/b2b/sessions/authenticate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"session_token\"\ : \"${sessionToken}\"\n }'" /v1/b2b/sessions/revoke: post: summary: Revoke operationId: api_b2b_session_v1_Revoke tags: - Session description: Revoke a Session and immediately invalidate all its tokens. To revoke a specific Session, pass either the `member_session_id`, `session_token`, or `session_jwt`. To revoke all Sessions for a Member, pass the `member_id`. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_RevokeRequest' parameters: - 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_session_v1_RevokeResponse' '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: "// POST /v1/b2b/sessions/revoke\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n member_id: \"${memberId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.Sessions.Revoke(params, options)\n .then(resp => {\ \ console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/sessions/revoke\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/sessions\"\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 := &sessions.RevokeParams{\n\t\tMemberID:\ \ \"${memberId}\",\n\t}\n\n\toptions := &sessions.RevokeParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.Sessions.Revoke(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: "// POST /v1/b2b/sessions/revoke\npackage com.example;\n\nimport com.stytch.java.b2b.models.sessions.RevokeRequest;\n\ import com.stytch.java.b2b.models.sessions.RevokeRequestOptions;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n RevokeRequest params = new RevokeRequest();\n\ \ params.setMemberId(\"${memberId}\");\n\n RevokeRequestOptions\ \ options = new RevokeRequestOptions();\n Authorization authorization\ \ = new Authorization();\n authorization.setSessionToken(\"${sessionToken}\"\ );\n options.setAuthorization(authorization);\n\n Object result\ \ = StytchB2BClient.getSessions().revoke(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: "// POST /v1/b2b/sessions/revoke\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.b2b.models.sessions.RevokeRequest\nimport com.stytch.java.b2b.models.sessions.RevokeRequestOptions\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.sessions.revoke(\n RevokeRequest(\n\ \ memberId = \"${memberId}\",\n ),\n \ \ RevokeRequestOptions(\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: "// POST /v1/b2b/sessions/revoke\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n member_id: \"${memberId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.sessions.revoke(params, options)\n .then(resp => {\ \ console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sessions->revoke([\n 'member_id' => '${memberId}',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# POST /v1/b2b/sessions/revoke\nfrom stytch import B2BClient\nfrom\ \ stytch.b2b.models.sessions import RevokeRequestOptions\nfrom stytch.shared.method_options\ \ import Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.sessions.revoke(\n member_id=\"\ ${memberId}\",\n method_options=RevokeRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/sessions/revoke\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.sessions.revoke(\n\ \ member_id: \"${memberId}\",\n method_options: StytchB2B::Sessions::RevokeRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/sessions/revoke\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::sessions::RevokeRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.sessions.revoke(\n RevokeRequest{\n member_id:\ \ Some(String::from(\"${memberId}\")),\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/sessions/revoke\ncurl --request POST \\\n --url https://test.stytch.com/v1/b2b/sessions/revoke\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"member_id\": \"${memberId}\"\n }'" /v1/b2b/sessions/exchange: post: summary: Exchange operationId: api_b2b_session_v1_Exchange tags: - Session description: 'Use this endpoint to exchange a Member''s existing session for another session in a different Organization. This can be used to accept an invite, but not to create a new member via domain matching. To create a new member via email domain JIT Provisioning, use the [Exchange Intermediate Session](https://stytch.com/docs/b2b/api/exchange-intermediate-session) flow instead. If the user **has** already satisfied the authentication requirements of the Organization they are trying to switch into, this API will return `member_authenticated: true` and a `session_token` and `session_jwt`. If the user **has not** satisfied the primary or secondary authentication requirements of the Organization they are attempting to switch into, this API will return `member_authenticated: false` and an `intermediate_session_token`. If `primary_required` is set, prompt the user to fulfill the Organization''s auth requirements using the options returned in `primary_required.allowed_auth_methods`. If `primary_required` is null and `mfa_required` is set, check `mfa_required.member_options` to determine if the Member has SMS OTP or TOTP set up for MFA and prompt accordingly. If the Member has SMS OTP, check `mfa_required.secondary_auth_initiated` to see if the OTP has already been sent. Include the `intermediate_session_token` returned above when calling the `authenticate()` method that the user needed to perform. Once the user has completed the authentication requirements they were missing, they will be granted a full `session_token` and `session_jwt` to indicate they have successfully logged into the Organization. The `intermediate_session_token` can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to join a different Organization or create a new one. The `session_duration_minutes` and `session_custom_claims` parameters will be ignored.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_ExchangeRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_ExchangeResponse' '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: "// POST /v1/b2b/sessions/exchange\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 session_token: \"${sessionToken}\",\n};\n\nclient.Sessions.Exchange(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/sessions/exchange\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/sessions\"\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 := &sessions.ExchangeParams{\n\t\t\ OrganizationID: \"${organizationId}\",\n\t\tSessionToken: \"${sessionToken}\"\ ,\n\t}\n\n\tresp, err := client.Sessions.Exchange(context.Background(),\ \ params)\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: "// POST /v1/b2b/sessions/exchange\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.models.sessions.ExchangeRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ExchangeRequest params = new\ \ ExchangeRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n params.setSessionToken(\"${sessionToken}\");\n\n Object\ \ result = StytchB2BClient.getSessions().exchange(params);\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: "// POST /v1/b2b/sessions/exchange\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.sessions.ExchangeRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.sessions.exchange(\n ExchangeRequest(\n\ \ organizationId = \"${organizationId}\",\n \ \ sessionToken = \"${sessionToken}\",\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: "// POST /v1/b2b/sessions/exchange\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 session_token: \"${sessionToken}\",\n};\n\nclient.sessions.exchange(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->sessions->exchange([\n 'organization_id'\ \ => '${organizationId}',\n 'session_token' => '${sessionToken}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/sessions/exchange\nfrom stytch import B2BClient\n\n\ client = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.sessions.exchange(\n organization_id=\"${organizationId}\"\ ,\n session_token=\"${sessionToken}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/sessions/exchange\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.sessions.exchange(\n\ \ organization_id: \"${organizationId}\",\n session_token: \"${sessionToken}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/sessions/exchange\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::sessions::ExchangeRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.sessions.exchange(\n ExchangeRequest{\n organization_id:\ \ \"${organizationId}\",\n session_token: Some(String::from(\"\ ${sessionToken}\")),\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/sessions/exchange\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/b2b/sessions/exchange \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"organization_id\"\ : \"${organizationId}\",\n \"session_token\": \"${sessionToken}\"\n \ \ }'" /v1/b2b/sessions/exchange_access_token: post: summary: Exchangeaccesstoken operationId: api_b2b_session_v1_ExchangeAccessToken tags: - Session description: "Use this endpoint to exchange a Connected Apps Access Token back\ \ into a Member Session for the underlying Member. \nThis session can be used\ \ with the Stytch SDKs and APIs.\n\nThe Access Token must contain the `full_access`\ \ scope (only available to First Party clients) and must not be more than\ \ 5 minutes old. Access Tokens may only be exchanged a single time.\n\nBecause\ \ the Member previously completed MFA and satisfied all Organization authentication\ \ requirements at the time of the original Access Token issuance, this endpoint\ \ will never return an `intermediate_session_token` or require MFA." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_ExchangeAccessTokenRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_ExchangeAccessTokenResponse' '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: "// POST /v1/b2b/sessions/exchange_access_token\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n access_token: \"${sessionJwt}\"\ ,\n};\n\nclient.Sessions.ExchangeAccessToken(params)\n .then(resp => {\ \ console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/sessions/exchange_access_token\npackage main\n\n\ import (\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/sessions\"\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 := &sessions.ExchangeAccessTokenParams{\n\ \t\tAccessToken: \"${sessionJwt}\",\n\t}\n\n\tresp, err := client.Sessions.ExchangeAccessToken(context.Background(),\ \ params)\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: "// POST /v1/b2b/sessions/exchange_access_token\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.sessions.ExchangeAccessTokenRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ExchangeAccessTokenRequest params = new ExchangeAccessTokenRequest();\n\ \ params.setAccessToken(\"${sessionJwt}\");\n\n Object result\ \ = StytchB2BClient.getSessions().exchangeAccessToken(params);\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: "// POST /v1/b2b/sessions/exchange_access_token\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.sessions.ExchangeAccessTokenRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.sessions.exchangeAccessToken(\n \ \ ExchangeAccessTokenRequest(\n accessToken =\ \ \"${sessionJwt}\",\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: "// POST /v1/b2b/sessions/exchange_access_token\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n access_token: \"${sessionJwt}\"\ ,\n};\n\nclient.sessions.exchangeAccessToken(params)\n .then(resp => {\ \ console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sessions->exchange_access_token([\n 'access_token'\ \ => '${sessionJwt}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/sessions/exchange_access_token\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.sessions.exchange_access_token(\n\ \ access_token=\"${sessionJwt}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/sessions/exchange_access_token\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.sessions.exchange_access_token(\n access_token:\ \ \"${sessionJwt}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/sessions/exchange_access_token\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::sessions::ExchangeAccessTokenRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.sessions.exchange_access_token(\n ExchangeAccessTokenRequest{\n\ \ access_token: \"${sessionJwt}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/sessions/exchange_access_token\ncurl --request POST\ \ \\\n --url https://test.stytch.com/v1/b2b/sessions/exchange_access_token\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"access_token\": \"${sessionJwt}\"\n }'" /v1/b2b/sessions/attest: post: summary: Attest operationId: api_b2b_session_v1_Attest tags: - Session description: Exchange an auth token issued by a trusted identity provider for a Stytch session. You must first register a Trusted Auth Token profile in the Stytch dashboard [here](https://stytch.com/dashboard/trusted-auth-tokens). If a session token or session JWT is provided, it will add the trusted auth token as an authentication factor to the existing session. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_AttestRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_AttestResponse' '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: "// POST /v1/b2b/sessions/attest\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n profile_id: \"${profileId}\"\ ,\n token: \"${trustedAuthToken}\",\n organization_id: \"${organizationId}\"\ ,\n};\n\nclient.Sessions.Attest(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/sessions/attest\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/sessions\"\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 := &sessions.AttestParams{\n\t\tProfileID:\ \ \"${profileId}\",\n\t\tToken: \"${trustedAuthToken}\",\n\ \t\tOrganizationID: \"${organizationId}\",\n\t}\n\n\tresp, err := client.Sessions.Attest(context.Background(),\ \ params)\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: "// POST /v1/b2b/sessions/attest\npackage com.example;\n\nimport com.stytch.java.b2b.models.sessions.AttestRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ AttestRequest params = new AttestRequest();\n params.setProfileId(\"\ ${profileId}\");\n params.setToken(\"${trustedAuthToken}\");\n \ \ params.setOrganizationId(\"${organizationId}\");\n\n Object\ \ result = StytchB2BClient.getSessions().attest(params);\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: "// POST /v1/b2b/sessions/attest\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.b2b.models.sessions.AttestRequest\n\nfun main() {\n\ \ StytchB2BClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.sessions.attest(\n AttestRequest(\n\ \ profileId = \"${profileId}\",\n \ \ token = \"${trustedAuthToken}\",\n organizationId =\ \ \"${organizationId}\",\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: "// POST /v1/b2b/sessions/attest\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n profile_id: \"${profileId}\"\ ,\n token: \"${trustedAuthToken}\",\n organization_id: \"${organizationId}\"\ ,\n};\n\nclient.sessions.attest(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sessions->attest([\n 'profile_id' => '${profileId}',\n\ \ 'token' => '${trustedAuthToken}',\n 'organization_id' => '${organizationId}',\n\ ]);" - lang: python label: Python source: "# POST /v1/b2b/sessions/attest\nfrom stytch import B2BClient\n\n\ client = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.sessions.attest(\n profile_id=\"${profileId}\"\ ,\n token=\"${trustedAuthToken}\",\n organization_id=\"${organizationId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/sessions/attest\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.sessions.attest(\n\ \ profile_id: \"${profileId}\",\n token: \"${trustedAuthToken}\",\n organization_id:\ \ \"${organizationId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/sessions/attest\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::sessions::AttestRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.sessions.attest(\n AttestRequest{\n profile_id:\ \ \"${profileId}\",\n token: \"${trustedAuthToken}\",\n \ \ organization_id: Some(String::from(\"${organizationId}\")),\n \ \ ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/sessions/attest\ncurl --request POST \\\n --url https://test.stytch.com/v1/b2b/sessions/attest\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"profile_id\": \"${profileId}\",\n \"token\": \"\ ${trustedAuthToken}\",\n \"organization_id\": \"${organizationId}\"\n\ \ }'" /v1/b2b/sessions/migrate: post: summary: Migrate operationId: api_b2b_session_v1_Migrate tags: - Session description: 'Migrate a session from an external OIDC compliant endpoint. Stytch will call the external UserInfo endpoint defined in your Stytch Project settings in the [Dashboard](https://stytch.com/dashboard/migrations), and then perform a lookup using the `session_token`. If the response contains a valid email address, Stytch will attempt to match that email address with an existing Member in your Organization and create a Stytch Session. You will need to create the member before using this endpoint.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_MigrateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_MigrateResponse' '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: "// POST /v1/b2b/sessions/migrate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n session_token: \"${sessionToken}\"\ ,\n organization_id: \"${organizationId}\",\n};\n\nclient.Sessions.Migrate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/sessions/migrate\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/sessions\"\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 := &sessions.MigrateParams{\n\t\t\ SessionToken: \"${sessionToken}\",\n\t\tOrganizationID: \"${organizationId}\"\ ,\n\t}\n\n\tresp, err := client.Sessions.Migrate(context.Background(), params)\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: "// POST /v1/b2b/sessions/migrate\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.models.sessions.MigrateRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n MigrateRequest params = new MigrateRequest();\n\ \ params.setSessionToken(\"${sessionToken}\");\n params.setOrganizationId(\"\ ${organizationId}\");\n\n Object result = StytchB2BClient.getSessions().migrate(params);\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: "// POST /v1/b2b/sessions/migrate\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.b2b.models.sessions.MigrateRequest\n\nfun main()\ \ {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.sessions.migrate(\n MigrateRequest(\n\ \ sessionToken = \"${sessionToken}\",\n \ \ organizationId = \"${organizationId}\",\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: "// POST /v1/b2b/sessions/migrate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n session_token: \"${sessionToken}\"\ ,\n organization_id: \"${organizationId}\",\n};\n\nclient.sessions.migrate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->sessions->migrate([\n 'session_token' =>\ \ '${sessionToken}',\n 'organization_id' => '${organizationId}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/sessions/migrate\nfrom stytch import B2BClient\n\n\ client = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.sessions.migrate(\n session_token=\"${sessionToken}\"\ ,\n organization_id=\"${organizationId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/sessions/migrate\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.sessions.migrate(\n\ \ session_token: \"${sessionToken}\",\n organization_id: \"${organizationId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/sessions/migrate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::sessions::MigrateRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.sessions.migrate(\n MigrateRequest{\n session_token:\ \ \"${sessionToken}\",\n organization_id: \"${organizationId}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/sessions/migrate\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/b2b/sessions/migrate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"session_token\"\ : \"${sessionToken}\",\n \"organization_id\": \"${organizationId}\"\n\ \ }'" /v1/b2b/sessions/jwks/{project_id}: get: summary: Getjwks operationId: api_b2b_session_v1_GetJWKS tags: - Session description: 'Get the JSON Web Key Set (JWKS) for a project. Within the JWKS, the JSON Web Keys are rotated every ~6 months. Upon rotation, new JWTs will be signed using the new key, and both keys will be returned by this endpoint for a period of 1 month. JWTs have a set lifetime of 5 minutes, so there will be a 5 minute period where some JWTs will be signed by the old keys, and some JWTs will be signed by the new keys. The correct key to use for validation is determined by matching the `kid` value of the JWT and key. If you''re using one of our [backend SDKs](https://stytch.com/docs/b2b/sdks), the JSON Web Key (JWK) rotation will be handled for you. If you''re using your own JWT validation library, many have built-in support for JWK rotation, and you''ll just need to supply this API endpoint. If not, your application should decide which JWK to use for validation by inspecting the `kid` value. See our [How to use Stytch Session JWTs](https://stytch.com/docs/b2b/guides/sessions/resources/using-jwts) guide for more information.' parameters: - name: project_id in: path required: true schema: type: string description: The `project_id` to get the JWKS for. description: The `project_id` to get the JWKS for. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_session_v1_GetJWKSResponse' '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/sessions/jwks/{project_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n project_id: \"${projectId}\"\ ,\n};\n\nclient.Sessions.GetJWKS(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/b2b/sessions/jwks/{project_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/sessions\"\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 := &sessions.GetJWKSParams{\n\t\t\ ProjectID: \"${projectId}\",\n\t}\n\n\tresp, err := client.Sessions.GetJWKS(context.Background(),\ \ params)\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/sessions/jwks/{project_id}\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.sessions.GetJWKSRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n GetJWKSRequest params = new GetJWKSRequest();\n\ \ params.setProjectId(\"${projectId}\");\n\n Object result\ \ = StytchB2BClient.getSessions().getJWKS(params);\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/sessions/jwks/{project_id}\npackage com.example\n\n\ import com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.sessions.GetJWKSRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.sessions.getJWKS(\n GetJWKSRequest(\n\ \ projectId = \"${projectId}\",\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: "// GET /v1/b2b/sessions/jwks/{project_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n project_id: \"${projectId}\"\ ,\n};\n\nclient.sessions.getJWKS(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sessions->get_jwks([\n 'project_id' => '${projectId}',\n\ ]);" - lang: python label: Python source: "# GET /v1/b2b/sessions/jwks/{project_id}\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.sessions.get_jwks(\n project_id=\"${projectId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/sessions/jwks/{project_id}\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.sessions.get_jwks(\n project_id: \"${projectId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/sessions/jwks/{project_id}\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::sessions::GetJWKSRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.sessions.get_jwks(\n GetJWKSRequest{\n project_id:\ \ \"${projectId}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/b2b/sessions/jwks/{project_id}\ncurl --request GET \\\n\ \ --url https://test.stytch.com/v1/b2b/sessions/jwks/${projectId} \\\n\ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/impersonation/authenticate: post: summary: Authenticate operationId: api_b2b_impersonation_v1_Authenticate tags: - B2B Impersonation description: "Authenticate an impersonation token to impersonate a Member. This\ \ endpoint requires an impersonation token that is not expired or previously\ \ used. \nA Stytch session will be created for the impersonated member with\ \ a 60 minute duration. Impersonated sessions cannot be extended.\n\nPrior\ \ to this step, you can generate an impersonation token by visiting the Stytch\ \ Dashboard, viewing a member, and clicking the `Impersonate Member` button." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_impersonation_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_impersonation_v1_AuthenticateResponse' '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: "// POST /v1/b2b/impersonation/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n impersonation_token:\ \ \"${token}\",\n};\n\nclient.Impersonation.Authenticate(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/impersonation/authenticate\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/impersonation\"\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 := &impersonation.AuthenticateParams{\n\ \t\tImpersonationToken: \"${token}\",\n\t}\n\n\tresp, err := client.Impersonation.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/b2b/impersonation/authenticate\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.impersonation.AuthenticateRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ AuthenticateRequest params = new AuthenticateRequest();\n \ \ params.setImpersonationToken(\"${token}\");\n\n Object result\ \ = StytchB2BClient.getImpersonation().authenticate(params);\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: "// POST /v1/b2b/impersonation/authenticate\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.impersonation.AuthenticateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.impersonation.authenticate(\n \ \ AuthenticateRequest(\n impersonationToken = \"\ ${token}\",\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: "// POST /v1/b2b/impersonation/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n impersonation_token:\ \ \"${token}\",\n};\n\nclient.impersonation.authenticate(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->impersonation->authenticate([\n 'impersonation_token'\ \ => '${token}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/impersonation/authenticate\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.impersonation.authenticate(\n impersonation_token=\"\ ${token}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/impersonation/authenticate\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.impersonation.authenticate(\n impersonation_token:\ \ \"${token}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/impersonation/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::impersonation::AuthenticateRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.impersonation.authenticate(\n AuthenticateRequest{\n\ \ impersonation_token: \"${token}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/impersonation/authenticate\ncurl --request POST \\\ \n --url https://test.stytch.com/v1/b2b/impersonation/authenticate \\\n\ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"impersonation_token\": \"${token}\"\n }'" /v1/b2b/rbac/policy: get: summary: Policy operationId: api_b2b_rbac_v1_Policy tags: - B2B Rbac description: 'Get the active RBAC Policy for your current Stytch Project. An RBAC Policy is the canonical document that stores all defined Resources and Roles within your RBAC permissioning model. When using the backend SDKs, the RBAC Policy will be cached to allow for local evaluations, eliminating the need for an extra request to Stytch. The policy will be refreshed if an authorization check is requested and the RBAC policy was last updated more than 5 minutes ago. Resources and Roles can be created and managed within the [RBAC page](https://stytch.com/dashboard/rbac) in the Dashboard. Additionally, [Role assignment](https://stytch.com/docs/b2b/guides/rbac/role-assignment) can be programmatically managed through certain Stytch API endpoints. Check out the [RBAC overview](https://stytch.com/docs/b2b/guides/rbac/overview) to learn more about Stytch''s RBAC permissioning model.' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_rbac_v1_PolicyResponse' '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/rbac/policy\nconst stytch = require('stytch');\n\n\ const client = new stytch.B2BClient({\n project_id: '${projectId}',\n \ \ secret: '${secret}',\n});\n\nconst params = {\n};\n\nclient.RBAC.Policy(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/b2b/rbac/policy\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/rbac\"\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 := &rbac.PolicyParams{}\n\n\tresp,\ \ err := client.RBAC.Policy(context.Background(), params)\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/rbac/policy\npackage com.example;\n\nimport com.stytch.java.b2b.models.rbac.PolicyRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ PolicyRequest params = new PolicyRequest();\n\n Object result\ \ = StytchB2BClient.getRBAC().policy(params);\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/rbac/policy\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.b2b.models.rbac.PolicyRequest\n\nfun main() {\n \ \ StytchB2BClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.rbac.policy(\n PolicyRequest(),\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: "// GET /v1/b2b/rbac/policy\nconst stytch = require('stytch');\n\n\ const client = new stytch.B2BClient({\n project_id: '${projectId}',\n \ \ secret: '${secret}',\n});\n\nconst params = {\n};\n\nclient.rbac.policy(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: '$response = $client->rbac->policy([ ]);' - lang: python label: Python source: "# GET /v1/b2b/rbac/policy\nfrom stytch import B2BClient\n\nclient\ \ = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.rbac.policy()\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/rbac/policy\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.rbac.policy(\n\ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/rbac/policy\nuse stytch::b2b::client::Client;\nuse\ \ stytch::b2b::rbac::PolicyRequest;\n\nfn main() {\n let client = Client::new(\"\ ${projectId}\", \"${secret}\").unwrap();\n let resp = client.rbac.policy(\n\ \ PolicyRequest{\n ..Default::default()\n }\n \ \ ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/b2b/rbac/policy\ncurl --request GET \\\n --url https://test.stytch.com/v1/b2b/rbac/policy\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/rbac/organizations/{organization_id}: get: summary: Getorgpolicy operationId: api_b2b_rbac_v1_b2b_rbac_organizations_GetOrgPolicy tags: - B2B Rbac description: ' The organization RBAC policy feature is currently in private beta and must be enabled for your Workspace. Please contact Stytch support at support@stytch.com to request access. Get the active RBAC Policy for a specific Organization within your Stytch Project. An Organization RBAC Policy contains the roles that have been defined specifically for that organization, allowing for organization-specific permissioning models. This endpoint returns the organization-scoped roles that supplement the project-level RBAC policy. Organization policies allow you to define custom roles that are specific to individual organizations within your project. When using the backend SDKs, the RBAC Policy will be cached to allow for local evaluations, eliminating the need for an extra request to Stytch. The policy will be refreshed if an authorization check is requested and the RBAC policy was last updated more than 5 minutes ago. Organization-specific roles can be created and managed through this API endpoint, providing fine-grained control over permissions at the organization level. Check out the [RBAC overview](https://stytch.com/docs/b2b/guides/rbac/overview) to learn more about Stytch''s RBAC permissioning model and organization-scoped policies.' 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. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_rbac_v1_b2b_rbac_organizations_GetOrgPolicyResponse' '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/rbac/organizations/{organization_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};\n\nclient.RBAC.Organizations.GetOrgPolicy(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/b2b/rbac/organizations/{organization_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/rbac/organizations\"\ \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 := &organizations.GetOrgPolicyParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t}\n\n\tresp, err := client.RBAC.Organizations.GetOrgPolicy(context.Background(),\ \ params)\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/rbac/organizations/{organization_id}\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.rbacorganizations.GetOrgPolicyRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ GetOrgPolicyRequest params = new GetOrgPolicyRequest();\n \ \ params.setOrganizationId(\"${organizationId}\");\n\n Object result\ \ = StytchB2BClient.getRBAC().getOrganizations().getOrgPolicy(params);\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/rbac/organizations/{organization_id}\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.rbacorganizations.GetOrgPolicyRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.rbac.organizations.getOrgPolicy(\n \ \ GetOrgPolicyRequest(\n organizationId =\ \ \"${organizationId}\",\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: "// GET /v1/b2b/rbac/organizations/{organization_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};\n\nclient.rbac.organizations.getOrgPolicy(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->rbac->organizations->get_org_policy([\n 'organization_id'\ \ => '${organizationId}',\n]);" - lang: python label: Python source: "# GET /v1/b2b/rbac/organizations/{organization_id}\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.rbac.organizations.get_org_policy(\n\ \ organization_id=\"${organizationId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/rbac/organizations/{organization_id}\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.rbac.organizations.get_org_policy(\n\ \ organization_id: \"${organizationId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/rbac/organizations/{organization_id}\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::rbac_organizations::GetOrgPolicyRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.rbac.organizations.get_org_policy(\n GetOrgPolicyRequest{\n\ \ organization_id: \"${organizationId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/b2b/rbac/organizations/{organization_id}\ncurl --request\ \ GET \\\n --url https://test.stytch.com/v1/b2b/rbac/organizations/${organizationId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" put: summary: Setorgpolicy operationId: api_b2b_rbac_v1_b2b_rbac_organizations_SetOrgPolicy tags: - B2B Rbac description: ' The organization RBAC policy feature is currently in private beta and must be enabled for your Workspace. Please contact Stytch support at support@stytch.com to request access. Set the RBAC Policy for a specific Organization within your Stytch Project. An Organization RBAC Policy allows you to define roles that are specific to that organization, providing fine-grained control over permissions at the organization level. This endpoint allows you to create, update, or replace the organization-scoped roles for a given organization. Organization policies supplement the project-level RBAC policy with additional roles that are only applicable within the context of that specific organization. The organization policy consists of roles, where each role defines: - A unique `role_id` to identify the role - A human-readable `description` of the role''s purpose - A set of `permissions` that specify which actions can be performed on which resources When you set an organization policy, it will replace any existing organization-specific roles for that organization. The project-level RBAC policy remains unchanged. Organization-specific roles are useful for scenarios where different organizations within your project require different permission structures, such as: - Multi-tenant applications with varying access levels per tenant - Organizations with custom approval workflows - Different organizational hierarchies requiring unique role definitions Check out the [RBAC overview](https://stytch.com/docs/b2b/guides/rbac/overview) to learn more about Stytch''s RBAC permissioning model and organization-scoped policies.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_rbac_v1_b2b_rbac_organizations_SetOrgPolicyRequest' 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. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_rbac_v1_b2b_rbac_organizations_SetOrgPolicyResponse' '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/rbac/organizations/{organization_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 org_policy: TODO_MISSING_EXAMPLE_VALUE,\n};\n\ \nclient.RBAC.Organizations.SetOrgPolicy(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// PUT /v1/b2b/rbac/organizations/{organization_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/rbac/organizations\"\ \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 := &organizations.SetOrgPolicyParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tOrgPolicy: TODO_MISSING_EXAMPLE_VALUE,\n\ \t}\n\n\tresp, err := client.RBAC.Organizations.SetOrgPolicy(context.Background(),\ \ params)\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/rbac/organizations/{organization_id}\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.rbacorganizations.SetOrgPolicyRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ SetOrgPolicyRequest params = new SetOrgPolicyRequest();\n \ \ params.setOrganizationId(\"${organizationId}\");\n params.setOrgPolicy(TODO_MISSING_EXAMPLE_VALUE);\n\ \n Object result = StytchB2BClient.getRBAC().getOrganizations().setOrgPolicy(params);\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/rbac/organizations/{organization_id}\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.rbacorganizations.SetOrgPolicyRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.rbac.organizations.setOrgPolicy(\n \ \ SetOrgPolicyRequest(\n organizationId =\ \ \"${organizationId}\",\n orgPolicy = TODO_MISSING_EXAMPLE_VALUE,\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/rbac/organizations/{organization_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 org_policy: TODO_MISSING_EXAMPLE_VALUE,\n};\n\ \nclient.rbac.organizations.setOrgPolicy(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->rbac->organizations->set_org_policy([\n 'organization_id'\ \ => '${organizationId}',\n 'org_policy' => TODO_MISSING_EXAMPLE_VALUE,\n\ ]);" - lang: python label: Python source: "# PUT /v1/b2b/rbac/organizations/{organization_id}\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.rbac.organizations.set_org_policy(\n\ \ organization_id=\"${organizationId}\",\n org_policy=TODO_MISSING_EXAMPLE_VALUE,\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# PUT /v1/b2b/rbac/organizations/{organization_id}\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.rbac.organizations.set_org_policy(\n\ \ organization_id: \"${organizationId}\",\n org_policy: TODO_MISSING_EXAMPLE_VALUE\n\ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// PUT /v1/b2b/rbac/organizations/{organization_id}\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::rbac_organizations::SetOrgPolicyRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.rbac.organizations.set_org_policy(\n SetOrgPolicyRequest{\n\ \ organization_id: \"${organizationId}\",\n org_policy:\ \ TODO_MISSING_EXAMPLE_VALUE,\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# PUT /v1/b2b/rbac/organizations/{organization_id}\ncurl --request\ \ PUT \\\n --url https://test.stytch.com/v1/b2b/rbac/organizations/${organizationId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"org_policy\": TODO_MISSING_EXAMPLE_VALUE\n }'" /v1/b2b/recovery_codes/recover: post: summary: Recover operationId: api_b2b_recovery_codes_v1_Recover tags: - B2B Recovery Codes description: Allows a Member to complete an MFA flow by consuming a recovery code. This consumes the recovery code and returns a session token that can be used to authenticate the Member. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_recovery_codes_v1_RecoverRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_recovery_codes_v1_RecoverResponse' '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: "// POST /v1/b2b/recovery_codes/recover\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 member_id: \"${memberId}\",\n recovery_code: \"\ ${exampleTotpRecoveryCode}\",\n};\n\nclient.RecoveryCodes.Recover(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/recovery_codes/recover\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/recoverycodes\"\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 := &recoverycodes.RecoverParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t\tRecoveryCode: \"${exampleTotpRecoveryCode}\",\n\t}\n\n\tresp, err\ \ := client.RecoveryCodes.Recover(context.Background(), params)\n\tif err\ \ != nil {\n\t\tlog.Fatalf(\"error in method call: %v\", err)\n\t}\n\n\t\ log.Println(resp)\n}\n" - lang: java label: Java source: "// POST /v1/b2b/recovery_codes/recover\npackage com.example;\n\n\ import com.stytch.java.b2b.models.recoverycodes.RecoverRequest;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ RecoverRequest params = new RecoverRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setMemberId(\"${memberId}\");\n \ \ params.setRecoveryCode(\"${exampleTotpRecoveryCode}\");\n\n \ \ Object result = StytchB2BClient.getRecoveryCodes().recover(params);\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: "// POST /v1/b2b/recovery_codes/recover\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.recoverycodes.RecoverRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.recoveryCodes.recover(\n \ \ RecoverRequest(\n organizationId = \"${organizationId}\"\ ,\n memberId = \"${memberId}\",\n \ \ recoveryCode = \"${exampleTotpRecoveryCode}\",\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: "// POST /v1/b2b/recovery_codes/recover\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 member_id: \"${memberId}\",\n recovery_code: \"\ ${exampleTotpRecoveryCode}\",\n};\n\nclient.recoveryCodes.recover(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->recovery_codes->recover([\n 'organization_id'\ \ => '${organizationId}',\n 'member_id' => '${memberId}',\n 'recovery_code'\ \ => '${exampleTotpRecoveryCode}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/recovery_codes/recover\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.recovery_codes.recover(\n organization_id=\"${organizationId}\"\ ,\n member_id=\"${memberId}\",\n recovery_code=\"${exampleTotpRecoveryCode}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/recovery_codes/recover\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.recovery_codes.recover(\n organization_id:\ \ \"${organizationId}\",\n member_id: \"${memberId}\",\n recovery_code:\ \ \"${exampleTotpRecoveryCode}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/recovery_codes/recover\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::recovery_codes::RecoverRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.recovery_codes.recover(\n RecoverRequest{\n \ \ organization_id: \"${organizationId}\",\n member_id:\ \ \"${memberId}\",\n recovery_code: \"${exampleTotpRecoveryCode}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/recovery_codes/recover\ncurl --request POST \\\n \ \ --url https://test.stytch.com/v1/b2b/recovery_codes/recover \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"organization_id\"\ : \"${organizationId}\",\n \"member_id\": \"${memberId}\",\n \"recovery_code\"\ : \"${exampleTotpRecoveryCode}\"\n }'" /v1/b2b/recovery_codes/{organization_id}/{member_id}: get: summary: Get operationId: api_b2b_recovery_codes_v1_Get tags: - B2B Recovery Codes description: Returns a Member's full set of active recovery codes. 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: member_id in: path required: true schema: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_recovery_codes_v1_GetResponse' '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/recovery_codes/{organization_id}/{member_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 member_id: \"${memberId}\"\ ,\n};\n\nclient.RecoveryCodes.Get(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/b2b/recovery_codes/{organization_id}/{member_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/recoverycodes\"\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 := &recoverycodes.GetParams{\n\t\t\ OrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t}\n\n\tresp, err := client.RecoveryCodes.Get(context.Background(),\ \ params)\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/recovery_codes/{organization_id}/{member_id}\npackage\ \ com.example;\n\nimport com.stytch.java.b2b.models.recoverycodes.GetRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ GetRequest params = new GetRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setMemberId(\"${memberId}\");\n\n\ \ Object result = StytchB2BClient.getRecoveryCodes().get(params);\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/recovery_codes/{organization_id}/{member_id}\npackage\ \ com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.recoverycodes.GetRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.recoveryCodes.get(\n GetRequest(\n\ \ organizationId = \"${organizationId}\",\n \ \ memberId = \"${memberId}\",\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: "// GET /v1/b2b/recovery_codes/{organization_id}/{member_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 member_id: \"${memberId}\"\ ,\n};\n\nclient.recoveryCodes.get(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->recovery_codes->get([\n 'organization_id'\ \ => '${organizationId}',\n 'member_id' => '${memberId}',\n]);" - lang: python label: Python source: "# GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\nfrom\ \ stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.recovery_codes.get(\n \ \ organization_id=\"${organizationId}\",\n member_id=\"${memberId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\nrequire\ \ 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.recovery_codes.get(\n organization_id:\ \ \"${organizationId}\",\n member_id: \"${memberId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\nuse\ \ stytch::b2b::client::Client;\nuse stytch::b2b::recovery_codes::GetRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.recovery_codes.get(\n GetRequest{\n\ \ organization_id: \"${organizationId}\",\n member_id:\ \ \"${memberId}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\ncurl\ \ --request GET \\\n --url https://test.stytch.com/v1/b2b/recovery_codes/${organizationId}/${memberId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/recovery_codes/rotate: post: summary: Rotate operationId: api_b2b_recovery_codes_v1_Rotate tags: - B2B Recovery Codes description: Rotate a Member's recovery codes. This invalidates all existing recovery codes and generates a new set of recovery codes. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_recovery_codes_v1_RotateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_recovery_codes_v1_RotateResponse' '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: "// POST /v1/b2b/recovery_codes/rotate\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 member_id: \"${memberId}\",\n};\n\nclient.RecoveryCodes.Rotate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/recovery_codes/rotate\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/recoverycodes\"\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 := &recoverycodes.RotateParams{\n\t\ \tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\"\ ,\n\t}\n\n\tresp, err := client.RecoveryCodes.Rotate(context.Background(),\ \ params)\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: "// POST /v1/b2b/recovery_codes/rotate\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.models.recoverycodes.RotateRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n RotateRequest params = new RotateRequest();\n\ \ params.setOrganizationId(\"${organizationId}\");\n params.setMemberId(\"\ ${memberId}\");\n\n Object result = StytchB2BClient.getRecoveryCodes().rotate(params);\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: "// POST /v1/b2b/recovery_codes/rotate\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.recoverycodes.RotateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.recoveryCodes.rotate(\n \ \ RotateRequest(\n organizationId = \"${organizationId}\"\ ,\n memberId = \"${memberId}\",\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: "// POST /v1/b2b/recovery_codes/rotate\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 member_id: \"${memberId}\",\n};\n\nclient.recoveryCodes.rotate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->recovery_codes->rotate([\n 'organization_id'\ \ => '${organizationId}',\n 'member_id' => '${memberId}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/recovery_codes/rotate\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.recovery_codes.rotate(\n organization_id=\"${organizationId}\"\ ,\n member_id=\"${memberId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/recovery_codes/rotate\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.recovery_codes.rotate(\n organization_id:\ \ \"${organizationId}\",\n member_id: \"${memberId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/recovery_codes/rotate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::recovery_codes::RotateRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.recovery_codes.rotate(\n RotateRequest{\n \ \ organization_id: \"${organizationId}\",\n member_id: \"\ ${memberId}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/recovery_codes/rotate\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/b2b/recovery_codes/rotate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"organization_id\"\ : \"${organizationId}\",\n \"member_id\": \"${memberId}\"\n }'" /v1/b2b/totp: post: summary: Create operationId: api_b2b_totp_v1_Create tags: - B2B Totp description: "Create a new TOTP instance for a Member. The Member can use the\ \ authenticator application of their choice to scan the QR code or enter the\ \ secret. \n\nIf the Member already has an active MFA factor, then passing\ \ an intermediate session token, session token, or session JWT with the existing\ \ MFA factor on it is required to prevent bypassing MFA. \n\nOtherwise, passing\ \ an intermediate session token, session token, or session JWT is not required,\ \ but if passed must match the `member_id` passed." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_totp_v1_CreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_totp_v1_CreateResponse' '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: "// POST /v1/b2b/totp\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 member_id: \"${memberId}\",\n};\n\nclient.TOTPs.Create(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/totp\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/totps\"\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 := &totps.CreateParams{\n\t\tOrganizationID:\ \ \"${organizationId}\",\n\t\tMemberID: \"${memberId}\",\n\t}\n\n\t\ resp, err := client.TOTPs.Create(context.Background(), params)\n\tif err\ \ != nil {\n\t\tlog.Fatalf(\"error in method call: %v\", err)\n\t}\n\n\t\ log.Println(resp)\n}\n" - lang: java label: Java source: "// POST /v1/b2b/totp\npackage com.example;\n\nimport com.stytch.java.b2b.models.totps.CreateRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ CreateRequest params = new CreateRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setMemberId(\"${memberId}\");\n\n\ \ Object result = StytchB2BClient.getTOTPs().create(params);\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: "// POST /v1/b2b/totp\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.b2b.models.totps.CreateRequest\n\nfun main() {\n\ \ StytchB2BClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.totps.create(\n CreateRequest(\n\ \ organizationId = \"${organizationId}\",\n \ \ memberId = \"${memberId}\",\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: "// POST /v1/b2b/totp\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 member_id: \"${memberId}\",\n};\n\nclient.totps.create(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->totps->create([\n 'organization_id' => '${organizationId}',\n\ \ 'member_id' => '${memberId}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/totp\nfrom stytch import B2BClient\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.totps.create(\n organization_id=\"${organizationId}\",\n \ \ member_id=\"${memberId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/totp\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.totps.create(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/totp\nuse stytch::b2b::client::Client;\nuse stytch::b2b::totps::CreateRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.totps.create(\n CreateRequest{\n\ \ organization_id: \"${organizationId}\",\n member_id:\ \ \"${memberId}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/totp\ncurl --request POST \\\n --url https://test.stytch.com/v1/b2b/totp\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"organization_id\": \"${organizationId}\",\n \"member_id\"\ : \"${memberId}\"\n }'" /v1/b2b/totp/authenticate: post: summary: Authenticate operationId: api_b2b_totp_v1_Authenticate tags: - B2B Totp description: Authenticate a Member provided TOTP. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_totp_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_totp_v1_AuthenticateResponse' '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: "// POST /v1/b2b/totp/authenticate\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 member_id: \"${memberId}\",\n code: \"${exampleCode}\"\ ,\n intermediate_session_token: \"${token}\",\n};\n\nclient.TOTPs.Authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/totp/authenticate\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/totps\"\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 := &totps.AuthenticateParams{\n\t\t\ OrganizationID: \"${organizationId}\",\n\t\tMemberID: \ \ \"${memberId}\",\n\t\tCode: \"${exampleCode}\"\ ,\n\t\tIntermediateSessionToken: \"${token}\",\n\t}\n\n\tresp, err := client.TOTPs.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/b2b/totp/authenticate\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.models.totps.AuthenticateRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthenticateRequest params =\ \ new AuthenticateRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n params.setMemberId(\"${memberId}\");\n params.setCode(\"\ ${exampleCode}\");\n params.setIntermediateSessionToken(\"${token}\"\ );\n\n Object result = StytchB2BClient.getTOTPs().authenticate(params);\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: "// POST /v1/b2b/totp/authenticate\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.totps.AuthenticateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.totps.authenticate(\n AuthenticateRequest(\n\ \ organizationId = \"${organizationId}\",\n \ \ memberId = \"${memberId}\",\n code = \"${exampleCode}\"\ ,\n intermediateSessionToken = \"${token}\",\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: "// POST /v1/b2b/totp/authenticate\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 member_id: \"${memberId}\",\n code: \"${exampleCode}\"\ ,\n intermediate_session_token: \"${token}\",\n};\n\nclient.totps.authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->totps->authenticate([\n 'organization_id'\ \ => '${organizationId}',\n 'member_id' => '${memberId}',\n 'code'\ \ => '${exampleCode}',\n 'intermediate_session_token' => '${token}',\n\ ]);" - lang: python label: Python source: "# POST /v1/b2b/totp/authenticate\nfrom stytch import B2BClient\n\n\ client = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.totps.authenticate(\n organization_id=\"${organizationId}\"\ ,\n member_id=\"${memberId}\",\n code=\"${exampleCode}\",\n intermediate_session_token=\"\ ${token}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/totp/authenticate\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.totps.authenticate(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ ,\n code: \"${exampleCode}\",\n intermediate_session_token: \"${token}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/totp/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::totps::AuthenticateRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.totps.authenticate(\n AuthenticateRequest{\n \ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ ,\n code: \"${exampleCode}\",\n intermediate_session_token:\ \ Some(String::from(\"${token}\")),\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/totp/authenticate\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/b2b/totp/authenticate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"organization_id\"\ : \"${organizationId}\",\n \"member_id\": \"${memberId}\",\n \"code\"\ : \"${exampleCode}\",\n \"intermediate_session_token\": \"${token}\"\n\ \ }'" /v1/b2b/totp/migrate: post: summary: Migrate operationId: api_b2b_totp_v1_Migrate tags: - B2B Totp description: Migrate an existing TOTP instance for a Member. Recovery codes are not required and will be minted for the Member if not provided. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_totp_v1_MigrateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_totp_v1_MigrateResponse' '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: "// POST /v1/b2b/totp/migrate\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 member_id: \"${memberId}\",\n secret: \"${secret}\"\ ,\n recovery_codes: [\"ckss-2skx-ebow\", \"spbc-424h-usy0\", \"hi08-n5tk-lns5\"\ ],\n};\n\nclient.TOTPs.Migrate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/totp/migrate\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/totps\"\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 := &totps.MigrateParams{\n\t\tOrganizationID:\ \ \"${organizationId}\",\n\t\tMemberID: \"${memberId}\",\n\t\tSecret:\ \ \"${secret}\",\n\t\tRecoveryCodes: []string{\"ckss-2skx-ebow\"\ , \"spbc-424h-usy0\", \"hi08-n5tk-lns5\"},\n\t}\n\n\tresp, err := client.TOTPs.Migrate(context.Background(),\ \ params)\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: "// POST /v1/b2b/totp/migrate\npackage com.example;\n\nimport com.stytch.java.b2b.models.totps.MigrateRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ MigrateRequest params = new MigrateRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setMemberId(\"${memberId}\");\n \ \ params.setSecret(\"${secret}\");\n params.setRecoveryCodes(new\ \ String(\"ckss-2skx-ebow\", \"spbc-424h-usy0\", \"hi08-n5tk-lns5\"));\n\ \n Object result = StytchB2BClient.getTOTPs().migrate(params);\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: "// POST /v1/b2b/totp/migrate\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.b2b.models.totps.MigrateRequest\n\nfun main() {\n\ \ StytchB2BClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.totps.migrate(\n MigrateRequest(\n\ \ organizationId = \"${organizationId}\",\n \ \ memberId = \"${memberId}\",\n secret = \"\ ${secret}\",\n recoveryCodes = arrayOf(\"ckss-2skx-ebow\"\ , \"spbc-424h-usy0\", \"hi08-n5tk-lns5\"),\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: "// POST /v1/b2b/totp/migrate\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 member_id: \"${memberId}\",\n secret: \"${secret}\"\ ,\n recovery_codes: [\"ckss-2skx-ebow\", \"spbc-424h-usy0\", \"hi08-n5tk-lns5\"\ ],\n};\n\nclient.totps.migrate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->totps->migrate([\n 'organization_id' => '${organizationId}',\n\ \ 'member_id' => '${memberId}',\n 'secret' => '${secret}',\n 'recovery_codes'\ \ => ['ckss-2skx-ebow', 'spbc-424h-usy0', 'hi08-n5tk-lns5'],\n]);" - lang: python label: Python source: "# POST /v1/b2b/totp/migrate\nfrom stytch import B2BClient\n\nclient\ \ = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.totps.migrate(\n organization_id=\"${organizationId}\"\ ,\n member_id=\"${memberId}\",\n secret=\"${secret}\",\n recovery_codes=[\"\ ckss-2skx-ebow\", \"spbc-424h-usy0\", \"hi08-n5tk-lns5\"],\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/totp/migrate\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.totps.migrate(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ ,\n secret: \"${secret}\",\n recovery_codes: ['ckss-2skx-ebow', 'spbc-424h-usy0',\ \ 'hi08-n5tk-lns5']\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/totp/migrate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::totps::MigrateRequest;\n\nfn main() {\n let client =\ \ Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp =\ \ client.totps.migrate(\n MigrateRequest{\n organization_id:\ \ \"${organizationId}\",\n member_id: \"${memberId}\",\n \ \ secret: \"${secret}\",\n recovery_codes: vec![\"ckss-2skx-ebow\"\ , \"spbc-424h-usy0\", \"hi08-n5tk-lns5\"],\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/totp/migrate\ncurl --request POST \\\n --url https://test.stytch.com/v1/b2b/totp/migrate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"organization_id\": \"${organizationId}\",\n \"member_id\"\ : \"${memberId}\",\n \"secret\": \"${secret}\",\n \"recovery_codes\"\ : [\"ckss-2skx-ebow\", \"spbc-424h-usy0\", \"hi08-n5tk-lns5\"]\n }'" /v1/rbac/policy: get: summary: Policy operationId: api_consumer_rbac_v1_Policy tags: - Consumer Rbac description: 'Get the active RBAC Policy for your current Stytch Project. An RBAC Policy is the canonical document that stores all defined Resources and Roles within your RBAC permissioning model. When using the backend SDKs, the RBAC Policy will be cached to allow for local evaluations, eliminating the need for an extra request to Stytch. The policy will be refreshed if an authorization check is requested and the RBAC policy was last updated more than 5 minutes ago. Resources and Roles can be created and managed within the [RBAC page](https://stytch.com/dashboard/rbac) in the Dashboard. Additionally, [Role assignment](https://stytch.com/docs/guides/rbac/role-assignment) can be programmatically managed through certain Stytch API endpoints. Check out the [RBAC overview](https://stytch.com/docs/guides/rbac/overview) to learn more about Stytch''s RBAC permissioning model.' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_consumer_rbac_v1_PolicyResponse' '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/rbac/policy\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n};\n\nclient.RBAC.Policy(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/rbac/policy\npackage main\n\nimport (\n\t\"context\"\n\ \t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/rbac\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &rbac.PolicyParams{}\n\n\tresp,\ \ err := client.RBAC.Policy(context.Background(), params)\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/rbac/policy\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.rbac.PolicyRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ PolicyRequest params = new PolicyRequest();\n\n Object result\ \ = StytchClient.getRBAC().policy(params);\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/rbac/policy\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.rbac.PolicyRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.rbac.policy(\n PolicyRequest(),\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: "// GET /v1/rbac/policy\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n};\n\nclient.rbac.policy(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: '$response = $client->rbac->policy([ ]);' - lang: python label: Python source: "# GET /v1/rbac/policy\nfrom stytch import Client\n\nclient = Client(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.rbac.policy()\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/rbac/policy\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.rbac.policy(\n\ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/rbac/policy\nuse stytch::consumer::client::Client;\nuse\ \ stytch::consumer::rbac::PolicyRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.rbac.policy(\n PolicyRequest{\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/rbac/policy\ncurl --request GET \\\n --url https://test.stytch.com/v1/rbac/policy\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/crypto_wallets/authenticate/start: post: summary: Authenticatestart operationId: api_crypto_wallet_v1_AuthenticateStart tags: - Crypto Wallet description: 'Initiate the authentication of a crypto wallet. After calling this endpoint, the user will need to sign a message containing the returned `challenge` field. For Ethereum crypto wallets, you can optionally use the Sign In With Ethereum (SIWE) protocol for the message by passing in the `siwe_params`. The only required fields are `domain` and `uri`. If the crypto wallet detects that the domain in the message does not match the website''s domain, it will display a warning to the user. If not using the SIWE protocol, the message will simply consist of the project name and a random string.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_crypto_wallet_v1_AuthenticateStartRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_crypto_wallet_v1_AuthenticateStartResponse' '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: "// POST /v1/crypto_wallets/authenticate/start\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n crypto_wallet_type: \"ethereum\"\ ,\n crypto_wallet_address: \"${exampleEthereumAddress}\",\n};\n\nclient.CryptoWallets.AuthenticateStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/crypto_wallets/authenticate/start\npackage main\n\nimport\ \ (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/cryptowallets\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &cryptowallets.AuthenticateStartParams{\n\ \t\tCryptoWalletType: \"ethereum\",\n\t\tCryptoWalletAddress: \"${exampleEthereumAddress}\"\ ,\n\t}\n\n\tresp, err := client.CryptoWallets.AuthenticateStart(context.Background(),\ \ params)\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: "// POST /v1/crypto_wallets/authenticate/start\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.cryptowallets.AuthenticateStartRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthenticateStartRequest params\ \ = new AuthenticateStartRequest();\n params.setCryptoWalletType(\"\ ethereum\");\n params.setCryptoWalletAddress(\"${exampleEthereumAddress}\"\ );\n\n Object result = StytchClient.getCryptoWallets().authenticateStart(params);\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: "// POST /v1/crypto_wallets/authenticate/start\npackage com.example\n\ \nimport com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.cryptowallets.AuthenticateStartRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.cryptoWallets.authenticateStart(\n \ \ AuthenticateStartRequest(\n cryptoWalletType\ \ = \"ethereum\",\n cryptoWalletAddress = \"${exampleEthereumAddress}\"\ ,\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: "// POST /v1/crypto_wallets/authenticate/start\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n crypto_wallet_type: \"ethereum\"\ ,\n crypto_wallet_address: \"${exampleEthereumAddress}\",\n};\n\nclient.cryptoWallets.authenticateStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->crypto_wallets->authenticate_start([\n 'crypto_wallet_type'\ \ => 'ethereum',\n 'crypto_wallet_address' => '${exampleEthereumAddress}',\n\ ]);" - lang: python label: Python source: "# POST /v1/crypto_wallets/authenticate/start\nfrom stytch import\ \ Client\n\nclient = Client(\n project_id=\"${projectId}\",\n secret=\"\ ${secret}\",\n)\n\nresp = client.crypto_wallets.authenticate_start(\n \ \ crypto_wallet_type=\"ethereum\",\n crypto_wallet_address=\"${exampleEthereumAddress}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/crypto_wallets/authenticate/start\nrequire 'stytch'\n\n\ client = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.crypto_wallets.authenticate_start(\n\ \ crypto_wallet_type: \"ethereum\",\n crypto_wallet_address: \"${exampleEthereumAddress}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/crypto_wallets/authenticate/start\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::crypto_wallets::AuthenticateStartRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.crypto_wallets.authenticate_start(\n AuthenticateStartRequest{\n\ \ crypto_wallet_type: \"ethereum\",\n crypto_wallet_address:\ \ \"${exampleEthereumAddress}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/crypto_wallets/authenticate/start\ncurl --request POST\ \ \\\n --url https://test.stytch.com/v1/crypto_wallets/authenticate/start\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"crypto_wallet_type\": \"ethereum\",\n \"crypto_wallet_address\"\ : \"${exampleEthereumAddress}\"\n }'" /v1/crypto_wallets/authenticate: post: summary: Authenticate operationId: api_crypto_wallet_v1_Authenticate tags: - Crypto Wallet description: Complete the authentication of a crypto wallet by passing the signature. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_crypto_wallet_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_crypto_wallet_v1_AuthenticateResponse' '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: "// POST /v1/crypto_wallets/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n crypto_wallet_type: \"ethereum\"\ ,\n crypto_wallet_address: \"${exampleEthereumAddress}\",\n signature:\ \ \"${exampleEthereumSignature}\",\n session_duration_minutes: 60,\n};\n\ \nclient.CryptoWallets.Authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/crypto_wallets/authenticate\npackage main\n\nimport (\n\ \t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/cryptowallets\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &cryptowallets.AuthenticateParams{\n\ \t\tCryptoWalletType: \"ethereum\",\n\t\tCryptoWalletAddress: \"\ ${exampleEthereumAddress}\",\n\t\tSignature: \"${exampleEthereumSignature}\"\ ,\n\t\tSessionDurationMinutes: 60,\n\t}\n\n\tresp, err := client.CryptoWallets.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/crypto_wallets/authenticate\npackage com.example;\n\n\ import com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.cryptowallets.AuthenticateRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthenticateRequest params =\ \ new AuthenticateRequest();\n params.setCryptoWalletType(\"ethereum\"\ );\n params.setCryptoWalletAddress(\"${exampleEthereumAddress}\"\ );\n params.setSignature(\"${exampleEthereumSignature}\");\n \ \ params.setSessionDurationMinutes(60);\n\n Object result = StytchClient.getCryptoWallets().authenticate(params);\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: "// POST /v1/crypto_wallets/authenticate\npackage com.example\n\n\ import com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.cryptowallets.AuthenticateRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.cryptoWallets.authenticate(\n \ \ AuthenticateRequest(\n cryptoWalletType = \"ethereum\"\ ,\n cryptoWalletAddress = \"${exampleEthereumAddress}\"\ ,\n signature = \"${exampleEthereumSignature}\",\n \ \ sessionDurationMinutes = 60,\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: "// POST /v1/crypto_wallets/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n crypto_wallet_type: \"ethereum\"\ ,\n crypto_wallet_address: \"${exampleEthereumAddress}\",\n signature:\ \ \"${exampleEthereumSignature}\",\n session_duration_minutes: 60,\n};\n\ \nclient.cryptoWallets.authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->crypto_wallets->authenticate([\n 'crypto_wallet_type'\ \ => 'ethereum',\n 'crypto_wallet_address' => '${exampleEthereumAddress}',\n\ \ 'signature' => '${exampleEthereumSignature}',\n 'session_duration_minutes'\ \ => 60,\n]);" - lang: python label: Python source: "# POST /v1/crypto_wallets/authenticate\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.crypto_wallets.authenticate(\n crypto_wallet_type=\"\ ethereum\",\n crypto_wallet_address=\"${exampleEthereumAddress}\",\n\ \ signature=\"${exampleEthereumSignature}\",\n session_duration_minutes=60,\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/crypto_wallets/authenticate\nrequire 'stytch'\n\nclient\ \ = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.crypto_wallets.authenticate(\n crypto_wallet_type:\ \ \"ethereum\",\n crypto_wallet_address: \"${exampleEthereumAddress}\"\ ,\n signature: \"${exampleEthereumSignature}\",\n session_duration_minutes:\ \ 60\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/crypto_wallets/authenticate\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::crypto_wallets::AuthenticateRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.crypto_wallets.authenticate(\n AuthenticateRequest{\n\ \ crypto_wallet_type: \"ethereum\",\n crypto_wallet_address:\ \ \"${exampleEthereumAddress}\",\n signature: \"${exampleEthereumSignature}\"\ ,\n session_duration_minutes: 60,\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/crypto_wallets/authenticate\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/crypto_wallets/authenticate \\\n -u\ \ '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n\ \ -d '{\n \"crypto_wallet_type\": \"ethereum\",\n \"crypto_wallet_address\"\ : \"${exampleEthereumAddress}\",\n \"signature\": \"${exampleEthereumSignature}\"\ ,\n \"session_duration_minutes\": 60\n }'" /v1/debug/whoami: get: summary: Whoami operationId: api_debug_v1_Whoami tags: - Debug responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_debug_v1_WhoamiResponse' '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/debug/whoami\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n};\n\nclient.Debug.Whoami(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/debug/whoami\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/consumer/debug\"\n)\n\n\ func 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 := &debug.WhoamiParams{}\n\n\tresp,\ \ err := client.Debug.Whoami(context.Background(), params)\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/debug/whoami\npackage com.example;\n\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.debug.WhoamiRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ WhoamiRequest params = new WhoamiRequest();\n\n Object result\ \ = StytchB2BClient.getDebug().whoami(params);\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/debug/whoami\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.consumer.models.debug.WhoamiRequest\n\nfun main()\ \ {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.debug.whoami(\n WhoamiRequest(),\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: "// GET /v1/debug/whoami\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n};\n\nclient.debug.whoami(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: '$response = $client->debug->whoami([ ]);' - lang: python label: Python source: "# GET /v1/debug/whoami\nfrom stytch import B2BClient\n\nclient =\ \ B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.debug.whoami()\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/debug/whoami\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.debug.whoami(\n\ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/debug/whoami\nuse stytch::b2b::client::Client;\nuse stytch::consumer::debug::WhoamiRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.debug.whoami(\n WhoamiRequest{\n\ \ ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/debug/whoami\ncurl --request GET \\\n --url https://test.stytch.com/v1/debug/whoami\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/discovery/intermediate_sessions/exchange: post: summary: Exchange operationId: api_discovery_v1_discovery_intermediate_sessions_Exchange tags: - Discovery description: 'Exchange an Intermediate Session for a fully realized [Member Session](https://stytch.com/docs/b2b/api/session-object) for the [Organization](https://stytch.com/docs/b2b/api/organization-object) that the user wishes to log into. This endpoint can be used to accept invites and JIT Provision into a new Organization on the basis of the user''s email domain or OAuth tenant. If the user **has** already satisfied the authentication requirements of the Organization they are trying to exchange into and logged in with a method that verifies their email address, this API will return `member_authenticated: true` and a `session_token` and `session_jwt`. If the user **has not** satisfied the primary or secondary authentication requirements of the Organization they are attempting to exchange into or is JIT Provisioning but did not log in via a method that provides email verification, this API will return `member_authenticated: false` and an `intermediate_session_token`. If `primary_required` is returned, prompt the user to fulfill the Organization''s auth requirements using the options returned in `primary_required.allowed_auth_methods`. If `primary_required` is null and `mfa_required` is set, check `mfa_required.member_options` to determine if the Member has SMS OTP or TOTP set up for MFA and prompt accordingly. If the Member has SMS OTP, check `mfa_required.secondary_auth_initiated` to see if the OTP has already been sent. Include the `intermediate_session_token` returned above when calling the `authenticate()` method that the user needed to perform. Once the user has completed the authentication requirements they were missing, they will be granted a full `session_token` and `session_jwt` to indicate they have successfully logged into the Organization. The `intermediate_session_token` can also be used with the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization instead of joining an existing one.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_discovery_v1_discovery_intermediate_sessions_ExchangeRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_discovery_v1_discovery_intermediate_sessions_ExchangeResponse' '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: "// POST /v1/b2b/discovery/intermediate_sessions/exchange\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n intermediate_session_token:\ \ \"${token}\",\n organization_id: \"${organizationId}\",\n};\n\nclient.Discovery.IntermediateSessions.Exchange(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/discovery/intermediate_sessions/exchange\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/discovery/intermediatesessions\"\ \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 := &intermediatesessions.ExchangeParams{\n\ \t\tIntermediateSessionToken: \"${token}\",\n\t\tOrganizationID: \ \ \"${organizationId}\",\n\t}\n\n\tresp, err := client.Discovery.IntermediateSessions.Exchange(context.Background(),\ \ params)\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: "// POST /v1/b2b/discovery/intermediate_sessions/exchange\npackage\ \ com.example;\n\nimport com.stytch.java.b2b.models.discoveryintermediatesessions.ExchangeRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ExchangeRequest params = new ExchangeRequest();\n params.setIntermediateSessionToken(\"\ ${token}\");\n params.setOrganizationId(\"${organizationId}\");\n\ \n Object result = StytchB2BClient.getDiscovery().getIntermediateSessions().exchange(params);\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: "// POST /v1/b2b/discovery/intermediate_sessions/exchange\npackage\ \ com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.discoveryintermediatesessions.ExchangeRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.discovery.intermediateSessions.exchange(\n\ \ ExchangeRequest(\n intermediateSessionToken\ \ = \"${token}\",\n organizationId = \"${organizationId}\"\ ,\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: "// POST /v1/b2b/discovery/intermediate_sessions/exchange\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n intermediate_session_token:\ \ \"${token}\",\n organization_id: \"${organizationId}\",\n};\n\nclient.discovery.intermediateSessions.exchange(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->discovery->intermediate_sessions->exchange([\n\ \ 'intermediate_session_token' => '${token}',\n 'organization_id'\ \ => '${organizationId}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/discovery/intermediate_sessions/exchange\nfrom stytch\ \ import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.discovery.intermediate_sessions.exchange(\n\ \ intermediate_session_token=\"${token}\",\n organization_id=\"${organizationId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/discovery/intermediate_sessions/exchange\nrequire\ \ 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.discovery.intermediate_sessions.exchange(\n\ \ intermediate_session_token: \"${token}\",\n organization_id: \"${organizationId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/discovery/intermediate_sessions/exchange\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::discovery_intermediate_sessions::ExchangeRequest;\n\nfn\ \ main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.discovery.intermediate_sessions.exchange(\n\ \ ExchangeRequest{\n intermediate_session_token: \"${token}\"\ ,\n organization_id: \"${organizationId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/discovery/intermediate_sessions/exchange\ncurl --request\ \ POST \\\n --url https://test.stytch.com/v1/b2b/discovery/intermediate_sessions/exchange\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"intermediate_session_token\": \"${token}\",\n \"\ organization_id\": \"${organizationId}\"\n }'" /v1/b2b/discovery/organizations/create: post: summary: Create operationId: api_discovery_v1_discovery_organizations_Create tags: - Discovery description: "This endpoint allows you to exchange the `intermediate_session_token`\ \ returned when the user successfully completes a Discovery authentication\ \ flow to create a new\n[Organization](https://stytch.com/docs/b2b/api/organization-object)\ \ and [Member](https://stytch.com/docs/b2b/api/member-object) and log the\ \ user in. If the user wants to log into an existing Organization, use the\ \ [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)\ \ instead.\n\nStytch **requires that users verify their email address** prior\ \ to creating a new Organization in order to prevent Account Takeover (ATO)\ \ attacks and phishing.\n\nIf the user authenticated using a method that **does\ \ not** provide real-time email verification (returning password auth, Github/Slack/Hubspot\ \ OAuth) this API will return `member_authenticated: false` and an `intermediate_session_token`\ \ to indicate that the user must perform additional authentication via one\ \ of the options listed in `primary_required.allowed_auth_methods` to finish\ \ logging in.\n\nIf you specified an `mfa_policy: REQUIRED_FOR_ALL` in the\ \ request, this API will return `member_authenticated: false`, an `intermediate_session_token`,\ \ and `mfa_required` in order to indicate that you must prompt the user to\ \ enroll in MFA.\n\nInclude the `intermediate_session_token` when calling\ \ the `authenticate()` method that the user needed to perform to verify their\ \ email or enroll in MFA. Once the user has completed the authentication requirements\ \ they were missing, they will be granted a full `session_token` and `session_jwt`\ \ and be successfully logged in.\n\nIf the user logged in with a method that\ \ **does** provide real-time email verification (Email Magic Links, Email\ \ OTP, Google/Microsoft OAuth, initial email verification when creating a\ \ new password) this API will return `member_authenticated: true` and a `session_jwt`\ \ and `session_token` to indicate that the user has successfully logged in.\n\ \nThe Member created by this endpoint will automatically be granted the `stytch_admin`\ \ Role. See the \n[RBAC guide](https://stytch.com/docs/b2b/guides/rbac/stytch-default)\ \ for more details on this Role." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_discovery_v1_discovery_organizations_CreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_discovery_v1_discovery_organizations_CreateResponse' '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: "// POST /v1/b2b/discovery/organizations/create\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n intermediate_session_token:\ \ \"${token}\",\n organization_name: \"${organizationName}\",\n organization_slug:\ \ \"${organizationSlug}\",\n organization_external_id: \"my-external-id\"\ ,\n};\n\nclient.Discovery.Organizations.Create(params)\n .then(resp =>\ \ { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/discovery/organizations/create\npackage main\n\n\ import (\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/discovery/organizations\"\ \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 := &organizations.CreateParams{\n\t\ \tIntermediateSessionToken: \"${token}\",\n\t\tOrganizationName: \ \ \"${organizationName}\",\n\t\tOrganizationSlug: \"${organizationSlug}\"\ ,\n\t\tOrganizationExternalID: \"my-external-id\",\n\t}\n\n\tresp, err\ \ := client.Discovery.Organizations.Create(context.Background(), params)\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: "// POST /v1/b2b/discovery/organizations/create\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.discoveryorganizations.CreateRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ CreateRequest params = new CreateRequest();\n params.setIntermediateSessionToken(\"\ ${token}\");\n params.setOrganizationName(\"${organizationName}\"\ );\n params.setOrganizationSlug(\"${organizationSlug}\");\n \ \ params.setOrganizationExternalId(\"my-external-id\");\n\n Object\ \ result = StytchB2BClient.getDiscovery().getOrganizations().create(params);\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: "// POST /v1/b2b/discovery/organizations/create\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.discoveryorganizations.CreateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.discovery.organizations.create(\n \ \ CreateRequest(\n intermediateSessionToken\ \ = \"${token}\",\n organizationName = \"${organizationName}\"\ ,\n organizationSlug = \"${organizationSlug}\",\n \ \ organizationExternalId = \"my-external-id\",\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: "// POST /v1/b2b/discovery/organizations/create\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n intermediate_session_token:\ \ \"${token}\",\n organization_name: \"${organizationName}\",\n organization_slug:\ \ \"${organizationSlug}\",\n organization_external_id: \"my-external-id\"\ ,\n};\n\nclient.discovery.organizations.create(params)\n .then(resp =>\ \ { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->discovery->organizations->create([\n 'intermediate_session_token'\ \ => '${token}',\n 'organization_name' => '${organizationName}',\n \ \ 'organization_slug' => '${organizationSlug}',\n 'organization_external_id'\ \ => 'my-external-id',\n]);" - lang: python label: Python source: "# POST /v1/b2b/discovery/organizations/create\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.discovery.organizations.create(\n\ \ intermediate_session_token=\"${token}\",\n organization_name=\"\ ${organizationName}\",\n organization_slug=\"${organizationSlug}\",\n\ \ organization_external_id=\"my-external-id\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/discovery/organizations/create\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.discovery.organizations.create(\n intermediate_session_token:\ \ \"${token}\",\n organization_name: \"${organizationName}\",\n organization_slug:\ \ \"${organizationSlug}\",\n organization_external_id: \"my-external-id\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/discovery/organizations/create\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::discovery_organizations::CreateRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.discovery.organizations.create(\n CreateRequest{\n\ \ intermediate_session_token: \"${token}\",\n organization_name:\ \ Some(String::from(\"${organizationName}\")),\n organization_slug:\ \ Some(String::from(\"${organizationSlug}\")),\n organization_external_id:\ \ Some(String::from(\"my-external-id\")),\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/discovery/organizations/create\ncurl --request POST\ \ \\\n --url https://test.stytch.com/v1/b2b/discovery/organizations/create\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"intermediate_session_token\": \"${token}\",\n \"\ organization_name\": \"${organizationName}\",\n \"organization_slug\"\ : \"${organizationSlug}\",\n \"organization_external_id\": \"my-external-id\"\ \n }'" /v1/b2b/discovery/organizations: post: summary: List operationId: api_discovery_v1_discovery_organizations_List tags: - Discovery description: "List all possible organization relationships connected to a [Member\ \ Session](https://stytch.com/docs/b2b/api/session-object) or Intermediate\ \ Session.\n\nWhen a Member Session is passed in, relationships with a type\ \ of `active_member`, `pending_member`, or `invited_member`\nwill be returned,\ \ and any membership can be assumed by calling the [Exchange Session](https://stytch.com/docs/b2b/api/exchange-session)\ \ endpoint.\n\nWhen an Intermediate Session is passed in, all relationship\ \ types - `active_member`, `pending_member`, `invited_member`, \n`eligible_to_join_by_email_domain`,\ \ and `eligible_to_join_by_oauth_tenant` - will be returned, \nand any membership\ \ can be assumed by calling the [Exchange Intermediate Session](https://stytch.com/docs/b2b/api/exchange-intermediate-session)\ \ endpoint. \n\nThis endpoint requires either an `intermediate_session_token`,\ \ `session_jwt` or `session_token` be included in the request.\nIt will return\ \ an error if multiple are present.\n\nThis operation does not consume the\ \ Intermediate Session or Session Token passed in." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_discovery_v1_discovery_ListRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_discovery_v1_discovery_ListResponse' '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: "// POST /v1/b2b/discovery/organizations\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n intermediate_session_token:\ \ \"${token}\",\n};\n\nclient.Discovery.Organizations.List(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/discovery/organizations\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/discovery/organizations\"\ \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 := &organizations.ListParams{\n\t\t\ IntermediateSessionToken: \"${token}\",\n\t}\n\n\tresp, err := client.Discovery.Organizations.List(context.Background(),\ \ params)\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: "// POST /v1/b2b/discovery/organizations\npackage com.example;\n\n\ import com.stytch.java.b2b.models.discoveryorganizations.ListRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ListRequest params = new ListRequest();\n params.setIntermediateSessionToken(\"\ ${token}\");\n\n Object result = StytchB2BClient.getDiscovery().getOrganizations().list(params);\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: "// POST /v1/b2b/discovery/organizations\npackage com.example\n\n\ import com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.discoveryorganizations.ListRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.discovery.organizations.list(\n \ \ ListRequest(\n intermediateSessionToken = \"\ ${token}\",\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: "// POST /v1/b2b/discovery/organizations\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n intermediate_session_token:\ \ \"${token}\",\n};\n\nclient.discovery.organizations.list(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->discovery->organizations->list([\n 'intermediate_session_token'\ \ => '${token}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/discovery/organizations\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.discovery.organizations.list(\n intermediate_session_token=\"\ ${token}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/discovery/organizations\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.discovery.organizations.list(\n intermediate_session_token:\ \ \"${token}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/discovery/organizations\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::discovery_organizations::ListRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.discovery.organizations.list(\n ListRequest{\n\ \ intermediate_session_token: Some(String::from(\"${token}\"\ )),\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/discovery/organizations\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/b2b/discovery/organizations \\\n -u\ \ '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n\ \ -d '{\n \"intermediate_session_token\": \"${token}\"\n }'" /v1/fingerprint/lookup: servers: - url: https://telemetry.stytch.com post: summary: Lookup operationId: api_fraud_v1_fraud_fingerprint_Lookup tags: - Fraud description: 'Lookup the associated fingerprint for the `telemetry_id` returned from the `GetTelemetryID()` function. Learn more about the different fingerprint types and verdicts in our [DFP guide](https://stytch.com/docs/fraud/guides/device-fingerprinting/overview). You can make a decision based on the recommended `verdict` in the response: * `ALLOW` - This is a known valid device grouping or device profile that is part of the default `ALLOW` listed set of known devices by Stytch. This grouping is made up of verified device profiles that match the characteristics of known/authentic traffic origins. * `BLOCK` - This is a known bad or malicious device profile that is undesirable and should be blocked from completing the privileged action in question. * `CHALLENGE` - This is an unknown or potentially malicious device that should be put through increased friction such as 2FA or other forms of extended user verification before allowing the privileged action to proceed. If the `telemetry_id` is expired or not found, this endpoint returns a 404 `telemetry_id_not_found` [error](https://stytch.com/docs/fraud/api/errors/404#telemetry_id_not_found). We recommend treating 404 errors as a `BLOCK`, since it could be a sign of an attacker trying to bypass DFP protections. See [Attacker-controlled telemetry IDs](https://stytch.com/docs/fraud/guides/device-fingerprinting/integration-steps/test-your-integration#attacker-controlled-telemetry-ids) for more information.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_fraud_v1_fraud_fingerprint_LookupRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_fraud_v1_fraud_fingerprint_LookupResponse' '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: "// POST /v1/fingerprint/lookup\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n telemetry_id: \"${exampleTelemetryId}\"\ ,\n};\n\nclient.Fraud.Fingerprint.Lookup(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/fingerprint/lookup\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/fraud/fingerprint\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &fingerprint.LookupParams{\n\t\t\ TelemetryID: \"${exampleTelemetryId}\",\n\t}\n\n\tresp, err := client.Fraud.Fingerprint.Lookup(context.Background(),\ \ params)\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: "// POST /v1/fingerprint/lookup\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.fraudfingerprint.LookupRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n LookupRequest params = new LookupRequest();\n\ \ params.setTelemetryId(\"${exampleTelemetryId}\");\n\n Object\ \ result = StytchClient.getFraud().getFingerprint().lookup(params);\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: "// POST /v1/fingerprint/lookup\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.fraudfingerprint.LookupRequest\n\n\ fun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.fraud.fingerprint.lookup(\n \ \ LookupRequest(\n telemetryId = \"${exampleTelemetryId}\"\ ,\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: "// POST /v1/fingerprint/lookup\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n telemetry_id: \"${exampleTelemetryId}\"\ ,\n};\n\nclient.fraud.fingerprint.lookup(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->fraud->fingerprint->lookup([\n 'telemetry_id'\ \ => '${exampleTelemetryId}',\n]);" - lang: python label: Python source: "# POST /v1/fingerprint/lookup\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.fraud.fingerprint.lookup(\n telemetry_id=\"${exampleTelemetryId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/fingerprint/lookup\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.fraud.fingerprint.lookup(\n\ \ telemetry_id: \"${exampleTelemetryId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/fingerprint/lookup\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::fraud_fingerprint::LookupRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.fraud.fingerprint.lookup(\n LookupRequest{\n\ \ telemetry_id: \"${exampleTelemetryId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/fingerprint/lookup\ncurl --request POST \\\n --url https://telemetry.stytch.com/v1/fingerprint/lookup\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"telemetry_id\": \"${exampleTelemetryId}\"\n }'" /v1/rules/set: servers: - url: https://telemetry.stytch.com post: summary: Set operationId: api_fraud_v1_fraud_rules_Set tags: - Fraud description: 'Set a rule for a particular `visitor_id`, `browser_id`, `visitor_fingerprint`, `browser_fingerprint`, `hardware_fingerprint`, `network_fingerprint`, `cidr_block`, `asn`, or `country_code`. This is helpful in cases where you want to allow or block a specific user or fingerprint. You should be careful when setting rules for `browser_fingerprint`, `hardware_fingerprint`, or `network_fingerprint` as they can be shared across multiple users, and you could affect more users than intended. You may not set an `ALLOW` rule for a `country_code`. Rules are applied in the order specified above. For example, if an end user has an `ALLOW` rule set for their `visitor_id` but a `BLOCK` rule set for their `hardware_fingerprint`, they will receive an `ALLOW` verdict because the `visitor_id` rule takes precedence. If there are conflicts between multiple `cidr_block` rules (for example, if the `ip_address` of the end user overlaps with multiple CIDR blocks that have rules set), the conflicts are resolved as follows: - The smallest block size takes precedence. For example, if an `ip_address` overlaps with a `cidr_block` rule of `ALLOW` for a block with a prefix of `/32` and a `cidr_block` rule of `BLOCK` with a prefix of `/24`, the rule match verdict will be `ALLOW`. - Among equivalent size blocks, `BLOCK` takes precedence over `CHALLENGE`, which takes precedence over `ALLOW`. For example, if an `ip_address` overlaps with two `cidr_block` rules with blocks of the same size that return `CHALLENGE` and `ALLOW`, the rule match verdict will be `CHALLENGE`.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_fraud_v1_fraud_rules_SetRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_fraud_v1_fraud_rules_SetResponse' '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: "// POST /v1/rules/set\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n action: CHALLENGE,\n visitor_id:\ \ \"visitor-6139cbcc-4dda-4b1f-b1c0-13c08ec64d72\",\n expires_in_minutes:\ \ 120,\n};\n\nclient.Fraud.Rules.Set(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/rules/set\npackage main\n\nimport (\n\t\"context\"\n\t\ \"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/fraud\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/fraud/rules\"\n\ \t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n)\n\ \nfunc main() {\n\tclient, err := stytchapi.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 := &rules.SetParams{\n\t\tAction:\ \ fraud.RuleActionCHALLENGE,\n\t\tVisitorID: \"visitor-6139cbcc-4dda-4b1f-b1c0-13c08ec64d72\"\ ,\n\t\tExpiresInMinutes: 120,\n\t}\n\n\tresp, err := client.Fraud.Rules.Set(context.Background(),\ \ params)\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: "// POST /v1/rules/set\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.fraud.RuleAction;\nimport com.stytch.java.consumer.models.fraudrules.SetRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n SetRequest params = new SetRequest();\n\ \ params.setAction(RuleAction.CHALLENGE);\n params.setVisitorId(\"\ visitor-6139cbcc-4dda-4b1f-b1c0-13c08ec64d72\");\n params.setExpiresInMinutes(120);\n\ \n Object result = StytchClient.getFraud().getRules().set(params);\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: "// POST /v1/rules/set\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.fraud.RuleAction\nimport com.stytch.java.consumer.models.fraudrules.SetRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.fraud.rules.set(\n SetRequest(\n\ \ action = RuleAction.CHALLENGE,\n \ \ visitorId = \"visitor-6139cbcc-4dda-4b1f-b1c0-13c08ec64d72\",\n \ \ expiresInMinutes = 120,\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: "// POST /v1/rules/set\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n action: \"CHALLENGE\",\n visitor_id:\ \ \"visitor-6139cbcc-4dda-4b1f-b1c0-13c08ec64d72\",\n expires_in_minutes:\ \ 120,\n};\n\nclient.fraud.rules.set(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->fraud->rules->set([\n 'action' => 'CHALLENGE',\n\ \ 'visitor_id' => 'visitor-6139cbcc-4dda-4b1f-b1c0-13c08ec64d72',\n \ \ 'expires_in_minutes' => 120,\n]);" - lang: python label: Python source: "# POST /v1/rules/set\nfrom stytch import Client\nfrom stytch.consumer.models.fraud\ \ import RuleAction\n\nclient = Client(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.fraud.rules.set(\n action=RuleAction.CHALLENGE,\n\ \ visitor_id=\"visitor-6139cbcc-4dda-4b1f-b1c0-13c08ec64d72\",\n expires_in_minutes=120,\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/rules/set\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.fraud.rules.set(\n\ \ action: \"CHALLENGE\",\n visitor_id: \"visitor-6139cbcc-4dda-4b1f-b1c0-13c08ec64d72\"\ ,\n expires_in_minutes: 120\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/rules/set\nuse stytch::consumer::client::Client;\nuse\ \ stytch::consumer::fraud_rules::SetRequest;\nuse stytch::consumer::fraud::RuleAction;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.fraud.rules.set(\n SetRequest{\n\ \ action: RuleAction::CHALLENGE,\n visitor_id: Some(String::from(\"\ visitor-6139cbcc-4dda-4b1f-b1c0-13c08ec64d72\")),\n expires_in_minutes:\ \ 120,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/rules/set\ncurl --request POST \\\n --url https://telemetry.stytch.com/v1/rules/set\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"action\": \"CHALLENGE\",\n \"visitor_id\": \"visitor-6139cbcc-4dda-4b1f-b1c0-13c08ec64d72\"\ ,\n \"expires_in_minutes\": 120\n }'" /v1/rules/list: servers: - url: https://telemetry.stytch.com post: summary: List operationId: api_fraud_v1_fraud_rules_List tags: - Fraud description: Get all rules that have been set for your project. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_fraud_v1_fraud_rules_ListRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_fraud_v1_fraud_rules_ListResponse' '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: "// POST /v1/rules/list\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n limit: 10,\n};\n\nclient.Fraud.Rules.List(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/rules/list\npackage main\n\nimport (\n\t\"context\"\n\ \t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/fraud/rules\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &rules.ListParams{\n\t\tLimit:\ \ 10,\n\t}\n\n\tresp, err := client.Fraud.Rules.List(context.Background(),\ \ params)\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: "// POST /v1/rules/list\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.fraudrules.ListRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ListRequest params = new ListRequest();\n params.setLimit(10);\n\ \n Object result = StytchClient.getFraud().getRules().list(params);\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: "// POST /v1/rules/list\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.fraudrules.ListRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.fraud.rules.list(\n ListRequest(\n\ \ limit = 10,\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: "// POST /v1/rules/list\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n limit: 10,\n};\n\nclient.fraud.rules.list(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->fraud->rules->list([\n 'limit' => 10,\n]);" - lang: python label: Python source: "# POST /v1/rules/list\nfrom stytch import Client\n\nclient = Client(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.fraud.rules.list(\n limit=10,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/rules/list\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.fraud.rules.list(\n\ \ limit: 10\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/rules/list\nuse stytch::consumer::client::Client;\nuse\ \ stytch::consumer::fraud_rules::ListRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.fraud.rules.list(\n ListRequest{\n limit: 10,\n\ \ ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/rules/list\ncurl --request POST \\\n --url https://telemetry.stytch.com/v1/rules/list\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"limit\": 10\n }'" /v1/verdict_reasons/override: servers: - url: https://telemetry.stytch.com post: summary: Override operationId: api_fraud_v1_fraud_verdict_reasons_Override tags: - Fraud description: Use this endpoint to override the action returned for a specific verdict reason during a fingerprint lookup. For example, Stytch Device Fingerprinting returns a `CHALLENGE` verdict action by default for the verdict reason `VIRTUAL_MACHINE`. You can use this endpoint to override that reason to return an `ALLOW` verdict instead if you expect many legitimate users to be using a browser that runs in a virtual machine. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_fraud_v1_fraud_verdict_reasons_OverrideRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_fraud_v1_fraud_verdict_reasons_OverrideResponse' '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: "// POST /v1/verdict_reasons/override\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n verdict_reason: \"VIRTUAL_MACHINE\"\ ,\n override_action: ALLOW,\n};\n\nclient.Fraud.VerdictReasons.Override(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/verdict_reasons/override\npackage main\n\nimport (\n\t\ \"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/fraud/verdictreasons\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &verdictreasons.OverrideParams{\n\ \t\tVerdictReason: \"VIRTUAL_MACHINE\",\n\t\tOverrideAction: verdictreasons.OverrideRequestActionALLOW,\n\ \t}\n\n\tresp, err := client.Fraud.VerdictReasons.Override(context.Background(),\ \ params)\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: "// POST /v1/verdict_reasons/override\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.fraudverdictreasons.OverrideRequest;\n\ import com.stytch.java.consumer.models.fraudverdictreasons.OverrideRequestAction;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n OverrideRequest params = new\ \ OverrideRequest();\n params.setVerdictReason(\"VIRTUAL_MACHINE\"\ );\n params.setOverrideAction(OverrideRequestAction.ALLOW);\n\n \ \ Object result = StytchClient.getFraud().getVerdictReasons().override(params);\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: "// POST /v1/verdict_reasons/override\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.fraudverdictreasons.OverrideRequest\n\ import com.stytch.java.consumer.models.fraudverdictreasons.OverrideRequestAction\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.fraud.verdictReasons.override(\n \ \ OverrideRequest(\n verdictReason = \"VIRTUAL_MACHINE\"\ ,\n overrideAction = OverrideRequestAction.ALLOW,\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: "// POST /v1/verdict_reasons/override\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n verdict_reason: \"VIRTUAL_MACHINE\"\ ,\n override_action: \"ALLOW\",\n};\n\nclient.fraud.verdictReasons.override(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->fraud->verdict_reasons->override([\n 'verdict_reason'\ \ => 'VIRTUAL_MACHINE',\n 'override_action' => 'ALLOW',\n]);" - lang: python label: Python source: "# POST /v1/verdict_reasons/override\nfrom stytch import Client\n\ from stytch.consumer.models.fraud_verdict_reasons import OverrideRequestAction\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.fraud.verdict_reasons.override(\n verdict_reason=\"\ VIRTUAL_MACHINE\",\n override_action=OverrideRequestAction.ALLOW,\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/verdict_reasons/override\nrequire 'stytch'\n\nclient =\ \ Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.fraud.verdict_reasons.override(\n verdict_reason:\ \ \"VIRTUAL_MACHINE\",\n override_action: \"ALLOW\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/verdict_reasons/override\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::fraud_verdict_reasons::OverrideRequestAction;\nuse\ \ stytch::consumer::fraud_verdict_reasons::OverrideRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.fraud.verdict_reasons.r#override(\n OverrideRequest{\n\ \ verdict_reason: \"VIRTUAL_MACHINE\",\n override_action:\ \ OverrideRequestAction::ALLOW,\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/verdict_reasons/override\ncurl --request POST \\\n --url\ \ https://telemetry.stytch.com/v1/verdict_reasons/override \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"verdict_reason\"\ : \"VIRTUAL_MACHINE\",\n \"override_action\": \"ALLOW\"\n }'" /v1/verdict_reasons/list: servers: - url: https://telemetry.stytch.com post: summary: List operationId: api_fraud_v1_fraud_verdict_reasons_List tags: - Fraud description: 'Get the list of verdict reasons returned by the Stytch Device Fingerprinting product along with their default actions and any overrides you may have defined. This is not an exhaustive list of verdict reasons, but it contains all verdict reasons that you may set an override on. For a full list of possible verdict reasons, see [Warning Flags (Verdict Reasons)](https://stytch.com/docs/docs/fraud/guides/device-fingerprinting/reference/warning-flags-verdict-reasons).' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_fraud_v1_fraud_verdict_reasons_ListRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_fraud_v1_fraud_verdict_reasons_ListResponse' '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: "// POST /v1/verdict_reasons/list\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n};\n\nclient.Fraud.VerdictReasons.List(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/verdict_reasons/list\npackage main\n\nimport (\n\t\"\ context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/fraud/verdictreasons\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &verdictreasons.ListParams{}\n\n\ \tresp, err := client.Fraud.VerdictReasons.List(context.Background(), params)\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: "// POST /v1/verdict_reasons/list\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.fraudverdictreasons.ListRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ListRequest params = new ListRequest();\n\ \n Object result = StytchClient.getFraud().getVerdictReasons().list(params);\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: "// POST /v1/verdict_reasons/list\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.fraudverdictreasons.ListRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.fraud.verdictReasons.list(\n \ \ ListRequest(),\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: "// POST /v1/verdict_reasons/list\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n};\n\nclient.fraud.verdictReasons.list(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: '$response = $client->fraud->verdict_reasons->list([ ]);' - lang: python label: Python source: "# POST /v1/verdict_reasons/list\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.fraud.verdict_reasons.list()\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/verdict_reasons/list\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.fraud.verdict_reasons.list(\n\ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/verdict_reasons/list\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::fraud_verdict_reasons::ListRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.fraud.verdict_reasons.list(\n ListRequest{\n\ \ ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/verdict_reasons/list\ncurl --request POST \\\n --url\ \ https://telemetry.stytch.com/v1/verdict_reasons/list \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n }'" /v1/email/risk: servers: - url: https://telemetry.stytch.com post: summary: Risk operationId: api_fraud_v1_fraud_email_Risk tags: - Fraud description: 'Get risk information for a specific email address. The response will contain a recommended action (`ALLOW`, `BLOCK`, or `CHALLENGE`) and a more granular `risk_score`. You can also check the `address_information` and `domain_information` fields for more information about the email address and email domain. This feature is in beta. Reach out to us [here](mailto:fraud-team@stytch.com?subject=Email_Intelligence_Early_Access) if you''d like to request early access.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_fraud_v1_fraud_email_RiskRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_fraud_v1_fraud_email_RiskResponse' '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: "// POST /v1/email/risk\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email_address: \"${email}\",\n\ };\n\nclient.Fraud.Email.Risk(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/email/risk\npackage main\n\nimport (\n\t\"context\"\n\ \t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/fraud/email\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &email.RiskParams{\n\t\tEmailAddress:\ \ \"${email}\",\n\t}\n\n\tresp, err := client.Fraud.Email.Risk(context.Background(),\ \ params)\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: "// POST /v1/email/risk\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.fraudemail.RiskRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ RiskRequest params = new RiskRequest();\n params.setEmailAddress(\"\ ${email}\");\n\n Object result = StytchClient.getFraud().getEmail().risk(params);\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: "// POST /v1/email/risk\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.fraudemail.RiskRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.fraud.email.risk(\n RiskRequest(\n\ \ emailAddress = \"${email}\",\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: "// POST /v1/email/risk\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email_address: \"${email}\",\n\ };\n\nclient.fraud.email.risk(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->fraud->email->risk([\n 'email_address' =>\ \ '${email}',\n]);" - lang: python label: Python source: "# POST /v1/email/risk\nfrom stytch import Client\n\nclient = Client(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.fraud.email.risk(\n email_address=\"${email}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/email/risk\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.fraud.email.risk(\n\ \ email_address: \"${email}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/email/risk\nuse stytch::consumer::client::Client;\nuse\ \ stytch::consumer::fraud_email::RiskRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.fraud.email.risk(\n RiskRequest{\n email_address:\ \ \"${email}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/email/risk\ncurl --request POST \\\n --url https://telemetry.stytch.com/v1/email/risk\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email_address\": \"${email}\"\n }'" /v1/idp/oauth/authorize/start: post: summary: Authorizestart operationId: api_idp_v1_idp_oauth_AuthorizeStart tags: - Idp description: "Initiates a request for authorization of a Connected App to access\ \ a User's account.\n\nCall this endpoint using the query parameters from\ \ an OAuth Authorization request. \nThis endpoint validates various fields\ \ (`scope`, `client_id`, `redirect_uri`, `prompt`, etc...) are correct and\ \ returns\nrelevant information for rendering an OAuth Consent Screen.\n\n\ This endpoint returns:\n- A public representation of the Connected App requesting\ \ authorization\n- Whether _explicit_ user consent must be granted before\ \ proceeding with the authorization\n- A list of scopes the user has the ability\ \ to grant the Connected App\n\nUse this response to prompt the user for consent\ \ (if necessary) before calling the [Submit OAuth Authorization](https://stytch.com/docs/api/connected-apps-oauth-authorize)\ \ endpoint.\n\nExactly one of the following must be provided to identify the\ \ user granting authorization:\n- `user_id`\n- `session_token`\n- `session_jwt`\n\ \nIf a `session_token` or `session_jwt` is passed, the OAuth Authorization\ \ will be linked to the user's session for tracking purposes.\nOne of these\ \ fields must be used if the Connected App intends to complete the [Exchange\ \ Access Token](https://stytch.com/docs/api/connected-app-access-token-exchange)\ \ flow." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_idp_v1_idp_oauth_AuthorizeStartRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_idp_v1_idp_oauth_AuthorizeStartResponse' '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: "// POST /v1/idp/oauth/authorize/start\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleConnectedAppClientID}\"\ ,\n redirect_uri: \"https://app.example/oauth/callback\",\n response_type:\ \ \"code\",\n scopes: [\"openid\"],\n};\n\nclient.IDP.OAuth.AuthorizeStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/idp/oauth/authorize/start\npackage main\n\nimport (\n\ \t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/idp/oauth\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &oauth.AuthorizeStartParams{\n\t\ \tClientID: \"${exampleConnectedAppClientID}\",\n\t\tRedirectURI: \"\ https://app.example/oauth/callback\",\n\t\tResponseType: \"code\",\n\t\t\ Scopes: []string{\"openid\"},\n\t}\n\n\tresp, err := client.IDP.OAuth.AuthorizeStart(context.Background(),\ \ params)\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: "// POST /v1/idp/oauth/authorize/start\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.idpoauth.AuthorizeStartRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthorizeStartRequest params\ \ = new AuthorizeStartRequest();\n params.setClientId(\"${exampleConnectedAppClientID}\"\ );\n params.setRedirectUri(\"https://app.example/oauth/callback\"\ );\n params.setResponseType(\"code\");\n params.setScopes(new\ \ String(\"openid\"));\n\n Object result = StytchClient.getIDP().getOAuth().authorizeStart(params);\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: "// POST /v1/idp/oauth/authorize/start\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.idpoauth.AuthorizeStartRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.idp.oauth.authorizeStart(\n \ \ AuthorizeStartRequest(\n clientId = \"${exampleConnectedAppClientID}\"\ ,\n redirectUri = \"https://app.example/oauth/callback\"\ ,\n responseType = \"code\",\n scopes\ \ = arrayOf(\"openid\"),\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: "// POST /v1/idp/oauth/authorize/start\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleConnectedAppClientID}\"\ ,\n redirect_uri: \"https://app.example/oauth/callback\",\n response_type:\ \ \"code\",\n scopes: [\"openid\"],\n};\n\nclient.idp.oauth.authorizeStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->idp->oauth->authorize_start([\n 'client_id'\ \ => '${exampleConnectedAppClientID}',\n 'redirect_uri' => 'https://app.example/oauth/callback',\n\ \ 'response_type' => 'code',\n 'scopes' => ['openid'],\n]);" - lang: python label: Python source: "# POST /v1/idp/oauth/authorize/start\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.idp.oauth.authorize_start(\n client_id=\"${exampleConnectedAppClientID}\"\ ,\n redirect_uri=\"https://app.example/oauth/callback\",\n response_type=\"\ code\",\n scopes=[\"openid\"],\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/idp/oauth/authorize/start\nrequire 'stytch'\n\nclient\ \ = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.idp.oauth.authorize_start(\n client_id: \"${exampleConnectedAppClientID}\"\ ,\n redirect_uri: \"https://app.example/oauth/callback\",\n response_type:\ \ \"code\",\n scopes: ['openid']\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/idp/oauth/authorize/start\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::idp_oauth::AuthorizeStartRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.idp.oauth.authorize_start(\n AuthorizeStartRequest{\n\ \ client_id: \"${exampleConnectedAppClientID}\",\n \ \ redirect_uri: \"https://app.example/oauth/callback\",\n response_type:\ \ \"code\",\n scopes: vec![\"openid\"],\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/idp/oauth/authorize/start\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/idp/oauth/authorize/start \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"client_id\"\ : \"${exampleConnectedAppClientID}\",\n \"redirect_uri\": \"https://app.example/oauth/callback\"\ ,\n \"response_type\": \"code\",\n \"scopes\": [\"openid\"]\n }'" /v1/idp/oauth/authorize: post: summary: Authorize operationId: api_idp_v1_idp_oauth_Authorize tags: - Idp description: "Completes a request for authorization of a Connected App to access\ \ a User's account.\n\nCall this endpoint using the query parameters from\ \ an OAuth Authorization request, after previously validating those parameters\ \ using the\n[Preflight Check](https://stytch.com/docs/api/connected-apps-oauth-authorize-start)\ \ API.\nNote that this endpoint takes in a few additional parameters the preflight\ \ check does not- `state`, `nonce`, and `code_challenge`.\n\nIf the authorization\ \ was successful, the `redirect_uri` will contain a valid `authorization_code`\ \ embedded as a query parameter.\nIf the authorization was unsuccessful, the\ \ `redirect_uri` will contain an OAuth2.1 `error_code`.\nIn both cases, redirect\ \ the user to the location for the response to be consumed by the Connected\ \ App. \n\nExactly one of the following must be provided to identify the user\ \ granting authorization:\n- `user_id`\n- `session_token`\n- `session_jwt`\n\ \nIf a `session_token` or `session_jwt` is passed, the OAuth Authorization\ \ will be linked to the user's session for tracking purposes.\nOne of these\ \ fields must be used if the Connected App intends to complete the [Exchange\ \ Access Token](https://stytch.com/docs/api/connected-app-access-token-exchange)\ \ flow." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_idp_v1_idp_oauth_AuthorizeRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_idp_v1_idp_oauth_AuthorizeResponse' '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: "// POST /v1/idp/oauth/authorize\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n consent_granted: true,\n scopes:\ \ [\"openid\"],\n client_id: \"${exampleConnectedAppClientID}\",\n redirect_uri:\ \ \"https://app.example/oauth/callback\",\n response_type: \"code\",\n\ };\n\nclient.IDP.OAuth.Authorize(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/idp/oauth/authorize\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/idp/oauth\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &oauth.AuthorizeParams{\n\t\tConsentGranted:\ \ true,\n\t\tScopes: []string{\"openid\"},\n\t\tClientID: \ \ \"${exampleConnectedAppClientID}\",\n\t\tRedirectURI: \"https://app.example/oauth/callback\"\ ,\n\t\tResponseType: \"code\",\n\t}\n\n\tresp, err := client.IDP.OAuth.Authorize(context.Background(),\ \ params)\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: "// POST /v1/idp/oauth/authorize\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.idpoauth.AuthorizeRequest;\nimport\ \ com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n public\ \ static void main(String[] args) {\n StytchClient.configure(\"${projectId}\"\ , \"${secret}\");\n\n AuthorizeRequest params = new AuthorizeRequest();\n\ \ params.setConsentGranted(true);\n params.setScopes(new String(\"\ openid\"));\n params.setClientId(\"${exampleConnectedAppClientID}\"\ );\n params.setRedirectUri(\"https://app.example/oauth/callback\"\ );\n params.setResponseType(\"code\");\n\n Object result =\ \ StytchClient.getIDP().getOAuth().authorize(params);\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: "// POST /v1/idp/oauth/authorize\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.idpoauth.AuthorizeRequest\n\nfun\ \ main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.idp.oauth.authorize(\n AuthorizeRequest(\n\ \ consentGranted = true,\n scopes\ \ = arrayOf(\"openid\"),\n clientId = \"${exampleConnectedAppClientID}\"\ ,\n redirectUri = \"https://app.example/oauth/callback\"\ ,\n responseType = \"code\",\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: "// POST /v1/idp/oauth/authorize\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n consent_granted: true,\n scopes:\ \ [\"openid\"],\n client_id: \"${exampleConnectedAppClientID}\",\n redirect_uri:\ \ \"https://app.example/oauth/callback\",\n response_type: \"code\",\n\ };\n\nclient.idp.oauth.authorize(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->idp->oauth->authorize([\n 'consent_granted'\ \ => true,\n 'scopes' => ['openid'],\n 'client_id' => '${exampleConnectedAppClientID}',\n\ \ 'redirect_uri' => 'https://app.example/oauth/callback',\n 'response_type'\ \ => 'code',\n]);" - lang: python label: Python source: "# POST /v1/idp/oauth/authorize\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.idp.oauth.authorize(\n consent_granted=True,\n\ \ scopes=[\"openid\"],\n client_id=\"${exampleConnectedAppClientID}\"\ ,\n redirect_uri=\"https://app.example/oauth/callback\",\n response_type=\"\ code\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/idp/oauth/authorize\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.idp.oauth.authorize(\n\ \ consent_granted: true,\n scopes: ['openid'],\n client_id: \"${exampleConnectedAppClientID}\"\ ,\n redirect_uri: \"https://app.example/oauth/callback\",\n response_type:\ \ \"code\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/idp/oauth/authorize\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::idp_oauth::AuthorizeRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.idp.oauth.authorize(\n AuthorizeRequest{\n \ \ consent_granted: true,\n scopes: vec![\"openid\"],\n \ \ client_id: \"${exampleConnectedAppClientID}\",\n \ \ redirect_uri: \"https://app.example/oauth/callback\",\n response_type:\ \ \"code\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/idp/oauth/authorize\ncurl --request POST \\\n --url https://test.stytch.com/v1/idp/oauth/authorize\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"consent_granted\": true,\n \"scopes\": [\"openid\"\ ],\n \"client_id\": \"${exampleConnectedAppClientID}\",\n \"redirect_uri\"\ : \"https://app.example/oauth/callback\",\n \"response_type\": \"code\"\ \n }'" /v1/impersonation/authenticate: post: summary: Authenticate operationId: api_impersonation_v1_Authenticate tags: - Impersonation description: 'Authenticate an impersonation token to impersonate a User. This endpoint requires an impersonation token that is not expired or previously used. A Stytch session will be created for the impersonated user with a 60 minute duration. Impersonated sessions cannot be extended. Prior to this step, you can generate an impersonation token by visiting the Stytch Dashboard, viewing a user, and clicking the `Impersonate User` button.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_impersonation_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_impersonation_v1_AuthenticateResponse' '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: "// POST /v1/impersonation/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n impersonation_token: \"${token}\"\ ,\n};\n\nclient.Impersonation.Authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/impersonation/authenticate\npackage main\n\nimport (\n\ \t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/impersonation\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &impersonation.AuthenticateParams{\n\ \t\tImpersonationToken: \"${token}\",\n\t}\n\n\tresp, err := client.Impersonation.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/impersonation/authenticate\npackage com.example;\n\n\ import com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.impersonation.AuthenticateRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthenticateRequest params =\ \ new AuthenticateRequest();\n params.setImpersonationToken(\"${token}\"\ );\n\n Object result = StytchClient.getImpersonation().authenticate(params);\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: "// POST /v1/impersonation/authenticate\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.impersonation.AuthenticateRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.impersonation.authenticate(\n \ \ AuthenticateRequest(\n impersonationToken = \"${token}\"\ ,\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: "// POST /v1/impersonation/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n impersonation_token: \"${token}\"\ ,\n};\n\nclient.impersonation.authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->impersonation->authenticate([\n 'impersonation_token'\ \ => '${token}',\n]);" - lang: python label: Python source: "# POST /v1/impersonation/authenticate\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.impersonation.authenticate(\n impersonation_token=\"\ ${token}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/impersonation/authenticate\nrequire 'stytch'\n\nclient\ \ = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.impersonation.authenticate(\n impersonation_token:\ \ \"${token}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/impersonation/authenticate\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::impersonation::AuthenticateRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.impersonation.authenticate(\n AuthenticateRequest{\n\ \ impersonation_token: \"${token}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/impersonation/authenticate\ncurl --request POST \\\n \ \ --url https://test.stytch.com/v1/impersonation/authenticate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"impersonation_token\"\ : \"${token}\"\n }'" /v1/m2m/clients/{client_id}: get: summary: Get operationId: api_m2m_v1_m2m_clients_Get tags: - M2M description: Gets information about an existing M2M Client. parameters: - name: client_id in: path required: true schema: type: string description: The ID of the client. description: The ID of the client. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_GetResponse' '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/m2m/clients/{client_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleM2MClientID}\"\ ,\n};\n\nclient.M2M.Clients.Get(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// GET /v1/m2m/clients/{client_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/consumer/m2m/clients\"\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 := &clients.GetParams{\n\t\tClientID:\ \ \"${exampleM2MClientID}\",\n\t}\n\n\tresp, err := client.M2M.Clients.Get(context.Background(),\ \ params)\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/m2m/clients/{client_id}\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.m2mclients.GetRequest;\n\npublic\ \ class Main {\n public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n GetRequest params = new GetRequest();\n\ \ params.setClientId(\"${exampleM2MClientID}\");\n\n Object\ \ result = StytchB2BClient.getM2M().getClients().get(params);\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/m2m/clients/{client_id}\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.m2mclients.GetRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.m2m.clients.get(\n GetRequest(\n\ \ clientId = \"${exampleM2MClientID}\",\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: "// GET /v1/m2m/clients/{client_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleM2MClientID}\"\ ,\n};\n\nclient.m2m.clients.get(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->m2m->clients->get([\n 'client_id' => '${exampleM2MClientID}',\n\ ]);" - lang: python label: Python source: "# GET /v1/m2m/clients/{client_id}\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.m2m.clients.get(\n client_id=\"${exampleM2MClientID}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/m2m/clients/{client_id}\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.m2m.clients.get(\n\ \ client_id: \"${exampleM2MClientID}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/m2m/clients/{client_id}\nuse stytch::b2b::client::Client;\n\ use stytch::consumer::m2m_clients::GetRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.m2m.clients.get(\n GetRequest{\n client_id:\ \ \"${exampleM2MClientID}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/m2m/clients/{client_id}\ncurl --request GET \\\n --url\ \ https://test.stytch.com/v1/m2m/clients/${exampleM2MClientID} \\\n -u\ \ '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" put: summary: Update operationId: api_m2m_v1_m2m_clients_Update tags: - M2M description: 'Updates an existing M2M Client. You can use this endpoint to activate or deactivate an M2M Client by changing its `status`. A deactivated M2M Client will not be allowed to perform future token exchange flows until it is reactivated. **Important:** Deactivating an M2M Client will not invalidate any existing JWTs issued to the client, only prevent it from receiving new ones. To protect more-sensitive routes, pass a lower `max_token_age` value when[authenticating the token](https://stytch.com/docs/b2b/api/authenticate-m2m-token)[authenticating the token](https://stytch.com/docs/api/authenticate-m2m-token).' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_UpdateRequest' parameters: - name: client_id in: path required: true schema: type: string description: The ID of the client. description: The ID of the client. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_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/m2m/clients/{client_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleM2MClientID}\"\ ,\n client_name: \"My Sample Client\",\n client_description: \"My sample\ \ client for testing out M2M authentication.\",\n scopes: [\"read:users\"\ , \"write:users\"],\n};\n\nclient.M2M.Clients.Update(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// PUT /v1/m2m/clients/{client_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/consumer/m2m/clients\"\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 := &clients.UpdateParams{\n\t\tClientID:\ \ \"${exampleM2MClientID}\",\n\t\tClientName: \"My Sample\ \ Client\",\n\t\tClientDescription: \"My sample client for testing out M2M\ \ authentication.\",\n\t\tScopes: []string{\"read:users\", \"\ write:users\"},\n\t}\n\n\tresp, err := client.M2M.Clients.Update(context.Background(),\ \ params)\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/m2m/clients/{client_id}\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.m2mclients.UpdateRequest;\n\npublic\ \ class Main {\n public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n UpdateRequest params = new UpdateRequest();\n\ \ params.setClientId(\"${exampleM2MClientID}\");\n params.setClientName(\"\ My Sample Client\");\n params.setClientDescription(\"My sample client\ \ for testing out M2M authentication.\");\n params.setScopes(new\ \ String(\"read:users\", \"write:users\"));\n\n Object result = StytchB2BClient.getM2M().getClients().update(params);\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/m2m/clients/{client_id}\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.m2mclients.UpdateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.m2m.clients.update(\n UpdateRequest(\n\ \ clientId = \"${exampleM2MClientID}\",\n \ \ clientName = \"My Sample Client\",\n clientDescription\ \ = \"My sample client for testing out M2M authentication.\",\n \ \ scopes = arrayOf(\"read:users\", \"write:users\"),\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/m2m/clients/{client_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleM2MClientID}\"\ ,\n client_name: \"My Sample Client\",\n client_description: \"My sample\ \ client for testing out M2M authentication.\",\n scopes: [\"read:users\"\ , \"write:users\"],\n};\n\nclient.m2m.clients.update(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->m2m->clients->update([\n 'client_id' => '${exampleM2MClientID}',\n\ \ 'client_name' => 'My Sample Client',\n 'client_description' => 'My\ \ sample client for testing out M2M authentication.',\n 'scopes' => ['read:users',\ \ 'write:users'],\n]);" - lang: python label: Python source: "# PUT /v1/m2m/clients/{client_id}\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.m2m.clients.update(\n client_id=\"${exampleM2MClientID}\"\ ,\n client_name=\"My Sample Client\",\n client_description=\"My sample\ \ client for testing out M2M authentication.\",\n scopes=[\"read:users\"\ , \"write:users\"],\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# PUT /v1/m2m/clients/{client_id}\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.m2m.clients.update(\n\ \ client_id: \"${exampleM2MClientID}\",\n client_name: \"My Sample Client\"\ ,\n client_description: \"My sample client for testing out M2M authentication.\"\ ,\n scopes: ['read:users', 'write:users']\n \n)\n\nputs resp" - lang: rust label: Rust source: "// PUT /v1/m2m/clients/{client_id}\nuse stytch::b2b::client::Client;\n\ use stytch::consumer::m2m_clients::UpdateRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.m2m.clients.update(\n UpdateRequest{\n \ \ client_id: \"${exampleM2MClientID}\",\n client_name: Some(String::from(\"\ My Sample Client\")),\n client_description: Some(String::from(\"\ My sample client for testing out M2M authentication.\")),\n scopes:\ \ vec![\"read:users\", \"write:users\"],\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# PUT /v1/m2m/clients/{client_id}\ncurl --request PUT \\\n --url\ \ https://test.stytch.com/v1/m2m/clients/${exampleM2MClientID} \\\n -u\ \ '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n\ \ -d '{\n \"client_name\": \"My Sample Client\",\n \"client_description\"\ : \"My sample client for testing out M2M authentication.\",\n \"scopes\"\ : [\"read:users\", \"write:users\"]\n }'" delete: summary: Delete operationId: api_m2m_v1_m2m_clients_Delete tags: - M2M description: 'Deletes the M2M Client. **Important:** Deleting an M2M Client will not invalidate any existing JWTs issued to the client, only prevent it from receiving new ones. To protect more-sensitive routes, pass a lower `max_token_age` value when[authenticating the token](https://stytch.com/docs/b2b/api/authenticate-m2m-token)[authenticating the token](https://stytch.com/docs/api/authenticate-m2m-token).' parameters: - name: client_id in: path required: true schema: type: string description: The ID of the client. description: The ID of the client. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_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/m2m/clients/{client_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleM2MClientID}\"\ ,\n};\n\nclient.M2M.Clients.Delete(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/m2m/clients/{client_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/consumer/m2m/clients\"\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 := &clients.DeleteParams{\n\t\tClientID:\ \ \"${exampleM2MClientID}\",\n\t}\n\n\tresp, err := client.M2M.Clients.Delete(context.Background(),\ \ params)\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/m2m/clients/{client_id}\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.m2mclients.DeleteRequest;\n\npublic\ \ class Main {\n public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteRequest params = new DeleteRequest();\n\ \ params.setClientId(\"${exampleM2MClientID}\");\n\n Object\ \ result = StytchB2BClient.getM2M().getClients().delete(params);\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/m2m/clients/{client_id}\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.m2mclients.DeleteRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.m2m.clients.delete(\n DeleteRequest(\n\ \ clientId = \"${exampleM2MClientID}\",\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/m2m/clients/{client_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n client_id: \"${exampleM2MClientID}\"\ ,\n};\n\nclient.m2m.clients.delete(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->m2m->clients->delete([\n 'client_id' => '${exampleM2MClientID}',\n\ ]);" - lang: python label: Python source: "# DELETE /v1/m2m/clients/{client_id}\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.m2m.clients.delete(\n client_id=\"${exampleM2MClientID}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/m2m/clients/{client_id}\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.m2m.clients.delete(\n client_id: \"${exampleM2MClientID}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/m2m/clients/{client_id}\nuse stytch::b2b::client::Client;\n\ use stytch::consumer::m2m_clients::DeleteRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.m2m.clients.delete(\n DeleteRequest{\n \ \ client_id: \"${exampleM2MClientID}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# DELETE /v1/m2m/clients/{client_id}\ncurl --request DELETE \\\n\ \ --url https://test.stytch.com/v1/m2m/clients/${exampleM2MClientID} \\\ \n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/m2m/clients/search: post: summary: Search operationId: api_m2m_v1_m2m_clients_Search tags: - M2M description: 'Search for M2M Clients within your Stytch Project. Submit an empty `query` in the request to return all M2M Clients. The following search filters are supported today: - `client_id`: Pass in a list of client IDs to get many clients in a single request - `client_name`: Search for clients by exact match on client name - `scopes`: Search for clients assigned a specific scope' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_SearchRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_SearchResponse' '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: "// POST /v1/m2m/clients/search\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n limit: 10,\n};\n\nclient.M2M.Clients.Search(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/m2m/clients/search\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/consumer/m2m/clients\"\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 := &clients.SearchParams{\n\t\tLimit:\ \ 10,\n\t}\n\n\tresp, err := client.M2M.Clients.Search(context.Background(),\ \ params)\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: "// POST /v1/m2m/clients/search\npackage com.example;\n\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.m2mclients.SearchRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ SearchRequest params = new SearchRequest();\n params.setLimit(10);\n\ \n Object result = StytchB2BClient.getM2M().getClients().search(params);\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: "// POST /v1/m2m/clients/search\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.consumer.models.m2mclients.SearchRequest\n\nfun main()\ \ {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.m2m.clients.search(\n SearchRequest(\n\ \ limit = 10,\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: "// POST /v1/m2m/clients/search\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n limit: 10,\n};\n\nclient.m2m.clients.search(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->m2m->clients->search([\n 'limit' => 10,\n\ ]);" - lang: python label: Python source: "# POST /v1/m2m/clients/search\nfrom stytch import B2BClient\n\nclient\ \ = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.m2m.clients.search(\n limit=10,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/m2m/clients/search\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.m2m.clients.search(\n\ \ limit: 10\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/m2m/clients/search\nuse stytch::b2b::client::Client;\n\ use stytch::consumer::m2m_clients::SearchRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.m2m.clients.search(\n SearchRequest{\n \ \ limit: 10,\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/m2m/clients/search\ncurl --request POST \\\n --url https://test.stytch.com/v1/m2m/clients/search\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"limit\": 10\n }'" /v1/m2m/clients: post: summary: Create operationId: api_m2m_v1_m2m_clients_Create tags: - M2M description: 'Creates a new M2M Client. On initial client creation, you may pass in a custom `client_id` or `client_secret` to import an existing M2M client. If you do not pass in a custom `client_id` or `client_secret`, one will be generated automatically. The `client_id` must be unique among all clients in your project. **Important:** This is the only time you will be able to view the generated `client_secret` in the API response. Stytch stores a hash of the `client_secret` and cannot recover the value if lost. Be sure to persist the `client_secret` in a secure location. If the `client_secret` is lost, you will need to trigger a secret rotation flow to receive another one.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_CreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_CreateResponse' '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: "// POST /v1/m2m/clients\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n scopes: [\"read:users\", \"write:users\"\ ],\n client_name: \"My Sample Client\",\n client_description: \"My sample\ \ client for testing out M2M authentication.\",\n};\n\nclient.M2M.Clients.Create(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/m2m/clients\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/consumer/m2m/clients\"\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 := &clients.CreateParams{\n\t\tScopes:\ \ []string{\"read:users\", \"write:users\"},\n\t\tClientName:\ \ \"My Sample Client\",\n\t\tClientDescription: \"My sample client\ \ for testing out M2M authentication.\",\n\t}\n\n\tresp, err := client.M2M.Clients.Create(context.Background(),\ \ params)\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: "// POST /v1/m2m/clients\npackage com.example;\n\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.m2mclients.CreateRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ CreateRequest params = new CreateRequest();\n params.setScopes(new\ \ String(\"read:users\", \"write:users\"));\n params.setClientName(\"\ My Sample Client\");\n params.setClientDescription(\"My sample client\ \ for testing out M2M authentication.\");\n\n Object result = StytchB2BClient.getM2M().getClients().create(params);\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: "// POST /v1/m2m/clients\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.consumer.models.m2mclients.CreateRequest\n\nfun main()\ \ {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.m2m.clients.create(\n CreateRequest(\n\ \ scopes = arrayOf(\"read:users\", \"write:users\"),\n\ \ clientName = \"My Sample Client\",\n \ \ clientDescription = \"My sample client for testing out M2M authentication.\"\ ,\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: "// POST /v1/m2m/clients\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n scopes: [\"read:users\", \"write:users\"\ ],\n client_name: \"My Sample Client\",\n client_description: \"My sample\ \ client for testing out M2M authentication.\",\n};\n\nclient.m2m.clients.create(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->m2m->clients->create([\n 'scopes' => ['read:users',\ \ 'write:users'],\n 'client_name' => 'My Sample Client',\n 'client_description'\ \ => 'My sample client for testing out M2M authentication.',\n]);" - lang: python label: Python source: "# POST /v1/m2m/clients\nfrom stytch import B2BClient\n\nclient =\ \ B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.m2m.clients.create(\n scopes=[\"read:users\", \"\ write:users\"],\n client_name=\"My Sample Client\",\n client_description=\"\ My sample client for testing out M2M authentication.\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/m2m/clients\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.m2m.clients.create(\n\ \ scopes: ['read:users', 'write:users'],\n client_name: \"My Sample Client\"\ ,\n client_description: \"My sample client for testing out M2M authentication.\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/m2m/clients\nuse stytch::b2b::client::Client;\nuse stytch::consumer::m2m_clients::CreateRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.m2m.clients.create(\n CreateRequest{\n\ \ scopes: vec![\"read:users\", \"write:users\"],\n \ \ client_name: Some(String::from(\"My Sample Client\")),\n client_description:\ \ Some(String::from(\"My sample client for testing out M2M authentication.\"\ )),\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/m2m/clients\ncurl --request POST \\\n --url https://test.stytch.com/v1/m2m/clients\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"scopes\": [\"read:users\", \"write:users\"],\n \"\ client_name\": \"My Sample Client\",\n \"client_description\": \"My sample\ \ client for testing out M2M authentication.\"\n }'" /v1/m2m/clients/{client_id}/secrets/rotate/start: post: summary: Rotatestart operationId: api_m2m_v1_m2m_clients_secrets_RotateStart tags: - Clients description: 'Initiate the rotation of an M2M client secret. After this endpoint is called, both the client''s `client_secret` and `next_client_secret` will be valid. To complete the secret rotation flow, update all usages of `client_secret` to `next_client_secret` and call the [Rotate Secret Endpoint](https://stytch.com/docs/b2b/api/m2m-rotate-secret)[Rotate Secret Endpoint](https://stytch.com/docs/api/m2m-rotate-secret) to complete the flow.Secret rotation can be cancelled using the [Rotate Cancel Endpoint](https://stytch.com/docs/b2b/api/m2m-rotate-secret-cancel)[Rotate Cancel Endpoint](https://stytch.com/docs/api/m2m-rotate-secret-cancel). **Important:** This is the only time you will be able to view the generated `next_client_secret` in the API response. Stytch stores a hash of the `next_client_secret` and cannot recover the value if lost. Be sure to persist the `next_client_secret` in a secure location. If the `next_client_secret` is lost, you will need to trigger a secret rotation flow to receive another one.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_secrets_RotateStartRequest' parameters: - name: client_id in: path required: true schema: type: string description: The ID of the client. description: The ID of the client. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_secrets_RotateStartResponse' '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: "// POST /v1/m2m/clients/{client_id}/secrets/rotate/start\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n client_id:\ \ \"${exampleM2MClientID}\",\n};\n\nclient.M2M.Clients.Secrets.RotateStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/m2m/clients/{client_id}/secrets/rotate/start\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/consumer/m2m/clients/secrets\"\ \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 := &secrets.RotateStartParams{\n\t\ \tClientID: \"${exampleM2MClientID}\",\n\t}\n\n\tresp, err := client.M2M.Clients.Secrets.RotateStart(context.Background(),\ \ params)\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: "// POST /v1/m2m/clients/{client_id}/secrets/rotate/start\npackage\ \ com.example;\n\nimport com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.m2mclientssecrets.RotateStartRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ RotateStartRequest params = new RotateStartRequest();\n params.setClientId(\"\ ${exampleM2MClientID}\");\n\n Object result = StytchB2BClient.getM2M().getClients().getSecrets().rotateStart(params);\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: "// POST /v1/m2m/clients/{client_id}/secrets/rotate/start\npackage\ \ com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.m2mclientssecrets.RotateStartRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.m2m.clients.secrets.rotateStart(\n \ \ RotateStartRequest(\n clientId = \"${exampleM2MClientID}\"\ ,\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: "// POST /v1/m2m/clients/{client_id}/secrets/rotate/start\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n client_id:\ \ \"${exampleM2MClientID}\",\n};\n\nclient.m2m.clients.secrets.rotateStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->m2m->clients->secrets->rotate_start([\n 'client_id'\ \ => '${exampleM2MClientID}',\n]);" - lang: python label: Python source: "# POST /v1/m2m/clients/{client_id}/secrets/rotate/start\nfrom stytch\ \ import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.m2m.clients.secrets.rotate_start(\n\ \ client_id=\"${exampleM2MClientID}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/m2m/clients/{client_id}/secrets/rotate/start\nrequire\ \ 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.m2m.clients.secrets.rotate_start(\n\ \ client_id: \"${exampleM2MClientID}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/m2m/clients/{client_id}/secrets/rotate/start\nuse stytch::b2b::client::Client;\n\ use stytch::consumer::m2m_clients_secrets::RotateStartRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.m2m.clients.secrets.rotate_start(\n RotateStartRequest{\n\ \ client_id: \"${exampleM2MClientID}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/m2m/clients/{client_id}/secrets/rotate/start\ncurl --request\ \ POST \\\n --url https://test.stytch.com/v1/m2m/clients/${exampleM2MClientID}/secrets/rotate/start\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/m2m/clients/{client_id}/secrets/rotate/cancel: post: summary: Rotatecancel operationId: api_m2m_v1_m2m_clients_secrets_RotateCancel tags: - Clients description: 'Cancel the rotation of an M2M client secret started with the [Start Secret Rotation Endpoint](https://stytch.com/docs/b2b/api/m2m-rotate-secret-start) [Start Secret Rotation Endpoint](https://stytch.com/docs/api/m2m-rotate-secret-start). After this endpoint is called, the client''s `next_client_secret` is discarded and only the original `client_secret` will be valid.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_secrets_RotateCancelRequest' parameters: - name: client_id in: path required: true schema: type: string description: The ID of the client. description: The ID of the client. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_secrets_RotateCancelResponse' '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: "// POST /v1/m2m/clients/{client_id}/secrets/rotate/cancel\nconst\ \ stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n client_id: \"${exampleM2MClientID}\",\n};\n\nclient.M2M.Clients.Secrets.RotateCancel(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/m2m/clients/{client_id}/secrets/rotate/cancel\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/consumer/m2m/clients/secrets\"\ \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 := &secrets.RotateCancelParams{\n\t\ \tClientID: \"${exampleM2MClientID}\",\n\t}\n\n\tresp, err := client.M2M.Clients.Secrets.RotateCancel(context.Background(),\ \ params)\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: "// POST /v1/m2m/clients/{client_id}/secrets/rotate/cancel\npackage\ \ com.example;\n\nimport com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.m2mclientssecrets.RotateCancelRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ RotateCancelRequest params = new RotateCancelRequest();\n \ \ params.setClientId(\"${exampleM2MClientID}\");\n\n Object result\ \ = StytchB2BClient.getM2M().getClients().getSecrets().rotateCancel(params);\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: "// POST /v1/m2m/clients/{client_id}/secrets/rotate/cancel\npackage\ \ com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.m2mclientssecrets.RotateCancelRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.m2m.clients.secrets.rotateCancel(\n \ \ RotateCancelRequest(\n clientId = \"${exampleM2MClientID}\"\ ,\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: "// POST /v1/m2m/clients/{client_id}/secrets/rotate/cancel\nconst\ \ stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n\ \ project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params\ \ = {\n client_id: \"${exampleM2MClientID}\",\n};\n\nclient.m2m.clients.secrets.rotateCancel(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->m2m->clients->secrets->rotate_cancel([\n \ \ 'client_id' => '${exampleM2MClientID}',\n]);" - lang: python label: Python source: "# POST /v1/m2m/clients/{client_id}/secrets/rotate/cancel\nfrom stytch\ \ import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.m2m.clients.secrets.rotate_cancel(\n\ \ client_id=\"${exampleM2MClientID}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/m2m/clients/{client_id}/secrets/rotate/cancel\nrequire\ \ 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.m2m.clients.secrets.rotate_cancel(\n\ \ client_id: \"${exampleM2MClientID}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/m2m/clients/{client_id}/secrets/rotate/cancel\nuse stytch::b2b::client::Client;\n\ use stytch::consumer::m2m_clients_secrets::RotateCancelRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.m2m.clients.secrets.rotate_cancel(\n RotateCancelRequest{\n\ \ client_id: \"${exampleM2MClientID}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/m2m/clients/{client_id}/secrets/rotate/cancel\ncurl --request\ \ POST \\\n --url https://test.stytch.com/v1/m2m/clients/${exampleM2MClientID}/secrets/rotate/cancel\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/m2m/clients/{client_id}/secrets/rotate: post: summary: Rotate operationId: api_m2m_v1_m2m_clients_secrets_Rotate tags: - Clients description: 'Complete the rotation of an M2M client secret started with the [Start Secret Rotation Endpoint](https://stytch.com/docs/b2b/api/m2m-rotate-secret-start) [Start Secret Rotation Endpoint](https://stytch.com/docs/api/m2m-rotate-secret-start). After this endpoint is called, the client''s `next_client_secret` becomes its `client_secret` and the previous `client_secret` will no longer be valid.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_secrets_RotateRequest' parameters: - name: client_id in: path required: true schema: type: string description: The ID of the client. description: The ID of the client. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_m2m_v1_m2m_clients_secrets_RotateResponse' '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: "// POST /v1/m2m/clients/{client_id}/secrets/rotate\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n client_id:\ \ \"${exampleM2MClientID}\",\n};\n\nclient.M2M.Clients.Secrets.Rotate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/m2m/clients/{client_id}/secrets/rotate\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/consumer/m2m/clients/secrets\"\ \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 := &secrets.RotateParams{\n\t\tClientID:\ \ \"${exampleM2MClientID}\",\n\t}\n\n\tresp, err := client.M2M.Clients.Secrets.Rotate(context.Background(),\ \ params)\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: "// POST /v1/m2m/clients/{client_id}/secrets/rotate\npackage com.example;\n\ \nimport com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.m2mclientssecrets.RotateRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ RotateRequest params = new RotateRequest();\n params.setClientId(\"\ ${exampleM2MClientID}\");\n\n Object result = StytchB2BClient.getM2M().getClients().getSecrets().rotate(params);\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: "// POST /v1/m2m/clients/{client_id}/secrets/rotate\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.m2mclientssecrets.RotateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.m2m.clients.secrets.rotate(\n \ \ RotateRequest(\n clientId = \"${exampleM2MClientID}\"\ ,\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: "// POST /v1/m2m/clients/{client_id}/secrets/rotate\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n client_id:\ \ \"${exampleM2MClientID}\",\n};\n\nclient.m2m.clients.secrets.rotate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->m2m->clients->secrets->rotate([\n 'client_id'\ \ => '${exampleM2MClientID}',\n]);" - lang: python label: Python source: "# POST /v1/m2m/clients/{client_id}/secrets/rotate\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.m2m.clients.secrets.rotate(\n\ \ client_id=\"${exampleM2MClientID}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/m2m/clients/{client_id}/secrets/rotate\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.m2m.clients.secrets.rotate(\n client_id:\ \ \"${exampleM2MClientID}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/m2m/clients/{client_id}/secrets/rotate\nuse stytch::b2b::client::Client;\n\ use stytch::consumer::m2m_clients_secrets::RotateRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.m2m.clients.secrets.rotate(\n RotateRequest{\n\ \ client_id: \"${exampleM2MClientID}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/m2m/clients/{client_id}/secrets/rotate\ncurl --request\ \ POST \\\n --url https://test.stytch.com/v1/m2m/clients/${exampleM2MClientID}/secrets/rotate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/magic_links/authenticate: post: summary: Authenticate operationId: api_magic_v1_Authenticate tags: - Magic description: Authenticate a User given a Magic Link. This endpoint verifies that the Magic Link token is valid, hasn't expired or been previously used, and any optional security settings such as IP match or user agent match are satisfied. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_magic_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_magic_v1_AuthenticateResponse' '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: "// POST /v1/magic_links/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n token: \"${token}\",\n session_duration_minutes:\ \ 60,\n};\n\nclient.MagicLinks.Authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/magic_links/authenticate\npackage main\n\nimport (\n\t\ \"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/magiclinks\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &magiclinks.AuthenticateParams{\n\ \t\tToken: \"${token}\",\n\t\tSessionDurationMinutes: 60,\n\ \t}\n\n\tresp, err := client.MagicLinks.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/magic_links/authenticate\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.magiclinks.AuthenticateRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthenticateRequest params =\ \ new AuthenticateRequest();\n params.setToken(\"${token}\");\n \ \ params.setSessionDurationMinutes(60);\n\n Object result =\ \ StytchClient.getMagicLinks().authenticate(params);\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: "// POST /v1/magic_links/authenticate\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.magiclinks.AuthenticateRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.magicLinks.authenticate(\n \ \ AuthenticateRequest(\n token = \"${token}\",\n \ \ sessionDurationMinutes = 60,\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: "// POST /v1/magic_links/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n token: \"${token}\",\n session_duration_minutes:\ \ 60,\n};\n\nclient.magicLinks.authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->magic_links->authenticate([\n 'token' =>\ \ '${token}',\n 'session_duration_minutes' => 60,\n]);" - lang: python label: Python source: "# POST /v1/magic_links/authenticate\nfrom stytch import Client\n\n\ client = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.magic_links.authenticate(\n token=\"${token}\"\ ,\n session_duration_minutes=60,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/magic_links/authenticate\nrequire 'stytch'\n\nclient =\ \ Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.magic_links.authenticate(\n token: \"${token}\",\n\ \ session_duration_minutes: 60\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/magic_links/authenticate\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::magic_links::AuthenticateRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.magic_links.authenticate(\n AuthenticateRequest{\n\ \ token: \"${token}\",\n session_duration_minutes:\ \ 60,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/magic_links/authenticate\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/magic_links/authenticate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"token\":\ \ \"${token}\",\n \"session_duration_minutes\": 60\n }'" /v1/magic_links: post: summary: Create operationId: api_magic_v1_Create tags: - Magic description: 'Create an Embeddable Magic Link token for a User. ### Important usage notes Carefully review the following notes before using Embeddable Magic Links: * Embeddable Magic Link tokens are **sensitive values**. You should handle and store them securely. * Authenticating an Embeddable Magic Link token will not mark any of a user''s delivery factors (email address or phone number) as verified, since we cannot confirm how the token was sent to the user. * Embeddable Magic Links are only available in our Consumer API, and not our B2B API. When sending Embeddable Magic Links via email: * Deliverability is paramount. Carefully test your email copy to ensure it reaches your users'' inboxes. Small changes can result in your emails being sent to spam. * In some cases, email security bots may follow links within incoming emails before your users open them. This consumes the Embeddable Magic Link token, preventing the user from logging in when they later click the link. Our Email Magic Links product automatically prevents this (details [here](https://stytch.com/docs/consumer-auth/authentication/magic-links/redirect-routing)). However, when sending your own emails containing Embeddable Magic Links, you''ll be responsible for detecting and stopping bot traffic using tools like CAPTCHA or [Device Fingerprinting](https://stytch.com/docs/fraud-risk/device-fingerprinting/overview). We also recommend checking out our [Trusted Auth Tokens](https://stytch.com/docs/consumer-auth/authentication/trusted-auth-tokens/overview) product, which is available in both our Consumer and B2B APIs and can be a better fit for some use cases.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_magic_v1_CreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_magic_v1_CreateResponse' '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: "// POST /v1/magic_links\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n};\n\ \nclient.MagicLinks.Create(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/magic_links\npackage main\n\nimport (\n\t\"context\"\n\ \t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/magiclinks\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &magiclinks.CreateParams{\n\t\t\ UserID: \"${userId}\",\n\t}\n\n\tresp, err := client.MagicLinks.Create(context.Background(),\ \ params)\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: "// POST /v1/magic_links\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.magiclinks.CreateRequest;\nimport\ \ com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n public\ \ static void main(String[] args) {\n StytchClient.configure(\"${projectId}\"\ , \"${secret}\");\n\n CreateRequest params = new CreateRequest();\n\ \ params.setUserId(\"${userId}\");\n\n Object result = StytchClient.getMagicLinks().create(params);\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: "// POST /v1/magic_links\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.magiclinks.CreateRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.magicLinks.create(\n CreateRequest(\n\ \ userId = \"${userId}\",\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: "// POST /v1/magic_links\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n};\n\ \nclient.magicLinks.create(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->magic_links->create([\n 'user_id' => '${userId}',\n\ ]);" - lang: python label: Python source: "# POST /v1/magic_links\nfrom stytch import Client\n\nclient = Client(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.magic_links.create(\n user_id=\"${userId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/magic_links\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.magic_links.create(\n\ \ user_id: \"${userId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/magic_links\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::magic_links::CreateRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.magic_links.create(\n CreateRequest{\n \ \ user_id: \"${userId}\",\n ..Default::default()\n }\n\ \ ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/magic_links\ncurl --request POST \\\n --url https://test.stytch.com/v1/magic_links\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"user_id\": \"${userId}\"\n }'" /v1/magic_links/email/send: post: summary: Send operationId: api_magic_v1_magic_links_email_Send tags: - Magic Links description: 'Send a magic link to an existing Stytch user using their email address. If you''d like to create a user and send them a magic link by email with one request, use our [log in or create endpoint](https://stytch.com/docs/api/log-in-or-create-user-by-email). ### Add an email to an existing user This endpoint also allows you to add a new email address to an existing Stytch User. Including a `user_id`, `session_token`, or `session_jwt` in your Send Magic Link by email request will add the new, unverified email address to the existing Stytch User. If the user successfully authenticates within 5 minutes, the new email address will be marked as verified and remain permanently on the existing Stytch User. Otherwise, it will be removed from the User object, and any subsequent login requests using that email address will create a new User. ### Next steps The user is emailed a magic link which redirects them to the provided [redirect URL](https://stytch.com/docs/guides/magic-links/email-magic-links/redirect-routing). Collect the `token` from the URL query parameters, and call [Authenticate magic link](https://stytch.com/docs/api/authenticate-magic-link) to complete authentication.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_magic_v1_magic_links_email_SendRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_magic_v1_magic_links_email_SendResponse' '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: "// POST /v1/magic_links/email/send\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.MagicLinks.Email.Send(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/magic_links/email/send\npackage main\n\nimport (\n\t\"\ context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/magiclinks/email\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &email.SendParams{\n\t\tEmail:\ \ \"${email}\",\n\t}\n\n\tresp, err := client.MagicLinks.Email.Send(context.Background(),\ \ params)\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: "// POST /v1/magic_links/email/send\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.magiclinksemail.SendRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n SendRequest params = new SendRequest();\n\ \ params.setEmail(\"${email}\");\n\n Object result = StytchClient.getMagicLinks().getEmail().send(params);\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: "// POST /v1/magic_links/email/send\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.magiclinksemail.SendRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.magicLinks.email.send(\n SendRequest(\n\ \ email = \"${email}\",\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: "// POST /v1/magic_links/email/send\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.magicLinks.email.send(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->magic_links->email->send([\n 'email' => '${email}',\n\ ]);" - lang: python label: Python source: "# POST /v1/magic_links/email/send\nfrom stytch import Client\n\n\ client = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.magic_links.email.send(\n email=\"${email}\",\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/magic_links/email/send\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.magic_links.email.send(\n\ \ email: \"${email}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/magic_links/email/send\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::magic_links_email::SendRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.magic_links.email.send(\n SendRequest{\n \ \ email: \"${email}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/magic_links/email/send\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/magic_links/email/send \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"email\":\ \ \"${email}\"\n }'" /v1/magic_links/email/login_or_create: post: summary: Loginorcreate operationId: api_magic_v1_magic_links_email_LoginOrCreate tags: - Magic Links description: 'Send either a login or signup Magic Link to the User based on if the email is associated with a User already. A new or pending User will receive a signup Magic Link. An active User will receive a login Magic Link. For more information on how to control the status your Users are created in see the `create_user_as_pending` flag. ### Next steps The User is emailed a Magic Link which redirects them to the provided [redirect URL](https://stytch.com/docs/guides/magic-links/email-magic-links/redirect-routing). Collect the `token` from the URL query parameters and call [Authenticate Magic Link](https://stytch.com/docs/api/authenticate-magic-link) to complete authentication.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_magic_v1_magic_links_email_LoginOrCreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_magic_v1_magic_links_email_LoginOrCreateResponse' '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: "// POST /v1/magic_links/email/login_or_create\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.MagicLinks.Email.LoginOrCreate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/magic_links/email/login_or_create\npackage main\n\nimport\ \ (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/magiclinks/email\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &email.LoginOrCreateParams{\n\t\ \tEmail: \"${email}\",\n\t}\n\n\tresp, err := client.MagicLinks.Email.LoginOrCreate(context.Background(),\ \ params)\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: "// POST /v1/magic_links/email/login_or_create\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.magiclinksemail.LoginOrCreateRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n LoginOrCreateRequest params =\ \ new LoginOrCreateRequest();\n params.setEmail(\"${email}\");\n\n\ \ Object result = StytchClient.getMagicLinks().getEmail().loginOrCreate(params);\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: "// POST /v1/magic_links/email/login_or_create\npackage com.example\n\ \nimport com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.magiclinksemail.LoginOrCreateRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.magicLinks.email.loginOrCreate(\n \ \ LoginOrCreateRequest(\n email = \"${email}\"\ ,\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: "// POST /v1/magic_links/email/login_or_create\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.magicLinks.email.loginOrCreate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->magic_links->email->login_or_create([\n 'email'\ \ => '${email}',\n]);" - lang: python label: Python source: "# POST /v1/magic_links/email/login_or_create\nfrom stytch import\ \ Client\n\nclient = Client(\n project_id=\"${projectId}\",\n secret=\"\ ${secret}\",\n)\n\nresp = client.magic_links.email.login_or_create(\n \ \ email=\"${email}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/magic_links/email/login_or_create\nrequire 'stytch'\n\n\ client = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.magic_links.email.login_or_create(\n\ \ email: \"${email}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/magic_links/email/login_or_create\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::magic_links_email::LoginOrCreateRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.magic_links.email.login_or_create(\n LoginOrCreateRequest{\n\ \ email: \"${email}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/magic_links/email/login_or_create\ncurl --request POST\ \ \\\n --url https://test.stytch.com/v1/magic_links/email/login_or_create\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email\": \"${email}\"\n }'" /v1/magic_links/email/invite: post: summary: Invite operationId: api_magic_v1_magic_links_email_Invite tags: - Magic Links description: 'Create a User and send an invite Magic Link to the provided `email`. The User will be created with a `pending` status until they click the Magic Link in the invite email. ### Next steps The User is emailed a Magic Link which redirects them to the provided [redirect URL](https://stytch.com/docs/guides/magic-links/email-magic-links/redirect-routing). Collect the `token` from the URL query parameters and call [Authenticate Magic Link](https://stytch.com/docs/api/authenticate-magic-link) to complete authentication.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_magic_v1_magic_links_email_InviteRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_magic_v1_magic_links_email_InviteResponse' '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: "// POST /v1/magic_links/email/invite\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.MagicLinks.Email.Invite(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/magic_links/email/invite\npackage main\n\nimport (\n\t\ \"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/magiclinks/email\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &email.InviteParams{\n\t\tEmail:\ \ \"${email}\",\n\t}\n\n\tresp, err := client.MagicLinks.Email.Invite(context.Background(),\ \ params)\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: "// POST /v1/magic_links/email/invite\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.magiclinksemail.InviteRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n InviteRequest params = new InviteRequest();\n\ \ params.setEmail(\"${email}\");\n\n Object result = StytchClient.getMagicLinks().getEmail().invite(params);\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: "// POST /v1/magic_links/email/invite\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.magiclinksemail.InviteRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.magicLinks.email.invite(\n \ \ InviteRequest(\n email = \"${email}\",\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: "// POST /v1/magic_links/email/invite\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.magicLinks.email.invite(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->magic_links->email->invite([\n 'email' =>\ \ '${email}',\n]);" - lang: python label: Python source: "# POST /v1/magic_links/email/invite\nfrom stytch import Client\n\n\ client = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.magic_links.email.invite(\n email=\"${email}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/magic_links/email/invite\nrequire 'stytch'\n\nclient =\ \ Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.magic_links.email.invite(\n email: \"${email}\"\n\ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/magic_links/email/invite\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::magic_links_email::InviteRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.magic_links.email.invite(\n InviteRequest{\n\ \ email: \"${email}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/magic_links/email/invite\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/magic_links/email/invite \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"email\":\ \ \"${email}\"\n }'" /v1/magic_links/email/revoke_invite: post: summary: Revokeinvite operationId: api_magic_v1_magic_links_email_RevokeInvite tags: - Magic Links description: Revoke a pending invite based on the `email` provided. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_magic_v1_magic_links_email_RevokeInviteRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_magic_v1_magic_links_email_RevokeInviteResponse' '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: "// POST /v1/magic_links/email/revoke_invite\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.MagicLinks.Email.RevokeInvite(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/magic_links/email/revoke_invite\npackage main\n\nimport\ \ (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/magiclinks/email\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &email.RevokeInviteParams{\n\t\t\ Email: \"${email}\",\n\t}\n\n\tresp, err := client.MagicLinks.Email.RevokeInvite(context.Background(),\ \ params)\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: "// POST /v1/magic_links/email/revoke_invite\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.magiclinksemail.RevokeInviteRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n RevokeInviteRequest params =\ \ new RevokeInviteRequest();\n params.setEmail(\"${email}\");\n\n\ \ Object result = StytchClient.getMagicLinks().getEmail().revokeInvite(params);\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: "// POST /v1/magic_links/email/revoke_invite\npackage com.example\n\ \nimport com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.magiclinksemail.RevokeInviteRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.magicLinks.email.revokeInvite(\n \ \ RevokeInviteRequest(\n email = \"${email}\",\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: "// POST /v1/magic_links/email/revoke_invite\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.magicLinks.email.revokeInvite(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->magic_links->email->revoke_invite([\n 'email'\ \ => '${email}',\n]);" - lang: python label: Python source: "# POST /v1/magic_links/email/revoke_invite\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.magic_links.email.revoke_invite(\n email=\"${email}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/magic_links/email/revoke_invite\nrequire 'stytch'\n\n\ client = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.magic_links.email.revoke_invite(\n \ \ email: \"${email}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/magic_links/email/revoke_invite\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::magic_links_email::RevokeInviteRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.magic_links.email.revoke_invite(\n RevokeInviteRequest{\n\ \ email: \"${email}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/magic_links/email/revoke_invite\ncurl --request POST \\\ \n --url https://test.stytch.com/v1/magic_links/email/revoke_invite \\\n\ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email\": \"${email}\"\n }'" /v1/b2b/magic_links/authenticate: post: summary: Authenticate operationId: api_b2b_magic_v1_Authenticate tags: - B2B Magic description: "Authenticate a Member with a Magic Link. This endpoint requires\ \ a Magic Link token that is not expired or previously used. If the Member's\ \ status is `pending` or `invited`, they will be updated to `active`.\nProvide\ \ the `session_duration_minutes` parameter to set the lifetime of the session.\ \ If the `session_duration_minutes` parameter is not specified, a Stytch session\ \ will be created with a 60 minute duration.\n\nIf the Member is required\ \ to complete MFA to log in to the Organization, the returned value of `member_authenticated`\ \ will be `false`, and an `intermediate_session_token` will be returned.\n\ The `intermediate_session_token` can be passed into the [OTP SMS Authenticate\ \ endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate\ \ endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), \nor [Recovery\ \ Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover)\ \ to complete the MFA step and acquire a full member session.\nThe `intermediate_session_token`\ \ can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)\ \ or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery)\ \ to join a different Organization or create a new one.\nThe `session_duration_minutes`\ \ and `session_custom_claims` parameters will be ignored.\n\nIf a valid `session_token`\ \ or `session_jwt` is passed in, the Member will not be required to complete\ \ an MFA step." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_magic_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_magic_v1_AuthenticateResponse' '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: "// POST /v1/b2b/magic_links/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n magic_links_token: \"\ ${token}\",\n};\n\nclient.MagicLinks.Authenticate(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/magic_links/authenticate\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/magiclinks\"\n)\n\n\ func 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 := &magiclinks.AuthenticateParams{\n\ \t\tMagicLinksToken: \"${token}\",\n\t}\n\n\tresp, err := client.MagicLinks.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/b2b/magic_links/authenticate\npackage com.example;\n\n\ import com.stytch.java.b2b.models.magiclinks.AuthenticateRequest;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ AuthenticateRequest params = new AuthenticateRequest();\n \ \ params.setMagicLinksToken(\"${token}\");\n\n Object result = StytchB2BClient.getMagicLinks().authenticate(params);\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: "// POST /v1/b2b/magic_links/authenticate\npackage com.example\n\n\ import com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.magiclinks.AuthenticateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.magicLinks.authenticate(\n \ \ AuthenticateRequest(\n magicLinksToken = \"${token}\"\ ,\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: "// POST /v1/b2b/magic_links/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n magic_links_token: \"\ ${token}\",\n};\n\nclient.magicLinks.authenticate(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->magic_links->authenticate([\n 'magic_links_token'\ \ => '${token}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/magic_links/authenticate\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.magic_links.authenticate(\n magic_links_token=\"\ ${token}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/magic_links/authenticate\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.magic_links.authenticate(\n magic_links_token:\ \ \"${token}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/magic_links/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::magic_links::AuthenticateRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.magic_links.authenticate(\n AuthenticateRequest{\n\ \ magic_links_token: \"${token}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/magic_links/authenticate\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/b2b/magic_links/authenticate \\\n -u\ \ '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n\ \ -d '{\n \"magic_links_token\": \"${token}\"\n }'" /v1/b2b/magic_links/email/login_or_signup: post: summary: Loginorsignup operationId: api_b2b_magic_v1_b2b_magic_links_email_LoginOrSignup tags: - B2B Magic Links description: 'Send either a login or signup magic link to a Member. A new, pending, or invited Member will receive a signup Email Magic Link. Members will have a `pending` status until they successfully authenticate. An active Member will receive a login Email Magic Link. The magic link is valid for 60 minutes.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_magic_v1_b2b_magic_links_email_LoginOrSignupRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_magic_v1_b2b_magic_links_email_LoginOrSignupResponse' '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: "// POST /v1/b2b/magic_links/email/login_or_signup\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 email_address: \"${email}\",\n};\n\nclient.MagicLinks.Email.LoginOrSignup(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/magic_links/email/login_or_signup\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/magiclinks/email\"\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 := &email.LoginOrSignupParams{\n\t\ \tOrganizationID: \"${organizationId}\",\n\t\tEmailAddress: \"${email}\"\ ,\n\t}\n\n\tresp, err := client.MagicLinks.Email.LoginOrSignup(context.Background(),\ \ params)\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: "// POST /v1/b2b/magic_links/email/login_or_signup\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.magiclinksemail.LoginOrSignupRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ LoginOrSignupRequest params = new LoginOrSignupRequest();\n \ \ params.setOrganizationId(\"${organizationId}\");\n params.setEmailAddress(\"\ ${email}\");\n\n Object result = StytchB2BClient.getMagicLinks().getEmail().loginOrSignup(params);\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: "// POST /v1/b2b/magic_links/email/login_or_signup\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.magiclinksemail.LoginOrSignupRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.magicLinks.email.loginOrSignup(\n \ \ LoginOrSignupRequest(\n organizationId =\ \ \"${organizationId}\",\n emailAddress = \"${email}\"\ ,\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: "// POST /v1/b2b/magic_links/email/login_or_signup\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 email_address: \"${email}\",\n};\n\nclient.magicLinks.email.loginOrSignup(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->magic_links->email->login_or_signup([\n 'organization_id'\ \ => '${organizationId}',\n 'email_address' => '${email}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/magic_links/email/login_or_signup\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.magic_links.email.login_or_signup(\n\ \ organization_id=\"${organizationId}\",\n email_address=\"${email}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/magic_links/email/login_or_signup\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.magic_links.email.login_or_signup(\n\ \ organization_id: \"${organizationId}\",\n email_address: \"${email}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/magic_links/email/login_or_signup\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::magic_links_email::LoginOrSignupRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.magic_links.email.login_or_signup(\n LoginOrSignupRequest{\n\ \ organization_id: \"${organizationId}\",\n email_address:\ \ \"${email}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/magic_links/email/login_or_signup\ncurl --request\ \ POST \\\n --url https://test.stytch.com/v1/b2b/magic_links/email/login_or_signup\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"organization_id\": \"${organizationId}\",\n \"email_address\"\ : \"${email}\"\n }'" /v1/b2b/magic_links/email/invite: post: summary: Invite operationId: api_b2b_magic_v1_b2b_magic_links_email_Invite tags: - B2B Magic Links description: 'Send an invite email to a new Member to join an Organization. The Member will be created with an `invited` status until they successfully authenticate. Sending invites to `pending` Members will update their status to `invited`. Sending invites to already `active` Members will return an error. The magic link invite will be valid for 1 week. ## Revoke an invite To revoke an existing invite, use the [Delete Member](https://stytch.com/docs/b2b/api/delete-member) endpoint. This will both delete the invited Member from the target Organization and revoke all existing invite emails.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_magic_v1_b2b_magic_links_email_InviteRequest' parameters: - 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_magic_v1_b2b_magic_links_email_InviteResponse' '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: "// POST /v1/b2b/magic_links/email/invite\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 email_address: \"${email}\",\n};\n\nconst options\ \ = {\n authorization: {\n session_token: '${sessionToken}',\n },\n\ };\n\nclient.MagicLinks.Email.Invite(params, options)\n .then(resp => {\ \ console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/magic_links/email/invite\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/magiclinks/email\"\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 := &email.InviteParams{\n\t\tOrganizationID:\ \ \"${organizationId}\",\n\t\tEmailAddress: \"${email}\",\n\t}\n\n\toptions\ \ := &email.InviteParamsOptions{\n\t\tAuthorization: methodoptions.Authorization{\n\ \t\t\tSessionToken: \"${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err :=\ \ client.MagicLinks.Email.Invite(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: "// POST /v1/b2b/magic_links/email/invite\npackage com.example;\n\n\ import com.stytch.java.b2b.models.magiclinksemail.InviteRequest;\nimport\ \ com.stytch.java.b2b.models.magiclinksemail.InviteRequestOptions;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n InviteRequest params = new InviteRequest();\n\ \ params.setOrganizationId(\"${organizationId}\");\n params.setEmailAddress(\"\ ${email}\");\n\n InviteRequestOptions options = new InviteRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getMagicLinks().getEmail().invite(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: "// POST /v1/b2b/magic_links/email/invite\npackage com.example\n\n\ import com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.magiclinksemail.InviteRequest\n\ import com.stytch.java.b2b.models.magiclinksemail.InviteRequestOptions\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.magicLinks.email.invite(\n \ \ InviteRequest(\n organizationId = \"${organizationId}\"\ ,\n emailAddress = \"${email}\",\n ),\n\ \ InviteRequestOptions(\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: "// POST /v1/b2b/magic_links/email/invite\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 email_address: \"${email}\",\n};\n\nconst options\ \ = {\n authorization: {\n session_token: '${sessionToken}',\n },\n\ };\n\nclient.magicLinks.email.invite(params, options)\n .then(resp => {\ \ console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->magic_links->email->invite([\n 'organization_id'\ \ => '${organizationId}',\n 'email_address' => '${email}',\n], [\n \ \ 'authorization' => ['session_token' => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# POST /v1/b2b/magic_links/email/invite\nfrom stytch import B2BClient\n\ from stytch.b2b.models.magic_links_email import InviteRequestOptions\nfrom\ \ stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.magic_links.email.invite(\n organization_id=\"${organizationId}\"\ ,\n email_address=\"${email}\",\n method_options=InviteRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/magic_links/email/invite\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.magic_links.email.invite(\n organization_id:\ \ \"${organizationId}\",\n email_address: \"${email}\",\n method_options:\ \ StytchB2B::MagicLinks::Email::InviteRequestOptions.new(\n authorization:\ \ Stytch::MethodOptions::Authorization.new(session_token: '${sessionToken}')\n\ \ )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/magic_links/email/invite\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::magic_links_email::InviteRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.magic_links.email.invite(\n InviteRequest{\n \ \ organization_id: \"${organizationId}\",\n email_address:\ \ \"${email}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/magic_links/email/invite\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/b2b/magic_links/email/invite \\\n -u\ \ '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n\ \ -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \"organization_id\"\ : \"${organizationId}\",\n \"email_address\": \"${email}\"\n }'" /v1/b2b/magic_links/email/discovery/send: post: summary: Send operationId: api_b2b_magic_v1_b2b_magic_links_email_discovery_Send tags: - Email description: Send a discovery magic link to an email address. The magic link is valid for 60 minutes. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_magic_v1_b2b_magic_links_email_discovery_SendRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_magic_v1_b2b_magic_links_email_discovery_SendResponse' '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: "// POST /v1/b2b/magic_links/email/discovery/send\nconst stytch =\ \ require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n email_address:\ \ \"${email}\",\n};\n\nclient.MagicLinks.Email.Discovery.Send(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/magic_links/email/discovery/send\npackage main\n\n\ import (\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/magiclinks/email/discovery\"\ \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 := &discovery.SendParams{\n\t\tEmailAddress:\ \ \"${email}\",\n\t}\n\n\tresp, err := client.MagicLinks.Email.Discovery.Send(context.Background(),\ \ params)\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: "// POST /v1/b2b/magic_links/email/discovery/send\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.magiclinksemaildiscovery.SendRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ SendRequest params = new SendRequest();\n params.setEmailAddress(\"\ ${email}\");\n\n Object result = StytchB2BClient.getMagicLinks().getEmail().getDiscovery().send(params);\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: "// POST /v1/b2b/magic_links/email/discovery/send\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.magiclinksemaildiscovery.SendRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.magicLinks.email.discovery.send(\n \ \ SendRequest(\n emailAddress = \"${email}\"\ ,\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: "// POST /v1/b2b/magic_links/email/discovery/send\nconst stytch =\ \ require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n email_address:\ \ \"${email}\",\n};\n\nclient.magicLinks.email.discovery.send(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->magic_links->email->discovery->send([\n 'email_address'\ \ => '${email}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/magic_links/email/discovery/send\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.magic_links.email.discovery.send(\n\ \ email_address=\"${email}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/magic_links/email/discovery/send\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.magic_links.email.discovery.send(\n\ \ email_address: \"${email}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/magic_links/email/discovery/send\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::magic_links_email_discovery::SendRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.magic_links.email.discovery.send(\n SendRequest{\n\ \ email_address: \"${email}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/magic_links/email/discovery/send\ncurl --request POST\ \ \\\n --url https://test.stytch.com/v1/b2b/magic_links/email/discovery/send\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email_address\": \"${email}\"\n }'" /v1/b2b/magic_links/discovery/authenticate: post: summary: Authenticate operationId: api_b2b_magic_v1_b2b_magic_links_discovery_Authenticate tags: - B2B Magic Links description: Authenticates the Discovery Magic Link token and exchanges it for an Intermediate Session Token. Intermediate Session Tokens can be used for various Discovery login flows and are valid for 10 minutes. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_magic_v1_b2b_magic_links_discovery_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_magic_v1_b2b_magic_links_discovery_AuthenticateResponse' '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: "// POST /v1/b2b/magic_links/discovery/authenticate\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n discovery_magic_links_token:\ \ \"${token}\",\n};\n\nclient.MagicLinks.Discovery.Authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/magic_links/discovery/authenticate\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/magiclinks/discovery\"\ \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 := &discovery.AuthenticateParams{\n\ \t\tDiscoveryMagicLinksToken: \"${token}\",\n\t}\n\n\tresp, err := client.MagicLinks.Discovery.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/b2b/magic_links/discovery/authenticate\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.magiclinksdiscovery.AuthenticateRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ AuthenticateRequest params = new AuthenticateRequest();\n \ \ params.setDiscoveryMagicLinksToken(\"${token}\");\n\n Object result\ \ = StytchB2BClient.getMagicLinks().getDiscovery().authenticate(params);\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: "// POST /v1/b2b/magic_links/discovery/authenticate\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.magiclinksdiscovery.AuthenticateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.magicLinks.discovery.authenticate(\n \ \ AuthenticateRequest(\n discoveryMagicLinksToken\ \ = \"${token}\",\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: "// POST /v1/b2b/magic_links/discovery/authenticate\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n discovery_magic_links_token:\ \ \"${token}\",\n};\n\nclient.magicLinks.discovery.authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->magic_links->discovery->authenticate([\n \ \ 'discovery_magic_links_token' => '${token}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/magic_links/discovery/authenticate\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.magic_links.discovery.authenticate(\n\ \ discovery_magic_links_token=\"${token}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/magic_links/discovery/authenticate\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.magic_links.discovery.authenticate(\n\ \ discovery_magic_links_token: \"${token}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/magic_links/discovery/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::magic_links_discovery::AuthenticateRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.magic_links.discovery.authenticate(\n AuthenticateRequest{\n\ \ discovery_magic_links_token: \"${token}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/magic_links/discovery/authenticate\ncurl --request\ \ POST \\\n --url https://test.stytch.com/v1/b2b/magic_links/discovery/authenticate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"discovery_magic_links_token\": \"${token}\"\n }'" /v1/b2b/oauth/authenticate: post: summary: Authenticate operationId: api_b2b_oauth_v1_Authenticate tags: - B2B Oauth description: 'Authenticate a Member given a `token`. This endpoint verifies that the member completed the OAuth flow by verifying that the token is valid and hasn''t expired. Provide the `session_duration_minutes` parameter to set the lifetime of the session. If the `session_duration_minutes` parameter is not specified, a Stytch session will be created with a 60 minute duration. If the Member is required to complete MFA to log in to the Organization, the returned value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. The `intermediate_session_token` can be passed into the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA step and acquire a full member session. The `intermediate_session_token` can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to join a different Organization or create a new one. The `session_duration_minutes` and `session_custom_claims` parameters will be ignored. If a valid `session_token` or `session_jwt` is passed in, the Member will not be required to complete an MFA step. If the Member is logging in via an OAuth provider that does not fully verify the email, the returned value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. The `primary_required` field details the authentication flow the Member must perform in order to [complete a step-up authentication](https://stytch.com/docs/b2b/guides/oauth/auth-flows) into the organization. The `intermediate_session_token` must be passed into that authentication flow. We''re actively accepting requests for new OAuth providers! Please [email us](mailto:support@stytch.com) or [post in our community](https://stytch.com/docs/b2b/resources) if you are looking for an OAuth provider that is not currently supported.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_oauth_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_oauth_v1_AuthenticateResponse' '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: "// POST /v1/b2b/oauth/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n oauth_token: \"${exampleOAuthAuthenticateToken}\"\ ,\n};\n\nclient.OAuth.Authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/oauth/authenticate\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/oauth\"\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 := &oauth.AuthenticateParams{\n\t\t\ OAuthToken: \"${exampleOAuthAuthenticateToken}\",\n\t}\n\n\tresp, err :=\ \ client.OAuth.Authenticate(context.Background(), params)\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: "// POST /v1/b2b/oauth/authenticate\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.models.oauth.AuthenticateRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthenticateRequest params =\ \ new AuthenticateRequest();\n params.setOAuthToken(\"${exampleOAuthAuthenticateToken}\"\ );\n\n Object result = StytchB2BClient.getOAuth().authenticate(params);\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: "// POST /v1/b2b/oauth/authenticate\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.oauth.AuthenticateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.oauth.authenticate(\n AuthenticateRequest(\n\ \ oauthToken = \"${exampleOAuthAuthenticateToken}\",\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: "// POST /v1/b2b/oauth/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n oauth_token: \"${exampleOAuthAuthenticateToken}\"\ ,\n};\n\nclient.oauth.authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->oauth->authenticate([\n 'oauth_token' =>\ \ '${exampleOAuthAuthenticateToken}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/oauth/authenticate\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.oauth.authenticate(\n oauth_token=\"${exampleOAuthAuthenticateToken}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/oauth/authenticate\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.oauth.authenticate(\n\ \ oauth_token: \"${exampleOAuthAuthenticateToken}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/oauth/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::oauth::AuthenticateRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.oauth.authenticate(\n AuthenticateRequest{\n \ \ oauth_token: \"${exampleOAuthAuthenticateToken}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/oauth/authenticate\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/b2b/oauth/authenticate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"oauth_token\"\ : \"${exampleOAuthAuthenticateToken}\"\n }'" /v1/b2b/oauth/discovery/authenticate: post: summary: Authenticate operationId: api_b2b_oauth_v1_b2b_oauth_discovery_Authenticate tags: - B2B Oauth description: 'Authenticates the Discovery OAuth token and exchanges it for an Intermediate Session Token. Intermediate Session Tokens can be used for various Discovery login flows and are valid for 10 minutes.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_oauth_v1_b2b_oauth_discovery_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_oauth_v1_b2b_oauth_discovery_AuthenticateResponse' '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: "// POST /v1/b2b/oauth/discovery/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n discovery_oauth_token:\ \ \"${exampleOAuthAuthenticateToken}\",\n};\n\nclient.OAuth.Discovery.Authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/oauth/discovery/authenticate\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/oauth/discovery\"\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 := &discovery.AuthenticateParams{\n\ \t\tDiscoveryOAuthToken: \"${exampleOAuthAuthenticateToken}\",\n\t}\n\n\t\ resp, err := client.OAuth.Discovery.Authenticate(context.Background(), params)\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: "// POST /v1/b2b/oauth/discovery/authenticate\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.oauthdiscovery.AuthenticateRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ AuthenticateRequest params = new AuthenticateRequest();\n \ \ params.setDiscoveryOAuthToken(\"${exampleOAuthAuthenticateToken}\");\n\ \n Object result = StytchB2BClient.getOAuth().getDiscovery().authenticate(params);\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: "// POST /v1/b2b/oauth/discovery/authenticate\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.oauthdiscovery.AuthenticateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.oauth.discovery.authenticate(\n \ \ AuthenticateRequest(\n discoveryOAuthToken\ \ = \"${exampleOAuthAuthenticateToken}\",\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: "// POST /v1/b2b/oauth/discovery/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n discovery_oauth_token:\ \ \"${exampleOAuthAuthenticateToken}\",\n};\n\nclient.oauth.discovery.authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->oauth->discovery->authenticate([\n 'discovery_oauth_token'\ \ => '${exampleOAuthAuthenticateToken}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/oauth/discovery/authenticate\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.oauth.discovery.authenticate(\n discovery_oauth_token=\"\ ${exampleOAuthAuthenticateToken}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/oauth/discovery/authenticate\nrequire 'stytch'\n\n\ client = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.oauth.discovery.authenticate(\n discovery_oauth_token:\ \ \"${exampleOAuthAuthenticateToken}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/oauth/discovery/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::oauth_discovery::AuthenticateRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.oauth.discovery.authenticate(\n AuthenticateRequest{\n\ \ discovery_oauth_token: \"${exampleOAuthAuthenticateToken}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/oauth/discovery/authenticate\ncurl --request POST\ \ \\\n --url https://test.stytch.com/v1/b2b/oauth/discovery/authenticate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"discovery_oauth_token\": \"${exampleOAuthAuthenticateToken}\"\ \n }'" /v1/b2b/otps/sms/send: post: summary: Send operationId: api_b2b_otp_v1_b2b_otp_sms_Send tags: - B2B Otp description: "Send a One-Time Passcode (OTP) to a Member's phone number.\n\n\ If the Member already has a phone number, the `mfa_phone_number` field is\ \ not needed; the endpoint will send an OTP to the number associated with\ \ the Member.\nIf the Member does not have a phone number, the endpoint will\ \ send an OTP to the `mfa_phone_number` provided and link the `mfa_phone_number`\ \ with the Member.\n\nAn error will be thrown if the Member already has a\ \ phone number and the provided `mfa_phone_number` does not match the existing\ \ one.\n\nOTP codes expire after two minutes. Note that sending another OTP\ \ code before the first has expired will invalidate the first code.\n\nIf\ \ a Member has a phone number and is enrolled in MFA, then after a successful\ \ primary authentication event (e.g. [email magic link](https://stytch.com/docs/b2b/api/authenticate-magic-link)\ \ or [SSO](https://stytch.com/docs/b2b/api/sso-authenticate) login is complete),\ \ an SMS OTP will automatically be sent to their phone number. In that case,\ \ this endpoint should only be used for subsequent authentication events,\ \ such as prompting a Member for an OTP again after a period of inactivity.\n\ \nIf the Member already has an active MFA factor, then passing an intermediate\ \ session token, session token, or session JWT with the existing MFA factor\ \ on it is required to prevent bypassing MFA. \n\nOtherwise, passing an intermediate\ \ session token, session token, or session JWT is not required, but if passed\ \ must match the `member_id` passed.\n\n### Cost to send SMS OTP\nBefore configuring\ \ SMS or WhatsApp OTPs, please review how Stytch [bills the costs of international\ \ OTPs](https://stytch.com/pricing) and understand how to protect your app\ \ against [toll fraud](https://stytch.com/docs/guides/passcodes/toll-fraud/overview).\n\ \nEven when international SMS is enabled, we do not support sending SMS to\ \ countries on our [Unsupported countries list](https://stytch.com/docs/guides/passcodes/unsupported-countries).\n\ \n__Note:__ SMS to phone numbers outside of the US and Canada is disabled\ \ by default for customers who did not use SMS prior to October 2023. If you're\ \ interested in sending international SMS, please add those countries to your\ \ Project's allowlist via the [Dashboard](https://stytch.com/dashboard/country-code-allowlists)\ \ or [Programmatic Workspace Actions](https://stytch.com/docs/workspace-management/pwa/set-allowed-country-codes),\ \ and [add credit card details](https://stytch.com/dashboard/settings/billing)\ \ to your account." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_otp_v1_b2b_otp_sms_SendRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_otp_v1_b2b_otp_sms_SendResponse' '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: "// POST /v1/b2b/otps/sms/send\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 member_id: \"${memberId}\",\n};\n\nclient.OTPs.Sms.Send(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/otps/sms/send\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/otp/sms\"\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 := &sms.SendParams{\n\t\tOrganizationID:\ \ \"${organizationId}\",\n\t\tMemberID: \"${memberId}\",\n\t}\n\n\t\ resp, err := client.OTPs.Sms.Send(context.Background(), params)\n\tif err\ \ != nil {\n\t\tlog.Fatalf(\"error in method call: %v\", err)\n\t}\n\n\t\ log.Println(resp)\n}\n" - lang: java label: Java source: "// POST /v1/b2b/otps/sms/send\npackage com.example;\n\nimport com.stytch.java.b2b.models.otpsms.SendRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ SendRequest params = new SendRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setMemberId(\"${memberId}\");\n\n\ \ Object result = StytchB2BClient.getOTPs().getSms().send(params);\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: "// POST /v1/b2b/otps/sms/send\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.b2b.models.otpsms.SendRequest\n\nfun main() {\n \ \ StytchB2BClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.otps.sms.send(\n SendRequest(\n\ \ organizationId = \"${organizationId}\",\n \ \ memberId = \"${memberId}\",\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: "// POST /v1/b2b/otps/sms/send\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 member_id: \"${memberId}\",\n};\n\nclient.otps.sms.send(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->otps->sms->send([\n 'organization_id' =>\ \ '${organizationId}',\n 'member_id' => '${memberId}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/otps/sms/send\nfrom stytch import B2BClient\n\nclient\ \ = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.otps.sms.send(\n organization_id=\"${organizationId}\"\ ,\n member_id=\"${memberId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/otps/sms/send\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.otps.sms.send(\n\ \ organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/otps/sms/send\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::otp_sms::SendRequest;\n\nfn main() {\n let client =\ \ Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp =\ \ client.otps.sms.send(\n SendRequest{\n organization_id:\ \ \"${organizationId}\",\n member_id: \"${memberId}\",\n \ \ ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/otps/sms/send\ncurl --request POST \\\n --url https://test.stytch.com/v1/b2b/otps/sms/send\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"organization_id\": \"${organizationId}\",\n \"member_id\"\ : \"${memberId}\"\n }'" /v1/b2b/otps/sms/authenticate: post: summary: Authenticate operationId: api_b2b_otp_v1_b2b_otp_sms_Authenticate tags: - B2B Otp description: 'SMS OTPs may not be used as a primary authentication mechanism. They can be used to complete an MFA requirement, or they can be used as a step-up factor to be added to an existing session. This endpoint verifies that the one-time passcode (OTP) is valid and hasn''t expired or been previously used. OTP codes expire after two minutes. A given Member may only have a single active OTP code at any given time. If a Member requests another OTP code before the first one has expired, the first one will be invalidated. Exactly one of `intermediate_session_token`, `session_token`, or `session_jwt` must be provided in the request. If an intermediate session token is provided, this operation will consume it. Intermediate session tokens are generated upon successful calls to primary authenticate methods in the case where MFA is required, such as [email magic link authenticate](https://stytch.com/docs/b2b/api/authenticate-magic-link), or upon successful calls to discovery authenticate methods, such as [email magic link discovery authenticate](https://stytch.com/docs/b2b/api/authenticate-discovery-magic-link). If the Organization''s MFA policy is `REQUIRED_FOR_ALL`, a successful OTP authentication will change the Member''s `mfa_enrolled` status to `true` if it is not already `true`. If the Organization''s MFA policy is `OPTIONAL`, the Member''s MFA enrollment can be toggled by passing in a value for the `set_mfa_enrollment` field. The Member''s MFA enrollment can also be toggled through the [Update Member](https://stytch.com/docs/b2b/api/update-member) endpoint. Provide the `session_duration_minutes` parameter to set the lifetime of the session. If the `session_duration_minutes` parameter is not specified, a Stytch session will be created with a duration of 60 minutes.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_otp_v1_b2b_otp_sms_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_otp_v1_b2b_otp_sms_AuthenticateResponse' '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: "// POST /v1/b2b/otps/sms/authenticate\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 member_id: \"${memberId}\",\n code: \"${exampleCode}\"\ ,\n intermediate_session_token: \"${token}\",\n};\n\nclient.OTPs.Sms.Authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/otps/sms/authenticate\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/otp/sms\"\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 := &sms.AuthenticateParams{\n\t\t\ OrganizationID: \"${organizationId}\",\n\t\tMemberID: \ \ \"${memberId}\",\n\t\tCode: \"${exampleCode}\"\ ,\n\t\tIntermediateSessionToken: \"${token}\",\n\t}\n\n\tresp, err := client.OTPs.Sms.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/b2b/otps/sms/authenticate\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.models.otpsms.AuthenticateRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthenticateRequest params =\ \ new AuthenticateRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n params.setMemberId(\"${memberId}\");\n params.setCode(\"\ ${exampleCode}\");\n params.setIntermediateSessionToken(\"${token}\"\ );\n\n Object result = StytchB2BClient.getOTPs().getSms().authenticate(params);\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: "// POST /v1/b2b/otps/sms/authenticate\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.otpsms.AuthenticateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.otps.sms.authenticate(\n \ \ AuthenticateRequest(\n organizationId = \"${organizationId}\"\ ,\n memberId = \"${memberId}\",\n \ \ code = \"${exampleCode}\",\n intermediateSessionToken\ \ = \"${token}\",\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: "// POST /v1/b2b/otps/sms/authenticate\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 member_id: \"${memberId}\",\n code: \"${exampleCode}\"\ ,\n intermediate_session_token: \"${token}\",\n};\n\nclient.otps.sms.authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->otps->sms->authenticate([\n 'organization_id'\ \ => '${organizationId}',\n 'member_id' => '${memberId}',\n 'code'\ \ => '${exampleCode}',\n 'intermediate_session_token' => '${token}',\n\ ]);" - lang: python label: Python source: "# POST /v1/b2b/otps/sms/authenticate\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.otps.sms.authenticate(\n organization_id=\"${organizationId}\"\ ,\n member_id=\"${memberId}\",\n code=\"${exampleCode}\",\n intermediate_session_token=\"\ ${token}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/otps/sms/authenticate\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.otps.sms.authenticate(\n organization_id:\ \ \"${organizationId}\",\n member_id: \"${memberId}\",\n code: \"${exampleCode}\"\ ,\n intermediate_session_token: \"${token}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/otps/sms/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::otp_sms::AuthenticateRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.otps.sms.authenticate(\n AuthenticateRequest{\n \ \ organization_id: \"${organizationId}\",\n member_id: \"\ ${memberId}\",\n code: \"${exampleCode}\",\n intermediate_session_token:\ \ Some(String::from(\"${token}\")),\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/otps/sms/authenticate\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/b2b/otps/sms/authenticate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"organization_id\"\ : \"${organizationId}\",\n \"member_id\": \"${memberId}\",\n \"code\"\ : \"${exampleCode}\",\n \"intermediate_session_token\": \"${token}\"\n\ \ }'" /v1/b2b/otps/email/login_or_signup: post: summary: Loginorsignup operationId: api_b2b_otp_v1_b2b_otp_email_LoginOrSignup tags: - B2B Otp description: 'Send either a login or signup email OTP to a Member. A new, pending, or invited Member will receive a signup email OTP. Non-active members will have a pending status until they successfully authenticate. An active Member will receive a login email OTP. The OTP is valid for 10 minutes. Only the most recently sent OTP is valid: when an OTP is sent, all OTPs previously sent to the same email address are invalidated, even if unused or unexpired.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_otp_v1_b2b_otp_email_LoginOrSignupRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_otp_v1_b2b_otp_email_LoginOrSignupResponse' '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: "// POST /v1/b2b/otps/email/login_or_signup\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 email_address: \"${email}\",\n};\n\nclient.OTPs.Email.LoginOrSignup(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/otps/email/login_or_signup\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/otp/email\"\n)\n\n\ func 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 := &email.LoginOrSignupParams{\n\t\ \tOrganizationID: \"${organizationId}\",\n\t\tEmailAddress: \"${email}\"\ ,\n\t}\n\n\tresp, err := client.OTPs.Email.LoginOrSignup(context.Background(),\ \ params)\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: "// POST /v1/b2b/otps/email/login_or_signup\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.otpemail.LoginOrSignupRequest;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ LoginOrSignupRequest params = new LoginOrSignupRequest();\n \ \ params.setOrganizationId(\"${organizationId}\");\n params.setEmailAddress(\"\ ${email}\");\n\n Object result = StytchB2BClient.getOTPs().getEmail().loginOrSignup(params);\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: "// POST /v1/b2b/otps/email/login_or_signup\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.otpemail.LoginOrSignupRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.otps.email.loginOrSignup(\n \ \ LoginOrSignupRequest(\n organizationId = \"${organizationId}\"\ ,\n emailAddress = \"${email}\",\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: "// POST /v1/b2b/otps/email/login_or_signup\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 email_address: \"${email}\",\n};\n\nclient.otps.email.loginOrSignup(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->otps->email->login_or_signup([\n 'organization_id'\ \ => '${organizationId}',\n 'email_address' => '${email}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/otps/email/login_or_signup\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.otps.email.login_or_signup(\n organization_id=\"\ ${organizationId}\",\n email_address=\"${email}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/otps/email/login_or_signup\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.otps.email.login_or_signup(\n organization_id:\ \ \"${organizationId}\",\n email_address: \"${email}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/otps/email/login_or_signup\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::otp_email::LoginOrSignupRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.otps.email.login_or_signup(\n LoginOrSignupRequest{\n\ \ organization_id: \"${organizationId}\",\n email_address:\ \ \"${email}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/otps/email/login_or_signup\ncurl --request POST \\\ \n --url https://test.stytch.com/v1/b2b/otps/email/login_or_signup \\\n\ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"organization_id\": \"${organizationId}\",\n \"email_address\"\ : \"${email}\"\n }'" /v1/b2b/otps/email/authenticate: post: summary: Authenticate operationId: api_b2b_otp_v1_b2b_otp_email_Authenticate tags: - B2B Otp description: "Authenticate a Member with a one-time passcode (OTP). This endpoint\ \ requires an OTP that is not expired or previously used. \nOTPs have a default\ \ expiry of 10 minutes. If the Member's status is `pending` or `invited`,\ \ they will be updated to `active`.\nProvide the `session_duration_minutes`\ \ parameter to set the lifetime of the session. If the `session_duration_minutes`\ \ parameter is not specified, a Stytch session will be created with a 60 minute\ \ duration.\n\nIf the Member is required to complete MFA to log in to the\ \ Organization, the returned value of `member_authenticated` will be `false`,\ \ and an `intermediate_session_token` will be returned.\nThe `intermediate_session_token`\ \ can be passed into the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms),\ \ [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),\ \ \nor [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover)\ \ to complete the MFA step and acquire a full member session.\nThe `intermediate_session_token`\ \ can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session)\ \ or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery)\ \ to join a different Organization or create a new one.\nThe `session_duration_minutes`\ \ and `session_custom_claims` parameters will be ignored.\n\nIf a valid `session_token`\ \ or `session_jwt` is passed in, the Member will not be required to complete\ \ an MFA step." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_otp_v1_b2b_otp_email_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_otp_v1_b2b_otp_email_AuthenticateResponse' '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: "// POST /v1/b2b/otps/email/authenticate\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 email_address: \"${email}\",\n code: \"${exampleCode}\"\ ,\n};\n\nclient.OTPs.Email.Authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/otps/email/authenticate\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/otp/email\"\n)\n\n\ func 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 := &email.AuthenticateParams{\n\t\t\ OrganizationID: \"${organizationId}\",\n\t\tEmailAddress: \"${email}\"\ ,\n\t\tCode: \"${exampleCode}\",\n\t}\n\n\tresp, err := client.OTPs.Email.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/b2b/otps/email/authenticate\npackage com.example;\n\n\ import com.stytch.java.b2b.models.otpemail.AuthenticateRequest;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ AuthenticateRequest params = new AuthenticateRequest();\n \ \ params.setOrganizationId(\"${organizationId}\");\n params.setEmailAddress(\"\ ${email}\");\n params.setCode(\"${exampleCode}\");\n\n Object\ \ result = StytchB2BClient.getOTPs().getEmail().authenticate(params);\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: "// POST /v1/b2b/otps/email/authenticate\npackage com.example\n\n\ import com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.otpemail.AuthenticateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.otps.email.authenticate(\n \ \ AuthenticateRequest(\n organizationId = \"${organizationId}\"\ ,\n emailAddress = \"${email}\",\n \ \ code = \"${exampleCode}\",\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: "// POST /v1/b2b/otps/email/authenticate\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 email_address: \"${email}\",\n code: \"${exampleCode}\"\ ,\n};\n\nclient.otps.email.authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->otps->email->authenticate([\n 'organization_id'\ \ => '${organizationId}',\n 'email_address' => '${email}',\n 'code'\ \ => '${exampleCode}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/otps/email/authenticate\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.otps.email.authenticate(\n organization_id=\"${organizationId}\"\ ,\n email_address=\"${email}\",\n code=\"${exampleCode}\",\n)\n\n\ print(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/otps/email/authenticate\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.otps.email.authenticate(\n organization_id:\ \ \"${organizationId}\",\n email_address: \"${email}\",\n code: \"${exampleCode}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/otps/email/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::otp_email::AuthenticateRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.otps.email.authenticate(\n AuthenticateRequest{\n\ \ organization_id: \"${organizationId}\",\n email_address:\ \ \"${email}\",\n code: \"${exampleCode}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/otps/email/authenticate\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/b2b/otps/email/authenticate \\\n -u\ \ '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n\ \ -d '{\n \"organization_id\": \"${organizationId}\",\n \"email_address\"\ : \"${email}\",\n \"code\": \"${exampleCode}\"\n }'" /v1/b2b/otps/email/discovery/send: post: summary: Send operationId: api_b2b_otp_v1_b2b_otp_email_discovery_Send tags: - Email description: 'Send a discovery OTP to an email address. The OTP is valid for 10 minutes. Only the most recently sent OTP is valid: when an OTP is sent, all OTPs previously sent to the same email address are invalidated, even if unused or unexpired.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_otp_v1_b2b_otp_email_discovery_SendRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_otp_v1_b2b_otp_email_discovery_SendResponse' '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: "// POST /v1/b2b/otps/email/discovery/send\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n email_address: \"${email}\"\ ,\n};\n\nclient.OTPs.Email.Discovery.Send(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/otps/email/discovery/send\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/otp/email/discovery\"\ \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 := &discovery.SendParams{\n\t\tEmailAddress:\ \ \"${email}\",\n\t}\n\n\tresp, err := client.OTPs.Email.Discovery.Send(context.Background(),\ \ params)\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: "// POST /v1/b2b/otps/email/discovery/send\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.otpemaildiscovery.SendRequest;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ SendRequest params = new SendRequest();\n params.setEmailAddress(\"\ ${email}\");\n\n Object result = StytchB2BClient.getOTPs().getEmail().getDiscovery().send(params);\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: "// POST /v1/b2b/otps/email/discovery/send\npackage com.example\n\n\ import com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.otpemaildiscovery.SendRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.otps.email.discovery.send(\n \ \ SendRequest(\n emailAddress = \"${email}\",\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: "// POST /v1/b2b/otps/email/discovery/send\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n email_address: \"${email}\"\ ,\n};\n\nclient.otps.email.discovery.send(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->otps->email->discovery->send([\n 'email_address'\ \ => '${email}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/otps/email/discovery/send\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.otps.email.discovery.send(\n email_address=\"${email}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/otps/email/discovery/send\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.otps.email.discovery.send(\n email_address:\ \ \"${email}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/otps/email/discovery/send\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::otp_email_discovery::SendRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.otps.email.discovery.send(\n SendRequest{\n \ \ email_address: \"${email}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/otps/email/discovery/send\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/b2b/otps/email/discovery/send \\\n \ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email_address\": \"${email}\"\n }'" /v1/b2b/otps/email/discovery/authenticate: post: summary: Authenticate operationId: api_b2b_otp_v1_b2b_otp_email_discovery_Authenticate tags: - Email description: Authenticates the OTP and returns an intermediate session token. Intermediate session tokens can be used for various Discovery login flows and are valid for 10 minutes. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_otp_v1_b2b_otp_email_discovery_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_otp_v1_b2b_otp_email_discovery_AuthenticateResponse' '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: "// POST /v1/b2b/otps/email/discovery/authenticate\nconst stytch =\ \ require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n email_address:\ \ \"${email}\",\n code: \"${exampleCode}\",\n};\n\nclient.OTPs.Email.Discovery.Authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/otps/email/discovery/authenticate\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/otp/email/discovery\"\ \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 := &discovery.AuthenticateParams{\n\ \t\tEmailAddress: \"${email}\",\n\t\tCode: \"${exampleCode}\",\n\ \t}\n\n\tresp, err := client.OTPs.Email.Discovery.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/b2b/otps/email/discovery/authenticate\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.otpemaildiscovery.AuthenticateRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ AuthenticateRequest params = new AuthenticateRequest();\n \ \ params.setEmailAddress(\"${email}\");\n params.setCode(\"${exampleCode}\"\ );\n\n Object result = StytchB2BClient.getOTPs().getEmail().getDiscovery().authenticate(params);\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: "// POST /v1/b2b/otps/email/discovery/authenticate\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.otpemaildiscovery.AuthenticateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.otps.email.discovery.authenticate(\n \ \ AuthenticateRequest(\n emailAddress =\ \ \"${email}\",\n code = \"${exampleCode}\",\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: "// POST /v1/b2b/otps/email/discovery/authenticate\nconst stytch =\ \ require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n email_address:\ \ \"${email}\",\n code: \"${exampleCode}\",\n};\n\nclient.otps.email.discovery.authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->otps->email->discovery->authenticate([\n \ \ 'email_address' => '${email}',\n 'code' => '${exampleCode}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/otps/email/discovery/authenticate\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.otps.email.discovery.authenticate(\n\ \ email_address=\"${email}\",\n code=\"${exampleCode}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/otps/email/discovery/authenticate\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.otps.email.discovery.authenticate(\n\ \ email_address: \"${email}\",\n code: \"${exampleCode}\"\n \n)\n\nputs\ \ resp" - lang: rust label: Rust source: "// POST /v1/b2b/otps/email/discovery/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::otp_email_discovery::AuthenticateRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.otps.email.discovery.authenticate(\n AuthenticateRequest{\n\ \ email_address: \"${email}\",\n code: \"${exampleCode}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/otps/email/discovery/authenticate\ncurl --request\ \ POST \\\n --url https://test.stytch.com/v1/b2b/otps/email/discovery/authenticate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email_address\": \"${email}\",\n \"code\": \"${exampleCode}\"\ \n }'" /v1/passwords: post: summary: Create operationId: api_password_v1_Create tags: - Password description: 'Create a new user with a password. If `session_duration_minutes` is specified, a new session will be started as well. If a user with this email already exists in your Stytch project, this endpoint will return a `duplicate_email` error. To add a password to an existing passwordless user, you''ll need to either call the [Migrate password endpoint](https://stytch.com/docs/api/password-migrate) or prompt the user to complete one of our password reset flows. This endpoint will return an error if the password provided does not meet our strength requirements, which you can check beforehand via the [Password strength check endpoint](https://stytch.com/docs/api/password-strength-check). When creating new Passwords users, it''s good practice to enforce an email verification flow. We''d recommend checking out our [Email verification guide](https://stytch.com/docs/guides/passwords/email-verification/overview) for more information.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_password_v1_CreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_password_v1_CreateResponse' '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: "// POST /v1/passwords\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n password:\ \ \"${examplePassword}\",\n session_duration_minutes: 60,\n};\n\nclient.Passwords.Create(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/passwords\npackage main\n\nimport (\n\t\"context\"\n\t\ \"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/passwords\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &passwords.CreateParams{\n\t\t\ Email: \"${email}\",\n\t\tPassword: \"${examplePassword}\"\ ,\n\t\tSessionDurationMinutes: 60,\n\t}\n\n\tresp, err := client.Passwords.Create(context.Background(),\ \ params)\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: "// POST /v1/passwords\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.passwords.CreateRequest;\nimport\ \ com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n public\ \ static void main(String[] args) {\n StytchClient.configure(\"${projectId}\"\ , \"${secret}\");\n\n CreateRequest params = new CreateRequest();\n\ \ params.setEmail(\"${email}\");\n params.setPassword(\"${examplePassword}\"\ );\n params.setSessionDurationMinutes(60);\n\n Object result\ \ = StytchClient.getPasswords().create(params);\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: "// POST /v1/passwords\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.passwords.CreateRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.passwords.create(\n CreateRequest(\n\ \ email = \"${email}\",\n password\ \ = \"${examplePassword}\",\n sessionDurationMinutes\ \ = 60,\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: "// POST /v1/passwords\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n password:\ \ \"${examplePassword}\",\n session_duration_minutes: 60,\n};\n\nclient.passwords.create(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->passwords->create([\n 'email' => '${email}',\n\ \ 'password' => '${examplePassword}',\n 'session_duration_minutes'\ \ => 60,\n]);" - lang: python label: Python source: "# POST /v1/passwords\nfrom stytch import Client\n\nclient = Client(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.passwords.create(\n email=\"${email}\",\n password=\"${examplePassword}\"\ ,\n session_duration_minutes=60,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/passwords\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.passwords.create(\n\ \ email: \"${email}\",\n password: \"${examplePassword}\",\n session_duration_minutes:\ \ 60\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/passwords\nuse stytch::consumer::client::Client;\nuse\ \ stytch::consumer::passwords::CreateRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.passwords.create(\n CreateRequest{\n email:\ \ \"${email}\",\n password: \"${examplePassword}\",\n \ \ session_duration_minutes: 60,\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/passwords\ncurl --request POST \\\n --url https://test.stytch.com/v1/passwords\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email\": \"${email}\",\n \"password\": \"${examplePassword}\"\ ,\n \"session_duration_minutes\": 60\n }'" /v1/passwords/authenticate: post: summary: Authenticate operationId: api_password_v1_Authenticate tags: - Password description: "Authenticate a user with their email address and password. This\ \ endpoint verifies that the user has a password currently set, and that the\ \ entered password is correct. There are two instances where the endpoint\ \ will return a `reset_password` error even if they enter their previous password:\n\ \n**One:** The user's credentials appeared in the HaveIBeenPwned dataset.\ \ We force a password reset to ensure that the user is the legitimate owner\ \ of the email address, and not a malicious actor abusing the compromised\ \ credentials.\n\n**Two:** A user that has previously authenticated with email/password\ \ uses a passwordless authentication method tied to the same email address\ \ (e.g. Magic Links, Google OAuth) for the first time. Any subsequent email/password\ \ authentication attempt will result in this error. We force a password reset\ \ in this instance in order to safely deduplicate the account by email address,\ \ without introducing the risk of a pre-hijack account takeover attack. \n\ \nImagine a bad actor creates many accounts using passwords and the known\ \ email addresses of their victims. If a victim comes to the site and logs\ \ in for the first time with an email-based passwordless authentication method\ \ then both the victim and the bad actor have credentials to access to the\ \ same account. To prevent this, any further email/password login attempts\ \ first require a password reset which can only be accomplished by someone\ \ with access to the underlying email address." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_password_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_password_v1_AuthenticateResponse' '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: "// POST /v1/passwords/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n password:\ \ \"${examplePassword}\",\n session_duration_minutes: 60,\n};\n\nclient.Passwords.Authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/passwords/authenticate\npackage main\n\nimport (\n\t\"\ context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/passwords\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &passwords.AuthenticateParams{\n\ \t\tEmail: \"${email}\",\n\t\tPassword: \"\ ${examplePassword}\",\n\t\tSessionDurationMinutes: 60,\n\t}\n\n\tresp, err\ \ := client.Passwords.Authenticate(context.Background(), params)\n\tif err\ \ != nil {\n\t\tlog.Fatalf(\"error in method call: %v\", err)\n\t}\n\n\t\ log.Println(resp)\n}\n" - lang: java label: Java source: "// POST /v1/passwords/authenticate\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.passwords.AuthenticateRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthenticateRequest params =\ \ new AuthenticateRequest();\n params.setEmail(\"${email}\");\n \ \ params.setPassword(\"${examplePassword}\");\n params.setSessionDurationMinutes(60);\n\ \n Object result = StytchClient.getPasswords().authenticate(params);\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: "// POST /v1/passwords/authenticate\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.passwords.AuthenticateRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.passwords.authenticate(\n AuthenticateRequest(\n\ \ email = \"${email}\",\n password\ \ = \"${examplePassword}\",\n sessionDurationMinutes\ \ = 60,\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: "// POST /v1/passwords/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n password:\ \ \"${examplePassword}\",\n session_duration_minutes: 60,\n};\n\nclient.passwords.authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->passwords->authenticate([\n 'email' => '${email}',\n\ \ 'password' => '${examplePassword}',\n 'session_duration_minutes'\ \ => 60,\n]);" - lang: python label: Python source: "# POST /v1/passwords/authenticate\nfrom stytch import Client\n\n\ client = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.passwords.authenticate(\n email=\"${email}\",\n\ \ password=\"${examplePassword}\",\n session_duration_minutes=60,\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/passwords/authenticate\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.passwords.authenticate(\n\ \ email: \"${email}\",\n password: \"${examplePassword}\",\n session_duration_minutes:\ \ 60\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/passwords/authenticate\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::passwords::AuthenticateRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.passwords.authenticate(\n AuthenticateRequest{\n\ \ email: \"${email}\",\n password: \"${examplePassword}\"\ ,\n session_duration_minutes: 60,\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/passwords/authenticate\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/passwords/authenticate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"email\":\ \ \"${email}\",\n \"password\": \"${examplePassword}\",\n \"session_duration_minutes\"\ : 60\n }'" /v1/passwords/strength_check: post: summary: Strengthcheck operationId: api_password_v1_StrengthCheck tags: - Password description: "This API allows you to check whether or not the user\u2019s provided\ \ password is valid, and to provide feedback to the user on how to increase\ \ the strength of their password.\n\nThis endpoint adapts to your Project's\ \ password strength configuration. If you're using [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy),\ \ the default, your passwords are considered valid if the strength score is\ \ >= 3. If you're using [LUDS](https://stytch.com/docs/guides/passwords/strength-policy),\ \ your passwords are considered valid if they meet the requirements that you've\ \ set with Stytch. You may update your password strength configuration in\ \ the [Stytch Dashboard](https://stytch.com/dashboard/password-strength-config).\n\ \n\n### Password feedback\n\nThe `feedback` object contains relevant fields\ \ for you to relay feedback to users that failed to create a strong enough\ \ password.\n\nIf you're using zxcvbn, the `feedback` object will contain\ \ `warning` and `suggestions` for any password that does not meet the zxcvbn\ \ strength requirements. You can return these strings directly to the user\ \ to help them craft a strong password.\n\nIf you're using LUDS, the `feedback`\ \ object will contain an object named `luds_requirements` which contain a\ \ collection of fields that the user failed or passed. You'll want to prompt\ \ the user to create a password that meets all of the requirements that they\ \ failed." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_password_v1_StrengthCheckRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_password_v1_StrengthCheckResponse' '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: "// POST /v1/passwords/strength_check\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n password: \"${examplePassword}\"\ ,\n};\n\nclient.Passwords.StrengthCheck(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/passwords/strength_check\npackage main\n\nimport (\n\t\ \"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/passwords\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &passwords.StrengthCheckParams{\n\ \t\tPassword: \"${examplePassword}\",\n\t}\n\n\tresp, err := client.Passwords.StrengthCheck(context.Background(),\ \ params)\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: "// POST /v1/passwords/strength_check\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.passwords.StrengthCheckRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n StrengthCheckRequest params =\ \ new StrengthCheckRequest();\n params.setPassword(\"${examplePassword}\"\ );\n\n Object result = StytchClient.getPasswords().strengthCheck(params);\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: "// POST /v1/passwords/strength_check\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.passwords.StrengthCheckRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.passwords.strengthCheck(\n \ \ StrengthCheckRequest(\n password = \"${examplePassword}\"\ ,\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: "// POST /v1/passwords/strength_check\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n password: \"${examplePassword}\"\ ,\n};\n\nclient.passwords.strengthCheck(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->passwords->strength_check([\n 'password'\ \ => '${examplePassword}',\n]);" - lang: python label: Python source: "# POST /v1/passwords/strength_check\nfrom stytch import Client\n\n\ client = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.passwords.strength_check(\n password=\"${examplePassword}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/passwords/strength_check\nrequire 'stytch'\n\nclient =\ \ Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.passwords.strength_check(\n password: \"${examplePassword}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/passwords/strength_check\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::passwords::StrengthCheckRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.passwords.strength_check(\n StrengthCheckRequest{\n\ \ password: \"${examplePassword}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/passwords/strength_check\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/passwords/strength_check \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"password\"\ : \"${examplePassword}\"\n }'" /v1/passwords/migrate: post: summary: Migrate operationId: api_password_v1_Migrate tags: - Password description: Adds an existing password to a User's email that doesn't have a password yet. We support migrating users from passwords stored with `bcrypt`, `scrypt`, `argon2`, `MD-5`, `SHA-1`, `SHA-512`, or `PBKDF2`. This endpoint has a rate limit of 100 requests per second. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_password_v1_MigrateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_password_v1_MigrateResponse' '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: "// POST /v1/passwords/migrate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n hash:\ \ \"${examplePasswordBcryptHash}\",\n hash_type: \"bcrypt\",\n phone_number:\ \ \"${examplePhoneNumber}\",\n external_id: \"my-new-external-id\",\n};\n\ \nclient.Passwords.Migrate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/passwords/migrate\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/passwords\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &passwords.MigrateParams{\n\t\t\ Email: \"${email}\",\n\t\tHash: \"${examplePasswordBcryptHash}\"\ ,\n\t\tHashType: passwords.MigrateRequestHashTypeBcrypt,\n\t\tPhoneNumber:\ \ \"${examplePhoneNumber}\",\n\t\tExternalID: \"my-new-external-id\",\n\ \t}\n\n\tresp, err := client.Passwords.Migrate(context.Background(), params)\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: "// POST /v1/passwords/migrate\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.passwords.MigrateRequest;\nimport\ \ com.stytch.java.consumer.models.passwords.MigrateRequestHashType;\nimport\ \ com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n public\ \ static void main(String[] args) {\n StytchClient.configure(\"${projectId}\"\ , \"${secret}\");\n\n MigrateRequest params = new MigrateRequest();\n\ \ params.setEmail(\"${email}\");\n params.setHash(\"${examplePasswordBcryptHash}\"\ );\n params.setHashType(MigrateRequestHashType.BCRYPT);\n \ \ params.setPhoneNumber(\"${examplePhoneNumber}\");\n params.setExternalId(\"\ my-new-external-id\");\n\n Object result = StytchClient.getPasswords().migrate(params);\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: "// POST /v1/passwords/migrate\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.passwords.MigrateRequest\nimport\ \ com.stytch.java.consumer.models.passwords.MigrateRequestHashType\n\nfun\ \ main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.passwords.migrate(\n MigrateRequest(\n\ \ email = \"${email}\",\n hash = \"\ ${examplePasswordBcryptHash}\",\n hashType = MigrateRequestHashType.BCRYPT,\n\ \ phoneNumber = \"${examplePhoneNumber}\",\n \ \ externalId = \"my-new-external-id\",\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: "// POST /v1/passwords/migrate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n hash:\ \ \"${examplePasswordBcryptHash}\",\n hash_type: \"bcrypt\",\n phone_number:\ \ \"${examplePhoneNumber}\",\n external_id: \"my-new-external-id\",\n};\n\ \nclient.passwords.migrate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->passwords->migrate([\n 'email' => '${email}',\n\ \ 'hash' => '${examplePasswordBcryptHash}',\n 'hash_type' => 'bcrypt',\n\ \ 'phone_number' => '${examplePhoneNumber}',\n 'external_id' => 'my-new-external-id',\n\ ]);" - lang: python label: Python source: "# POST /v1/passwords/migrate\nfrom stytch import Client\nfrom stytch.consumer.models.passwords\ \ import MigrateRequestHashType\n\nclient = Client(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.passwords.migrate(\n \ \ email=\"${email}\",\n hash=\"${examplePasswordBcryptHash}\",\n \ \ hash_type=MigrateRequestHashType.BCRYPT,\n phone_number=\"${examplePhoneNumber}\"\ ,\n external_id=\"my-new-external-id\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/passwords/migrate\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.passwords.migrate(\n\ \ email: \"${email}\",\n hash: \"${examplePasswordBcryptHash}\",\n hash_type:\ \ \"bcrypt\",\n phone_number: \"${examplePhoneNumber}\",\n external_id:\ \ \"my-new-external-id\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/passwords/migrate\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::passwords::MigrateRequest;\nuse stytch::consumer::passwords::MigrateRequestHashType;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.passwords.migrate(\n MigrateRequest{\n\ \ email: \"${email}\",\n hash: \"${examplePasswordBcryptHash}\"\ ,\n hash_type: MigrateRequestHashType::BCRYPT,\n phone_number:\ \ Some(String::from(\"${examplePhoneNumber}\")),\n external_id:\ \ Some(String::from(\"my-new-external-id\")),\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/passwords/migrate\ncurl --request POST \\\n --url https://test.stytch.com/v1/passwords/migrate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email\": \"${email}\",\n \"hash\": \"${examplePasswordBcryptHash}\"\ ,\n \"hash_type\": \"bcrypt\",\n \"phone_number\": \"${examplePhoneNumber}\"\ ,\n \"external_id\": \"my-new-external-id\"\n }'" /v1/passwords/email/reset/start: post: summary: Resetstart operationId: api_password_v1_passwords_email_ResetStart tags: - Passwords description: Initiates a password reset for the email address provided. This will trigger an email to be sent to the address, containing a magic link that will allow them to set a new password and authenticate. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_password_v1_passwords_email_ResetStartRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_password_v1_passwords_email_ResetStartResponse' '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: "// POST /v1/passwords/email/reset/start\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.Passwords.Email.ResetStart(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/passwords/email/reset/start\npackage main\n\nimport (\n\ \t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/passwords/email\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &email.ResetStartParams{\n\t\t\ Email: \"${email}\",\n\t}\n\n\tresp, err := client.Passwords.Email.ResetStart(context.Background(),\ \ params)\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: "// POST /v1/passwords/email/reset/start\npackage com.example;\n\n\ import com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.passwordsemail.ResetStartRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ResetStartRequest params = new\ \ ResetStartRequest();\n params.setEmail(\"${email}\");\n\n \ \ Object result = StytchClient.getPasswords().getEmail().resetStart(params);\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: "// POST /v1/passwords/email/reset/start\npackage com.example\n\n\ import com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.passwordsemail.ResetStartRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.passwords.email.resetStart(\n \ \ ResetStartRequest(\n email = \"${email}\",\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: "// POST /v1/passwords/email/reset/start\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.passwords.email.resetStart(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->passwords->email->reset_start([\n 'email'\ \ => '${email}',\n]);" - lang: python label: Python source: "# POST /v1/passwords/email/reset/start\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.passwords.email.reset_start(\n email=\"${email}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/passwords/email/reset/start\nrequire 'stytch'\n\nclient\ \ = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.passwords.email.reset_start(\n email: \"${email}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/passwords/email/reset/start\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::passwords_email::ResetStartRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.passwords.email.reset_start(\n ResetStartRequest{\n\ \ email: \"${email}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/passwords/email/reset/start\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/passwords/email/reset/start \\\n -u\ \ '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n\ \ -d '{\n \"email\": \"${email}\"\n }'" /v1/passwords/email/reset: post: summary: Reset operationId: api_password_v1_passwords_email_Reset tags: - Passwords description: "Reset the user's password and authenticate them. This endpoint\ \ checks that the magic link `token` is valid, hasn't expired, or already\ \ been used \u2013 and can optionally require additional security settings,\ \ such as the IP address and user agent matching the initial reset request.\n\ \nThe provided password needs to meet our password strength requirements,\ \ which can be checked in advance with the password strength endpoint. If\ \ the token and password are accepted, the password is securely stored for\ \ future authentication and the user is authenticated.\n\nNote that a successful\ \ password reset by email will revoke all active sessions for the `user_id`." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_password_v1_passwords_email_ResetRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_password_v1_passwords_email_ResetResponse' '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: "// POST /v1/passwords/email/reset\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n token: \"${token}\",\n password:\ \ \"${examplePassword}\",\n session_duration_minutes: 60,\n};\n\nclient.Passwords.Email.Reset(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/passwords/email/reset\npackage main\n\nimport (\n\t\"\ context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/passwords/email\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &email.ResetParams{\n\t\tToken:\ \ \"${token}\",\n\t\tPassword: \"${examplePassword}\"\ ,\n\t\tSessionDurationMinutes: 60,\n\t}\n\n\tresp, err := client.Passwords.Email.Reset(context.Background(),\ \ params)\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: "// POST /v1/passwords/email/reset\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.passwordsemail.ResetRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ResetRequest params = new ResetRequest();\n\ \ params.setToken(\"${token}\");\n params.setPassword(\"${examplePassword}\"\ );\n params.setSessionDurationMinutes(60);\n\n Object result\ \ = StytchClient.getPasswords().getEmail().reset(params);\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: "// POST /v1/passwords/email/reset\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.passwordsemail.ResetRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.passwords.email.reset(\n ResetRequest(\n\ \ token = \"${token}\",\n password\ \ = \"${examplePassword}\",\n sessionDurationMinutes\ \ = 60,\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: "// POST /v1/passwords/email/reset\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n token: \"${token}\",\n password:\ \ \"${examplePassword}\",\n session_duration_minutes: 60,\n};\n\nclient.passwords.email.reset(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->passwords->email->reset([\n 'token' => '${token}',\n\ \ 'password' => '${examplePassword}',\n 'session_duration_minutes'\ \ => 60,\n]);" - lang: python label: Python source: "# POST /v1/passwords/email/reset\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.passwords.email.reset(\n token=\"${token}\",\n\ \ password=\"${examplePassword}\",\n session_duration_minutes=60,\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/passwords/email/reset\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.passwords.email.reset(\n\ \ token: \"${token}\",\n password: \"${examplePassword}\",\n session_duration_minutes:\ \ 60\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/passwords/email/reset\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::passwords_email::ResetRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.passwords.email.reset(\n ResetRequest{\n \ \ token: \"${token}\",\n password: \"${examplePassword}\"\ ,\n session_duration_minutes: 60,\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/passwords/email/reset\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/passwords/email/reset \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"token\":\ \ \"${token}\",\n \"password\": \"${examplePassword}\",\n \"session_duration_minutes\"\ : 60\n }'" /v1/passwords/existing_password/reset: post: summary: Reset operationId: api_password_v1_passwords_existing_password_Reset tags: - Passwords description: 'Reset the User''s password using their existing password. Note that a successful password reset via an existing password will revoke all active sessions for the `user_id`.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_password_v1_passwords_existing_password_ResetRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_password_v1_passwords_existing_password_ResetResponse' '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: "// POST /v1/passwords/existing_password/reset\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n existing_password:\ \ \"old_password\",\n new_password: \"${examplePassword}\",\n session_duration_minutes:\ \ 60,\n};\n\nclient.Passwords.ExistingPassword.Reset(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/passwords/existing_password/reset\npackage main\n\nimport\ \ (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/passwords/existingpassword\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &existingpassword.ResetParams{\n\ \t\tEmail: \"${email}\",\n\t\tExistingPassword: \"\ old_password\",\n\t\tNewPassword: \"${examplePassword}\",\n\t\ \tSessionDurationMinutes: 60,\n\t}\n\n\tresp, err := client.Passwords.ExistingPassword.Reset(context.Background(),\ \ params)\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: "// POST /v1/passwords/existing_password/reset\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.passwordsexistingpassword.ResetRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ResetRequest params = new ResetRequest();\n\ \ params.setEmail(\"${email}\");\n params.setExistingPassword(\"\ old_password\");\n params.setNewPassword(\"${examplePassword}\");\n\ \ params.setSessionDurationMinutes(60);\n\n Object result\ \ = StytchClient.getPasswords().getExistingPassword().reset(params);\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: "// POST /v1/passwords/existing_password/reset\npackage com.example\n\ \nimport com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.passwordsexistingpassword.ResetRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.passwords.existingPassword.reset(\n \ \ ResetRequest(\n email = \"${email}\",\n \ \ existingPassword = \"old_password\",\n \ \ newPassword = \"${examplePassword}\",\n sessionDurationMinutes\ \ = 60,\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: "// POST /v1/passwords/existing_password/reset\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n existing_password:\ \ \"old_password\",\n new_password: \"${examplePassword}\",\n session_duration_minutes:\ \ 60,\n};\n\nclient.passwords.existingPassword.reset(params)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->passwords->existing_password->reset([\n 'email'\ \ => '${email}',\n 'existing_password' => 'old_password',\n 'new_password'\ \ => '${examplePassword}',\n 'session_duration_minutes' => 60,\n]);" - lang: python label: Python source: "# POST /v1/passwords/existing_password/reset\nfrom stytch import\ \ Client\n\nclient = Client(\n project_id=\"${projectId}\",\n secret=\"\ ${secret}\",\n)\n\nresp = client.passwords.existing_password.reset(\n \ \ email=\"${email}\",\n existing_password=\"old_password\",\n new_password=\"\ ${examplePassword}\",\n session_duration_minutes=60,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/passwords/existing_password/reset\nrequire 'stytch'\n\n\ client = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.passwords.existing_password.reset(\n\ \ email: \"${email}\",\n existing_password: \"old_password\",\n new_password:\ \ \"${examplePassword}\",\n session_duration_minutes: 60\n \n)\n\nputs\ \ resp" - lang: rust label: Rust source: "// POST /v1/passwords/existing_password/reset\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::passwords_existing_password::ResetRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.passwords.existing_password.reset(\n ResetRequest{\n\ \ email: \"${email}\",\n existing_password: \"old_password\"\ ,\n new_password: \"${examplePassword}\",\n session_duration_minutes:\ \ 60,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/passwords/existing_password/reset\ncurl --request POST\ \ \\\n --url https://test.stytch.com/v1/passwords/existing_password/reset\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email\": \"${email}\",\n \"existing_password\":\ \ \"old_password\",\n \"new_password\": \"${examplePassword}\",\n \ \ \"session_duration_minutes\": 60\n }'" /v1/passwords/session/reset: post: summary: Reset operationId: api_password_v1_passwords_session_Reset tags: - Passwords description: "Reset the user\u2019s password using their existing session. The\ \ endpoint will error if the session does not have a password, email magic\ \ link, or email OTP authentication factor that has been issued within the\ \ last 5 minutes. This endpoint requires either a `session_jwt` or `session_token`\ \ be included in the request.\n\nNote that a successful password reset via\ \ an existing session will revoke all active sessions for the `user_id`, except\ \ for the one used during the reset flow." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_password_v1_passwords_session_ResetRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_password_v1_passwords_session_ResetResponse' '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: "// POST /v1/passwords/session/reset\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n password: \"${examplePassword}\"\ ,\n session_token: \"${sessionToken}\",\n session_duration_minutes: 60,\n\ };\n\nclient.Passwords.Sessions.Reset(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/passwords/session/reset\npackage main\n\nimport (\n\t\ \"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/passwords/session\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &session.ResetParams{\n\t\tPassword:\ \ \"${examplePassword}\",\n\t\tSessionToken: \"\ ${sessionToken}\",\n\t\tSessionDurationMinutes: 60,\n\t}\n\n\tresp, err\ \ := client.Passwords.Sessions.Reset(context.Background(), params)\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: "// POST /v1/passwords/session/reset\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.passwordssession.ResetRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ResetRequest params = new ResetRequest();\n\ \ params.setPassword(\"${examplePassword}\");\n params.setSessionToken(\"\ ${sessionToken}\");\n params.setSessionDurationMinutes(60);\n\n \ \ Object result = StytchClient.getPasswords().getSessions().reset(params);\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: "// POST /v1/passwords/session/reset\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.passwordssession.ResetRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.passwords.sessions.reset(\n \ \ ResetRequest(\n password = \"${examplePassword}\"\ ,\n sessionToken = \"${sessionToken}\",\n \ \ sessionDurationMinutes = 60,\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: "// POST /v1/passwords/session/reset\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n password: \"${examplePassword}\"\ ,\n session_token: \"${sessionToken}\",\n session_duration_minutes: 60,\n\ };\n\nclient.passwords.sessions.reset(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->passwords->sessions->reset([\n 'password'\ \ => '${examplePassword}',\n 'session_token' => '${sessionToken}',\n\ \ 'session_duration_minutes' => 60,\n]);" - lang: python label: Python source: "# POST /v1/passwords/session/reset\nfrom stytch import Client\n\n\ client = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.passwords.sessions.reset(\n password=\"${examplePassword}\"\ ,\n session_token=\"${sessionToken}\",\n session_duration_minutes=60,\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/passwords/session/reset\nrequire 'stytch'\n\nclient =\ \ Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.passwords.sessions.reset(\n password: \"${examplePassword}\"\ ,\n session_token: \"${sessionToken}\",\n session_duration_minutes: 60\n\ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/passwords/session/reset\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::passwords_session::ResetRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.passwords.sessions.reset(\n ResetRequest{\n\ \ password: \"${examplePassword}\",\n session_token:\ \ Some(String::from(\"${sessionToken}\")),\n session_duration_minutes:\ \ 60,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/passwords/session/reset\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/passwords/session/reset \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"password\"\ : \"${examplePassword}\",\n \"session_token\": \"${sessionToken}\",\n\ \ \"session_duration_minutes\": 60\n }'" /v1/b2b/passwords/strength_check: post: summary: Strengthcheck operationId: api_b2b_password_v1_StrengthCheck tags: - Password description: "This API allows you to check whether the user\u2019s provided\ \ password is valid, and to provide feedback to the user on how to increase\ \ the strength of their password.\n\nThis endpoint adapts to your Project's\ \ password strength configuration.\nIf you're using [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy),\ \ the default, your passwords are considered valid if the strength score is\ \ >= 3.\nIf you're using [LUDS](https://stytch.com/docs/guides/passwords/strength-policy),\ \ your passwords are considered valid if they meet the requirements that you've\ \ set with Stytch.\nYou may update your password strength configuration on\ \ the [Passwords Policy page](https://stytch.com/dashboard/password-strength-config)\ \ in the Stytch Dashboard.\n\n## Password feedback\nThe `zxcvbn_feedback`\ \ and `luds_feedback` objects contains relevant fields for you to relay feedback\ \ to users that failed to create a strong enough password.\n\nIf you're using\ \ [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy), the\ \ feedback object will contain warning and suggestions for any password that\ \ does not meet the [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy)\ \ strength requirements. You can return these strings directly to the user\ \ to help them craft a strong password.\n\nIf you're using [LUDS](https://stytch.com/docs/guides/passwords/strength-policy),\ \ the feedback object will contain a collection of fields that the user failed\ \ or passed. You'll want to prompt the user to create a password that meets\ \ all requirements that they failed." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_StrengthCheckRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_StrengthCheckResponse' '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: "// POST /v1/b2b/passwords/strength_check\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n password: \"${examplePassword}\"\ ,\n};\n\nclient.Passwords.StrengthCheck(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/passwords/strength_check\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/passwords\"\n)\n\n\ func 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 := &passwords.StrengthCheckParams{\n\ \t\tPassword: \"${examplePassword}\",\n\t}\n\n\tresp, err := client.Passwords.StrengthCheck(context.Background(),\ \ params)\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: "// POST /v1/b2b/passwords/strength_check\npackage com.example;\n\n\ import com.stytch.java.b2b.models.passwords.StrengthCheckRequest;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ StrengthCheckRequest params = new StrengthCheckRequest();\n \ \ params.setPassword(\"${examplePassword}\");\n\n Object result\ \ = StytchB2BClient.getPasswords().strengthCheck(params);\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: "// POST /v1/b2b/passwords/strength_check\npackage com.example\n\n\ import com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.passwords.StrengthCheckRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.passwords.strengthCheck(\n \ \ StrengthCheckRequest(\n password = \"${examplePassword}\"\ ,\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: "// POST /v1/b2b/passwords/strength_check\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n password: \"${examplePassword}\"\ ,\n};\n\nclient.passwords.strengthCheck(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->passwords->strength_check([\n 'password'\ \ => '${examplePassword}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/passwords/strength_check\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.passwords.strength_check(\n password=\"${examplePassword}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/passwords/strength_check\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.passwords.strength_check(\n password: \"\ ${examplePassword}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/passwords/strength_check\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::passwords::StrengthCheckRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.passwords.strength_check(\n StrengthCheckRequest{\n\ \ password: \"${examplePassword}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/passwords/strength_check\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/b2b/passwords/strength_check \\\n -u\ \ '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n\ \ -d '{\n \"password\": \"${examplePassword}\"\n }'" /v1/b2b/passwords/migrate: post: summary: Migrate operationId: api_b2b_password_v1_Migrate tags: - Password description: "\n**Warning:** This endpoint marks the Member's email address\ \ as verified. Do **not** use this endpoint unless the user has already verified\ \ their email address in your application. \n\nAdds an existing password to\ \ a Member's email that doesn't have a password yet.\n\nWe support migrating\ \ members from passwords stored with bcrypt, scrypt, argon2, MD-5, SHA-1,\ \ SHA-512, and PBKDF2. This endpoint has a rate limit of 100 requests per\ \ second.\n\nThe Member's email will be marked as verified when you use this\ \ endpoint.\n\nIf you are using **cross-organization passwords**, i.e. allowing\ \ an end user to share the same password across all of their Organizations,\ \ call this method separately for each `organization_id` associated with the\ \ given `email_address` to ensure the password is set across all of their\ \ Organizations." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_MigrateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_MigrateResponse' '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: "// POST /v1/b2b/passwords/migrate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n email_address: \"${email}\"\ ,\n hash: \"${examplePasswordBcryptHash}\",\n hash_type: \"bcrypt\",\n\ \ organization_id: \"${organizationId}\",\n external_id: \"my-new-external-id\"\ ,\n};\n\nclient.Passwords.Migrate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/passwords/migrate\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/passwords\"\n)\n\n\ func 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 := &passwords.MigrateParams{\n\t\t\ EmailAddress: \"${email}\",\n\t\tHash: \"${examplePasswordBcryptHash}\"\ ,\n\t\tHashType: passwords.MigrateRequestHashTypeBcrypt,\n\t\tOrganizationID:\ \ \"${organizationId}\",\n\t\tExternalID: \"my-new-external-id\",\n\t\ }\n\n\tresp, err := client.Passwords.Migrate(context.Background(), params)\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: "// POST /v1/b2b/passwords/migrate\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.models.passwords.MigrateRequest;\nimport com.stytch.java.b2b.models.passwords.MigrateRequestHashType;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ MigrateRequest params = new MigrateRequest();\n params.setEmailAddress(\"\ ${email}\");\n params.setHash(\"${examplePasswordBcryptHash}\");\n\ \ params.setHashType(MigrateRequestHashType.BCRYPT);\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setExternalId(\"my-new-external-id\"\ );\n\n Object result = StytchB2BClient.getPasswords().migrate(params);\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: "// POST /v1/b2b/passwords/migrate\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.passwords.MigrateRequest\n\ import com.stytch.java.b2b.models.passwords.MigrateRequestHashType\n\nfun\ \ main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.passwords.migrate(\n MigrateRequest(\n\ \ emailAddress = \"${email}\",\n hash\ \ = \"${examplePasswordBcryptHash}\",\n hashType = MigrateRequestHashType.BCRYPT,\n\ \ organizationId = \"${organizationId}\",\n \ \ externalId = \"my-new-external-id\",\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: "// POST /v1/b2b/passwords/migrate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n email_address: \"${email}\"\ ,\n hash: \"${examplePasswordBcryptHash}\",\n hash_type: \"bcrypt\",\n\ \ organization_id: \"${organizationId}\",\n external_id: \"my-new-external-id\"\ ,\n};\n\nclient.passwords.migrate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->passwords->migrate([\n 'email_address' =>\ \ '${email}',\n 'hash' => '${examplePasswordBcryptHash}',\n 'hash_type'\ \ => 'bcrypt',\n 'organization_id' => '${organizationId}',\n 'external_id'\ \ => 'my-new-external-id',\n]);" - lang: python label: Python source: "# POST /v1/b2b/passwords/migrate\nfrom stytch import B2BClient\n\ from stytch.b2b.models.passwords import MigrateRequestHashType\n\nclient\ \ = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.passwords.migrate(\n email_address=\"${email}\"\ ,\n hash=\"${examplePasswordBcryptHash}\",\n hash_type=MigrateRequestHashType.BCRYPT,\n\ \ organization_id=\"${organizationId}\",\n external_id=\"my-new-external-id\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/passwords/migrate\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.passwords.migrate(\n\ \ email_address: \"${email}\",\n hash: \"${examplePasswordBcryptHash}\"\ ,\n hash_type: \"bcrypt\",\n organization_id: \"${organizationId}\",\n\ \ external_id: \"my-new-external-id\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/passwords/migrate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::passwords::MigrateRequest;\nuse stytch::b2b::passwords::MigrateRequestHashType;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.passwords.migrate(\n MigrateRequest{\n\ \ email_address: \"${email}\",\n hash: \"${examplePasswordBcryptHash}\"\ ,\n hash_type: MigrateRequestHashType::BCRYPT,\n organization_id:\ \ \"${organizationId}\",\n external_id: Some(String::from(\"\ my-new-external-id\")),\n ..Default::default()\n }\n \ \ ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/passwords/migrate\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/b2b/passwords/migrate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"email_address\"\ : \"${email}\",\n \"hash\": \"${examplePasswordBcryptHash}\",\n \"\ hash_type\": \"bcrypt\",\n \"organization_id\": \"${organizationId}\"\ ,\n \"external_id\": \"my-new-external-id\"\n }'" /v1/b2b/passwords/authenticate: post: summary: Authenticate operationId: api_b2b_password_v1_Authenticate tags: - Password description: 'Authenticate a member with their email address and password. This endpoint verifies that the member has a password currently set, and that the entered password is correct. If you have breach detection during authentication enabled in your [password strength policy](https://stytch.com/docs/b2b/guides/passwords/strength-policy) and the member''s credentials have appeared in the HaveIBeenPwned dataset, this endpoint will return a `member_reset_password` error even if the member enters a correct password. We force a password reset in this case to ensure that the member is the legitimate owner of the email address and not a malicious actor abusing the compromised credentials. If the Member is required to complete MFA to log in to the Organization, the returned value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. The `intermediate_session_token` can be passed into the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA step and acquire a full member session. The `session_duration_minutes` and `session_custom_claims` parameters will be ignored. If a valid `session_token` or `session_jwt` is passed in, the Member will not be required to complete an MFA step.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_AuthenticateResponse' '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: "// POST /v1/b2b/passwords/authenticate\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 email_address: \"${email}\",\n password: \"${examplePassword}\"\ ,\n};\n\nclient.Passwords.Authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/passwords/authenticate\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/passwords\"\n)\n\n\ func 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 := &passwords.AuthenticateParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tEmailAddress: \"${email}\"\ ,\n\t\tPassword: \"${examplePassword}\",\n\t}\n\n\tresp, err := client.Passwords.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/b2b/passwords/authenticate\npackage com.example;\n\n\ import com.stytch.java.b2b.models.passwords.AuthenticateRequest;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ AuthenticateRequest params = new AuthenticateRequest();\n \ \ params.setOrganizationId(\"${organizationId}\");\n params.setEmailAddress(\"\ ${email}\");\n params.setPassword(\"${examplePassword}\");\n\n \ \ Object result = StytchB2BClient.getPasswords().authenticate(params);\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: "// POST /v1/b2b/passwords/authenticate\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.passwords.AuthenticateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.passwords.authenticate(\n \ \ AuthenticateRequest(\n organizationId = \"${organizationId}\"\ ,\n emailAddress = \"${email}\",\n \ \ password = \"${examplePassword}\",\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: "// POST /v1/b2b/passwords/authenticate\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 email_address: \"${email}\",\n password: \"${examplePassword}\"\ ,\n};\n\nclient.passwords.authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->passwords->authenticate([\n 'organization_id'\ \ => '${organizationId}',\n 'email_address' => '${email}',\n 'password'\ \ => '${examplePassword}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/passwords/authenticate\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.passwords.authenticate(\n organization_id=\"${organizationId}\"\ ,\n email_address=\"${email}\",\n password=\"${examplePassword}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/passwords/authenticate\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.passwords.authenticate(\n organization_id:\ \ \"${organizationId}\",\n email_address: \"${email}\",\n password: \"\ ${examplePassword}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/passwords/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::passwords::AuthenticateRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.passwords.authenticate(\n AuthenticateRequest{\n\ \ organization_id: \"${organizationId}\",\n email_address:\ \ \"${email}\",\n password: \"${examplePassword}\",\n \ \ ..Default::default()\n }\n ).await;\n println!(\"The\ \ response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/passwords/authenticate\ncurl --request POST \\\n \ \ --url https://test.stytch.com/v1/b2b/passwords/authenticate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"organization_id\"\ : \"${organizationId}\",\n \"email_address\": \"${email}\",\n \"password\"\ : \"${examplePassword}\"\n }'" /v1/b2b/passwords/email/reset/start: post: summary: Resetstart operationId: api_b2b_password_v1_b2b_passwords_email_ResetStart tags: - B2B Passwords description: 'Initiates a password reset for the email address provided. This will trigger an email to be sent to the address, containing a magic link that will allow them to set a new password and authenticate. This endpoint adapts to your Project''s password strength configuration. If you''re using [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy), the default, your passwords are considered valid if the strength score is >= 3. If you''re using [LUDS](https://stytch.com/docs/guides/passwords/strength-policy), your passwords are considered valid if they meet the requirements that you''ve set with Stytch. You may update your password strength configuration on the [Passwords Policy page](https://stytch.com/dashboard/password-strength-config) in the Stytch Dashboard.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_email_ResetStartRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_email_ResetStartResponse' '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: "// POST /v1/b2b/passwords/email/reset/start\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 email_address: \"${email}\",\n};\n\nclient.Passwords.Email.ResetStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/passwords/email/reset/start\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/passwords/email\"\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 := &email.ResetStartParams{\n\t\t\ OrganizationID: \"${organizationId}\",\n\t\tEmailAddress: \"${email}\"\ ,\n\t}\n\n\tresp, err := client.Passwords.Email.ResetStart(context.Background(),\ \ params)\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: "// POST /v1/b2b/passwords/email/reset/start\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.passwordsemail.ResetStartRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ResetStartRequest params = new ResetStartRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setEmailAddress(\"${email}\");\n\n\ \ Object result = StytchB2BClient.getPasswords().getEmail().resetStart(params);\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: "// POST /v1/b2b/passwords/email/reset/start\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.passwordsemail.ResetStartRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.passwords.email.resetStart(\n \ \ ResetStartRequest(\n organizationId = \"${organizationId}\"\ ,\n emailAddress = \"${email}\",\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: "// POST /v1/b2b/passwords/email/reset/start\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 email_address: \"${email}\",\n};\n\nclient.passwords.email.resetStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->passwords->email->reset_start([\n 'organization_id'\ \ => '${organizationId}',\n 'email_address' => '${email}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/passwords/email/reset/start\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.passwords.email.reset_start(\n organization_id=\"\ ${organizationId}\",\n email_address=\"${email}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/passwords/email/reset/start\nrequire 'stytch'\n\n\ client = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.passwords.email.reset_start(\n organization_id:\ \ \"${organizationId}\",\n email_address: \"${email}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/passwords/email/reset/start\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::passwords_email::ResetStartRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.passwords.email.reset_start(\n ResetStartRequest{\n\ \ organization_id: \"${organizationId}\",\n email_address:\ \ \"${email}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/passwords/email/reset/start\ncurl --request POST \\\ \n --url https://test.stytch.com/v1/b2b/passwords/email/reset/start \\\n\ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"organization_id\": \"${organizationId}\",\n \"email_address\"\ : \"${email}\"\n }'" /v1/b2b/passwords/email/reset: post: summary: Reset operationId: api_b2b_password_v1_b2b_passwords_email_Reset tags: - B2B Passwords description: "Reset the Member's password and authenticate them. This endpoint\ \ checks that the password reset token is valid, hasn\u2019t expired, or already\ \ been used.\n\nThe provided password needs to meet our password strength\ \ requirements, which can be checked in advance with the password strength\ \ endpoint. If the token and password are accepted, the password is securely\ \ stored for future authentication and the user is authenticated.\n\nIf the\ \ Member is required to complete MFA to log in to the Organization, the returned\ \ value of `member_authenticated` will be `false`, and an `intermediate_session_token`\ \ will be returned.\nThe `intermediate_session_token` can be passed into the\ \ [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms)\ \ to complete the MFA step and acquire a full member session.\nThe `session_duration_minutes`\ \ and `session_custom_claims` parameters will be ignored.\n\nIf a valid `session_token`\ \ or `session_jwt` is passed in, the Member will not be required to complete\ \ an MFA step.\n\nNote that a successful password reset by email will revoke\ \ all active sessions for the `member_id`." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_email_ResetRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_email_ResetResponse' '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: "// POST /v1/b2b/passwords/email/reset\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n password_reset_token:\ \ \"${token}\",\n password: \"${examplePassword}\",\n};\n\nclient.Passwords.Email.Reset(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/passwords/email/reset\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/passwords/email\"\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 := &email.ResetParams{\n\t\tPasswordResetToken:\ \ \"${token}\",\n\t\tPassword: \"${examplePassword}\",\n\t}\n\n\ \tresp, err := client.Passwords.Email.Reset(context.Background(), params)\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: "// POST /v1/b2b/passwords/email/reset\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.models.passwordsemail.ResetRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ResetRequest params = new ResetRequest();\n\ \ params.setPasswordResetToken(\"${token}\");\n params.setPassword(\"\ ${examplePassword}\");\n\n Object result = StytchB2BClient.getPasswords().getEmail().reset(params);\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: "// POST /v1/b2b/passwords/email/reset\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.passwordsemail.ResetRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.passwords.email.reset(\n \ \ ResetRequest(\n passwordResetToken = \"${token}\"\ ,\n password = \"${examplePassword}\",\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: "// POST /v1/b2b/passwords/email/reset\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n password_reset_token:\ \ \"${token}\",\n password: \"${examplePassword}\",\n};\n\nclient.passwords.email.reset(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->passwords->email->reset([\n 'password_reset_token'\ \ => '${token}',\n 'password' => '${examplePassword}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/passwords/email/reset\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.passwords.email.reset(\n password_reset_token=\"\ ${token}\",\n password=\"${examplePassword}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/passwords/email/reset\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.passwords.email.reset(\n password_reset_token:\ \ \"${token}\",\n password: \"${examplePassword}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/passwords/email/reset\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::passwords_email::ResetRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.passwords.email.reset(\n ResetRequest{\n \ \ password_reset_token: \"${token}\",\n password: \"${examplePassword}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/passwords/email/reset\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/b2b/passwords/email/reset \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"password_reset_token\"\ : \"${token}\",\n \"password\": \"${examplePassword}\"\n }'" /v1/b2b/passwords/email/require_reset: post: summary: Requirereset operationId: api_b2b_password_v1_b2b_passwords_email_RequireReset tags: - B2B Passwords description: 'Require a password be reset by the associated email address. This endpoint is only functional for cross-org password use cases. If there are is only one active Member using the associated email address in the Project, the password will be deleted.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_email_RequireResetRequest' parameters: - 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_password_v1_b2b_passwords_email_RequireResetResponse' '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: "// POST /v1/b2b/passwords/email/require_reset\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n email_address: \"${email}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.Passwords.Email.RequireReset(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/passwords/email/require_reset\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/passwords/email\"\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 := &email.RequireResetParams{\n\t\t\ EmailAddress: \"${email}\",\n\t}\n\n\toptions := &email.RequireResetParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.Passwords.Email.RequireReset(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: "// POST /v1/b2b/passwords/email/require_reset\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.passwordsemail.RequireResetRequest;\n\ import com.stytch.java.b2b.models.passwordsemail.RequireResetRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n RequireResetRequest params =\ \ new RequireResetRequest();\n params.setEmailAddress(\"${email}\"\ );\n\n RequireResetRequestOptions options = new RequireResetRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getPasswords().getEmail().requireReset(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: "// POST /v1/b2b/passwords/email/require_reset\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.passwordsemail.RequireResetRequest\n\ import com.stytch.java.b2b.models.passwordsemail.RequireResetRequestOptions\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.passwords.email.requireReset(\n \ \ RequireResetRequest(\n emailAddress = \"${email}\"\ ,\n ),\n RequireResetRequestOptions(\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: "// POST /v1/b2b/passwords/email/require_reset\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n email_address: \"${email}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.passwords.email.requireReset(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->passwords->email->require_reset([\n 'email_address'\ \ => '${email}',\n], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# POST /v1/b2b/passwords/email/require_reset\nfrom stytch import\ \ B2BClient\nfrom stytch.b2b.models.passwords_email import RequireResetRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.passwords.email.require_reset(\n email_address=\"${email}\"\ ,\n method_options=RequireResetRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/passwords/email/require_reset\nrequire 'stytch'\n\n\ client = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.passwords.email.require_reset(\n email_address:\ \ \"${email}\",\n method_options: StytchB2B::Passwords::Email::RequireResetRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/passwords/email/require_reset\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::passwords_email::RequireResetRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.passwords.email.require_reset(\n RequireResetRequest{\n\ \ email_address: \"${email}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/passwords/email/require_reset\ncurl --request POST\ \ \\\n --url https://test.stytch.com/v1/b2b/passwords/email/require_reset\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"email_address\": \"${email}\"\n }'" /v1/b2b/passwords/session/reset: post: summary: Reset operationId: api_b2b_password_v1_b2b_passwords_session_Reset tags: - B2B Passwords description: 'Reset the Member''s password using their existing session. The endpoint will error if the session does not contain an authentication factor that has been issued within the last 5 minutes. Either `session_token` or `session_jwt` should be provided. Note that a successful password reset via an existing session will revoke all active sessions for the `member_id`, except for the one used during the reset flow.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_session_ResetRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_session_ResetResponse' '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: "// POST /v1/b2b/passwords/session/reset\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 password: \"${examplePassword}\",\n session_token:\ \ \"${sessionToken}\",\n};\n\nclient.Passwords.Sessions.Reset(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/passwords/session/reset\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/passwords/session\"\ \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 := &session.ResetParams{\n\t\tOrganizationID:\ \ \"${organizationId}\",\n\t\tPassword: \"${examplePassword}\",\n\t\ \tSessionToken: \"${sessionToken}\",\n\t}\n\n\tresp, err := client.Passwords.Sessions.Reset(context.Background(),\ \ params)\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: "// POST /v1/b2b/passwords/session/reset\npackage com.example;\n\n\ import com.stytch.java.b2b.models.passwordssession.ResetRequest;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ResetRequest params = new ResetRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setPassword(\"${examplePassword}\"\ );\n params.setSessionToken(\"${sessionToken}\");\n\n Object\ \ result = StytchB2BClient.getPasswords().getSessions().reset(params);\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: "// POST /v1/b2b/passwords/session/reset\npackage com.example\n\n\ import com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.passwordssession.ResetRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.passwords.sessions.reset(\n \ \ ResetRequest(\n organizationId = \"${organizationId}\"\ ,\n password = \"${examplePassword}\",\n \ \ sessionToken = \"${sessionToken}\",\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: "// POST /v1/b2b/passwords/session/reset\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 password: \"${examplePassword}\",\n session_token:\ \ \"${sessionToken}\",\n};\n\nclient.passwords.sessions.reset(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->passwords->sessions->reset([\n 'organization_id'\ \ => '${organizationId}',\n 'password' => '${examplePassword}',\n \ \ 'session_token' => '${sessionToken}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/passwords/session/reset\nfrom stytch import B2BClient\n\ \nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.passwords.sessions.reset(\n organization_id=\"\ ${organizationId}\",\n password=\"${examplePassword}\",\n session_token=\"\ ${sessionToken}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/passwords/session/reset\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.passwords.sessions.reset(\n organization_id:\ \ \"${organizationId}\",\n password: \"${examplePassword}\",\n session_token:\ \ \"${sessionToken}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/passwords/session/reset\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::passwords_session::ResetRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.passwords.sessions.reset(\n ResetRequest{\n \ \ organization_id: \"${organizationId}\",\n password: \"\ ${examplePassword}\",\n session_token: Some(String::from(\"${sessionToken}\"\ )),\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/passwords/session/reset\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/b2b/passwords/session/reset \\\n -u\ \ '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n\ \ -d '{\n \"organization_id\": \"${organizationId}\",\n \"password\"\ : \"${examplePassword}\",\n \"session_token\": \"${sessionToken}\"\n\ \ }'" /v1/b2b/passwords/existing_password/reset: post: summary: Reset operationId: api_b2b_password_v1_b2b_passwords_existing_password_Reset tags: - B2B Passwords description: 'Reset the member''s password using their existing password. This endpoint adapts to your Project''s password strength configuration. If you''re using [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy), the default, your passwords are considered valid if the strength score is >= 3. If you''re using [LUDS](https://stytch.com/docs/guides/passwords/strength-policy), your passwords are considered valid if they meet the requirements that you''ve set with Stytch. You may update your password strength configuration on the [Passwords Policy page](https://stytch.com/dashboard/password-strength-config) in the Stytch Dashboard. If the Member is required to complete MFA to log in to the Organization, the returned value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned. The `intermediate_session_token` can be passed into the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA step and acquire a full member session. The `session_duration_minutes` and `session_custom_claims` parameters will be ignored. If a valid `session_token` or `session_jwt` is passed in, the Member will not be required to complete an MFA step. Note that a successful password reset via an existing password will revoke all active sessions for the `member_id`.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_existing_password_ResetRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_existing_password_ResetResponse' '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: "// POST /v1/b2b/passwords/existing_password/reset\nconst stytch =\ \ require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n email_address:\ \ \"${email}\",\n existing_password: \"old_password\",\n new_password:\ \ \"${examplePassword}\",\n organization_id: \"${organizationId}\",\n};\n\ \nclient.Passwords.ExistingPassword.Reset(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/passwords/existing_password/reset\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/passwords/existingpassword\"\ \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 := &existingpassword.ResetParams{\n\ \t\tEmailAddress: \"${email}\",\n\t\tExistingPassword: \"old_password\"\ ,\n\t\tNewPassword: \"${examplePassword}\",\n\t\tOrganizationID: \ \ \"${organizationId}\",\n\t}\n\n\tresp, err := client.Passwords.ExistingPassword.Reset(context.Background(),\ \ params)\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: "// POST /v1/b2b/passwords/existing_password/reset\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.passwordsexistingpassword.ResetRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ResetRequest params = new ResetRequest();\n params.setEmailAddress(\"\ ${email}\");\n params.setExistingPassword(\"old_password\");\n \ \ params.setNewPassword(\"${examplePassword}\");\n params.setOrganizationId(\"\ ${organizationId}\");\n\n Object result = StytchB2BClient.getPasswords().getExistingPassword().reset(params);\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: "// POST /v1/b2b/passwords/existing_password/reset\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.passwordsexistingpassword.ResetRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.passwords.existingPassword.reset(\n \ \ ResetRequest(\n emailAddress = \"${email}\"\ ,\n existingPassword = \"old_password\",\n \ \ newPassword = \"${examplePassword}\",\n organizationId\ \ = \"${organizationId}\",\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: "// POST /v1/b2b/passwords/existing_password/reset\nconst stytch =\ \ require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n email_address:\ \ \"${email}\",\n existing_password: \"old_password\",\n new_password:\ \ \"${examplePassword}\",\n organization_id: \"${organizationId}\",\n};\n\ \nclient.passwords.existingPassword.reset(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->passwords->existing_password->reset([\n 'email_address'\ \ => '${email}',\n 'existing_password' => 'old_password',\n 'new_password'\ \ => '${examplePassword}',\n 'organization_id' => '${organizationId}',\n\ ]);" - lang: python label: Python source: "# POST /v1/b2b/passwords/existing_password/reset\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.passwords.existing_password.reset(\n\ \ email_address=\"${email}\",\n existing_password=\"old_password\"\ ,\n new_password=\"${examplePassword}\",\n organization_id=\"${organizationId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/passwords/existing_password/reset\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.passwords.existing_password.reset(\n\ \ email_address: \"${email}\",\n existing_password: \"old_password\",\n\ \ new_password: \"${examplePassword}\",\n organization_id: \"${organizationId}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/passwords/existing_password/reset\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::passwords_existing_password::ResetRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.passwords.existing_password.reset(\n ResetRequest{\n\ \ email_address: \"${email}\",\n existing_password:\ \ \"old_password\",\n new_password: \"${examplePassword}\",\n\ \ organization_id: \"${organizationId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/passwords/existing_password/reset\ncurl --request\ \ POST \\\n --url https://test.stytch.com/v1/b2b/passwords/existing_password/reset\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email_address\": \"${email}\",\n \"existing_password\"\ : \"old_password\",\n \"new_password\": \"${examplePassword}\",\n \ \ \"organization_id\": \"${organizationId}\"\n }'" /v1/b2b/passwords/discovery/authenticate: post: summary: Authenticate operationId: api_b2b_password_v1_b2b_passwords_discovery_Authenticate tags: - B2B Passwords description: 'Authenticate an email/password combination in the discovery flow. This authenticate flow is only valid for cross-org passwords use cases, and is not tied to a specific organization. If you have breach detection during authentication enabled in your [password strength policy](https://stytch.com/docs/b2b/guides/passwords/strength-policy) and the member''s credentials have appeared in the HaveIBeenPwned dataset, this endpoint will return a `member_reset_password` error even if the member enters a correct password. We force a password reset in this case to ensure that the member is the legitimate owner of the email address and not a malicious actor abusing the compromised credentials. If successful, this endpoint will create a new intermediate session and return a list of discovered organizations that can be session exchanged into.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_discovery_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_discovery_AuthenticateResponse' '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: "// POST /v1/b2b/passwords/discovery/authenticate\nconst stytch =\ \ require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n email_address:\ \ \"${email}\",\n password: \"${examplePassword}\",\n};\n\nclient.Passwords.Discovery.Authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/passwords/discovery/authenticate\npackage main\n\n\ import (\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/passwords/discovery\"\ \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 := &discovery.AuthenticateParams{\n\ \t\tEmailAddress: \"${email}\",\n\t\tPassword: \"${examplePassword}\"\ ,\n\t}\n\n\tresp, err := client.Passwords.Discovery.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/b2b/passwords/discovery/authenticate\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.passwordsdiscovery.AuthenticateRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ AuthenticateRequest params = new AuthenticateRequest();\n \ \ params.setEmailAddress(\"${email}\");\n params.setPassword(\"\ ${examplePassword}\");\n\n Object result = StytchB2BClient.getPasswords().getDiscovery().authenticate(params);\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: "// POST /v1/b2b/passwords/discovery/authenticate\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.passwordsdiscovery.AuthenticateRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.passwords.discovery.authenticate(\n \ \ AuthenticateRequest(\n emailAddress = \"\ ${email}\",\n password = \"${examplePassword}\",\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: "// POST /v1/b2b/passwords/discovery/authenticate\nconst stytch =\ \ require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n email_address:\ \ \"${email}\",\n password: \"${examplePassword}\",\n};\n\nclient.passwords.discovery.authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->passwords->discovery->authenticate([\n 'email_address'\ \ => '${email}',\n 'password' => '${examplePassword}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/passwords/discovery/authenticate\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.passwords.discovery.authenticate(\n\ \ email_address=\"${email}\",\n password=\"${examplePassword}\",\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/passwords/discovery/authenticate\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.passwords.discovery.authenticate(\n\ \ email_address: \"${email}\",\n password: \"${examplePassword}\"\n \n\ )\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/passwords/discovery/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::passwords_discovery::AuthenticateRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.passwords.discovery.authenticate(\n AuthenticateRequest{\n\ \ email_address: \"${email}\",\n password: \"${examplePassword}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/passwords/discovery/authenticate\ncurl --request POST\ \ \\\n --url https://test.stytch.com/v1/b2b/passwords/discovery/authenticate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email_address\": \"${email}\",\n \"password\": \"\ ${examplePassword}\"\n }'" /v1/b2b/passwords/discovery/email/reset/start: post: summary: Resetstart operationId: api_b2b_password_v1_b2b_passwords_discovery_email_ResetStart tags: - Discovery description: 'Initiates a password reset for the email address provided, when cross-org passwords are enabled. This will trigger an email to be sent to the address, containing a magic link that will allow them to set a new password and authenticate. This endpoint adapts to your Project''s password strength configuration. If you''re using [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy), the default, your passwords are considered valid if the strength score is >= 3. If you''re using [LUDS](https://stytch.com/docs/guides/passwords/strength-policy), your passwords are considered valid if they meet the requirements that you''ve set with Stytch. You may update your password strength configuration on the [Passwords Policy page](https://stytch.com/dashboard/password-strength-config) in the Stytch Dashboard.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_discovery_email_ResetStartRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_discovery_email_ResetStartResponse' '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: "// POST /v1/b2b/passwords/discovery/email/reset/start\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n email_address:\ \ \"${email}\",\n};\n\nclient.Passwords.Discovery.Email.ResetStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/passwords/discovery/email/reset/start\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/passwords/discovery/email\"\ \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 := &email.ResetStartParams{\n\t\t\ EmailAddress: \"${email}\",\n\t}\n\n\tresp, err := client.Passwords.Discovery.Email.ResetStart(context.Background(),\ \ params)\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: "// POST /v1/b2b/passwords/discovery/email/reset/start\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.passwordsdiscoveryemail.ResetStartRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ResetStartRequest params = new ResetStartRequest();\n params.setEmailAddress(\"\ ${email}\");\n\n Object result = StytchB2BClient.getPasswords().getDiscovery().getEmail().resetStart(params);\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: "// POST /v1/b2b/passwords/discovery/email/reset/start\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.passwordsdiscoveryemail.ResetStartRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.passwords.discovery.email.resetStart(\n\ \ ResetStartRequest(\n emailAddress =\ \ \"${email}\",\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: "// POST /v1/b2b/passwords/discovery/email/reset/start\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n email_address:\ \ \"${email}\",\n};\n\nclient.passwords.discovery.email.resetStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->passwords->discovery->email->reset_start([\n\ \ 'email_address' => '${email}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/passwords/discovery/email/reset/start\nfrom stytch\ \ import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.passwords.discovery.email.reset_start(\n\ \ email_address=\"${email}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/passwords/discovery/email/reset/start\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.passwords.discovery.email.reset_start(\n\ \ email_address: \"${email}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/passwords/discovery/email/reset/start\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::passwords_discovery_email::ResetStartRequest;\n\nfn main()\ \ {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.passwords.discovery.email.reset_start(\n ResetStartRequest{\n\ \ email_address: \"${email}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/passwords/discovery/email/reset/start\ncurl --request\ \ POST \\\n --url https://test.stytch.com/v1/b2b/passwords/discovery/email/reset/start\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email_address\": \"${email}\"\n }'" /v1/b2b/passwords/discovery/email/reset: post: summary: Reset operationId: api_b2b_password_v1_b2b_passwords_discovery_email_Reset tags: - Discovery description: "Reset the password associated with an email and start an intermediate\ \ session. This endpoint checks that the password reset token is valid, hasn\u2019\ t expired, or already been used.\n\nThe provided password needs to meet the\ \ project's password strength requirements, which can be checked in advance\ \ with the password strength endpoint. If the token and password are accepted,\ \ the password is securely stored for future authentication and the user is\ \ authenticated.\n\nResetting a password will start an intermediate session\ \ and return a list of discovered organizations the session can be exchanged\ \ into." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_discovery_email_ResetRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_b2b_password_v1_b2b_passwords_discovery_email_ResetResponse' '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: "// POST /v1/b2b/passwords/discovery/email/reset\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n password_reset_token:\ \ \"${token}\",\n password: \"${examplePassword}\",\n};\n\nclient.Passwords.Discovery.Email.Reset(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/passwords/discovery/email/reset\npackage main\n\n\ import (\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/passwords/discovery/email\"\ \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 := &email.ResetParams{\n\t\tPasswordResetToken:\ \ \"${token}\",\n\t\tPassword: \"${examplePassword}\",\n\t}\n\n\ \tresp, err := client.Passwords.Discovery.Email.Reset(context.Background(),\ \ params)\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: "// POST /v1/b2b/passwords/discovery/email/reset\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.passwordsdiscoveryemail.ResetRequest;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ ResetRequest params = new ResetRequest();\n params.setPasswordResetToken(\"\ ${token}\");\n params.setPassword(\"${examplePassword}\");\n\n \ \ Object result = StytchB2BClient.getPasswords().getDiscovery().getEmail().reset(params);\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: "// POST /v1/b2b/passwords/discovery/email/reset\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.passwordsdiscoveryemail.ResetRequest\n\ \nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.passwords.discovery.email.reset(\n \ \ ResetRequest(\n passwordResetToken = \"\ ${token}\",\n password = \"${examplePassword}\",\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: "// POST /v1/b2b/passwords/discovery/email/reset\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n password_reset_token:\ \ \"${token}\",\n password: \"${examplePassword}\",\n};\n\nclient.passwords.discovery.email.reset(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->passwords->discovery->email->reset([\n 'password_reset_token'\ \ => '${token}',\n 'password' => '${examplePassword}',\n]);" - lang: python label: Python source: "# POST /v1/b2b/passwords/discovery/email/reset\nfrom stytch import\ \ B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n \ \ secret=\"${secret}\",\n)\n\nresp = client.passwords.discovery.email.reset(\n\ \ password_reset_token=\"${token}\",\n password=\"${examplePassword}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/passwords/discovery/email/reset\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.passwords.discovery.email.reset(\n \ \ password_reset_token: \"${token}\",\n password: \"${examplePassword}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/passwords/discovery/email/reset\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::passwords_discovery_email::ResetRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.passwords.discovery.email.reset(\n ResetRequest{\n\ \ password_reset_token: \"${token}\",\n password:\ \ \"${examplePassword}\",\n ..Default::default()\n }\n\ \ ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/passwords/discovery/email/reset\ncurl --request POST\ \ \\\n --url https://test.stytch.com/v1/b2b/passwords/discovery/email/reset\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"password_reset_token\": \"${token}\",\n \"password\"\ : \"${examplePassword}\"\n }'" /v1/oauth/attach: post: summary: Attach operationId: api_oauth_v1_Attach tags: - Oauth description: 'Generate an OAuth Attach Token to pre-associate an OAuth flow with an existing Stytch User. Pass the returned `oauth_attach_token` to the same provider''s OAuth Start endpoint to treat this OAuth flow as a login for that user instead of a signup for a new user. Exactly one of `user_id`, `session_token`, or `session_jwt` must be provided to identify the target Stytch User. **Note**: This is an optional step in the OAuth flow. Stytch can often determine whether to associate a new OAuth login with an existing User based on verified information (such as an email address) from the identity provider. This endpoint is useful for cases where we can''t, such as missing or unverified provider information. See our [OAuth email address behavior](https://stytch.com/docs/guides/oauth/email-behavior) resource for additional information.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_oauth_v1_AttachRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_oauth_v1_AttachResponse' '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: "// POST /v1/oauth/attach\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n provider: \"microsoft\",\n user_id:\ \ \"${userId}\",\n};\n\nclient.OAuth.Attach(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/oauth/attach\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/oauth\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &oauth.AttachParams{\n\t\tProvider:\ \ \"microsoft\",\n\t\tUserID: \"${userId}\",\n\t}\n\n\tresp, err := client.OAuth.Attach(context.Background(),\ \ params)\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: "// POST /v1/oauth/attach\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.oauth.AttachRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ AttachRequest params = new AttachRequest();\n params.setProvider(\"\ microsoft\");\n params.setUserId(\"${userId}\");\n\n Object\ \ result = StytchClient.getOAuth().attach(params);\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: "// POST /v1/oauth/attach\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.oauth.AttachRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.oauth.attach(\n AttachRequest(\n\ \ provider = \"microsoft\",\n userId\ \ = \"${userId}\",\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: "// POST /v1/oauth/attach\nconst stytch = require('stytch');\n\nconst\ \ client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n provider: \"microsoft\",\n user_id:\ \ \"${userId}\",\n};\n\nclient.oauth.attach(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->oauth->attach([\n 'provider' => 'microsoft',\n\ \ 'user_id' => '${userId}',\n]);" - lang: python label: Python source: "# POST /v1/oauth/attach\nfrom stytch import Client\n\nclient = Client(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.oauth.attach(\n provider=\"microsoft\",\n user_id=\"${userId}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/oauth/attach\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.oauth.attach(\n\ \ provider: \"microsoft\",\n user_id: \"${userId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/oauth/attach\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::oauth::AttachRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.oauth.attach(\n AttachRequest{\n provider:\ \ \"microsoft\",\n user_id: Some(String::from(\"${userId}\")),\n\ \ ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/oauth/attach\ncurl --request POST \\\n --url https://test.stytch.com/v1/oauth/attach\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"provider\": \"microsoft\",\n \"user_id\": \"${userId}\"\ \n }'" /v1/oauth/authenticate: post: summary: Authenticate operationId: api_oauth_v1_Authenticate tags: - Oauth description: Authenticate a User given a `token`. This endpoint verifies that the user completed the OAuth flow by verifying that the token is valid and hasn't expired. To initiate a Stytch session for the user while authenticating their OAuth token, include `session_duration_minutes`; a session with the identity provider, e.g. Google or Facebook, will always be initiated upon successful authentication. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_oauth_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_oauth_v1_AuthenticateResponse' '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: "// POST /v1/oauth/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n token: \"${token}\",\n session_duration_minutes:\ \ 60,\n};\n\nclient.OAuth.Authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/oauth/authenticate\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/oauth\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &oauth.AuthenticateParams{\n\t\t\ Token: \"${token}\",\n\t\tSessionDurationMinutes: 60,\n\ \t}\n\n\tresp, err := client.OAuth.Authenticate(context.Background(), params)\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: "// POST /v1/oauth/authenticate\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.oauth.AuthenticateRequest;\nimport\ \ com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n public\ \ static void main(String[] args) {\n StytchClient.configure(\"${projectId}\"\ , \"${secret}\");\n\n AuthenticateRequest params = new AuthenticateRequest();\n\ \ params.setToken(\"${token}\");\n params.setSessionDurationMinutes(60);\n\ \n Object result = StytchClient.getOAuth().authenticate(params);\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: "// POST /v1/oauth/authenticate\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.oauth.AuthenticateRequest\n\nfun\ \ main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.oauth.authenticate(\n AuthenticateRequest(\n\ \ token = \"${token}\",\n sessionDurationMinutes\ \ = 60,\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: "// POST /v1/oauth/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n token: \"${token}\",\n session_duration_minutes:\ \ 60,\n};\n\nclient.oauth.authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->oauth->authenticate([\n 'token' => '${token}',\n\ \ 'session_duration_minutes' => 60,\n]);" - lang: python label: Python source: "# POST /v1/oauth/authenticate\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.oauth.authenticate(\n token=\"${token}\",\n \ \ session_duration_minutes=60,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/oauth/authenticate\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.oauth.authenticate(\n\ \ token: \"${token}\",\n session_duration_minutes: 60\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/oauth/authenticate\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::oauth::AuthenticateRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.oauth.authenticate(\n AuthenticateRequest{\n \ \ token: \"${token}\",\n session_duration_minutes: 60,\n\ \ ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/oauth/authenticate\ncurl --request POST \\\n --url https://test.stytch.com/v1/oauth/authenticate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"token\": \"${token}\",\n \"session_duration_minutes\"\ : 60\n }'" /v1/otps/authenticate: post: summary: Authenticate operationId: api_otp_v1_Authenticate tags: - Otp description: Authenticate a User given a `method_id` (the associated `email_id` or `phone_id`) and a `code`. This endpoint verifies that the code is valid, hasn't expired or been previously used, and any optional security settings such as IP match or user agent match are satisfied. A given `method_id` may only have a single active OTP code at any given time, if a User requests another OTP code before the first one has expired, the first one will be invalidated. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_AuthenticateResponse' '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: "// POST /v1/otps/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n method_id: \"${phoneId}\",\n\ \ code: \"${exampleCode}\",\n session_duration_minutes: 60,\n};\n\nclient.OTPs.Authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/otps/authenticate\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/otp\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &otp.AuthenticateParams{\n\t\t\ MethodID: \"${phoneId}\",\n\t\tCode: \"\ ${exampleCode}\",\n\t\tSessionDurationMinutes: 60,\n\t}\n\n\tresp, err :=\ \ client.OTPs.Authenticate(context.Background(), params)\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: "// POST /v1/otps/authenticate\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.otp.AuthenticateRequest;\nimport\ \ com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n public\ \ static void main(String[] args) {\n StytchClient.configure(\"${projectId}\"\ , \"${secret}\");\n\n AuthenticateRequest params = new AuthenticateRequest();\n\ \ params.setMethodId(\"${phoneId}\");\n params.setCode(\"\ ${exampleCode}\");\n params.setSessionDurationMinutes(60);\n\n \ \ Object result = StytchClient.getOTPs().authenticate(params);\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: "// POST /v1/otps/authenticate\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.otp.AuthenticateRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.otps.authenticate(\n AuthenticateRequest(\n\ \ methodId = \"${phoneId}\",\n code\ \ = \"${exampleCode}\",\n sessionDurationMinutes = 60,\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: "// POST /v1/otps/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n method_id: \"${phoneId}\",\n\ \ code: \"${exampleCode}\",\n session_duration_minutes: 60,\n};\n\nclient.otps.authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->otps->authenticate([\n 'method_id' => '${phoneId}',\n\ \ 'code' => '${exampleCode}',\n 'session_duration_minutes' => 60,\n\ ]);" - lang: python label: Python source: "# POST /v1/otps/authenticate\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.otps.authenticate(\n method_id=\"${phoneId}\",\n\ \ code=\"${exampleCode}\",\n session_duration_minutes=60,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/otps/authenticate\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.otps.authenticate(\n\ \ method_id: \"${phoneId}\",\n code: \"${exampleCode}\",\n session_duration_minutes:\ \ 60\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/otps/authenticate\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::otp::AuthenticateRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.otps.authenticate(\n AuthenticateRequest{\n \ \ method_id: \"${phoneId}\",\n code: \"${exampleCode}\"\ ,\n session_duration_minutes: 60,\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/otps/authenticate\ncurl --request POST \\\n --url https://test.stytch.com/v1/otps/authenticate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"method_id\": \"${phoneId}\",\n \"code\": \"${exampleCode}\"\ ,\n \"session_duration_minutes\": 60\n }'" /v1/otps/sms/send: post: summary: Send operationId: api_otp_v1_otp_sms_Send tags: - Otp description: 'Send a one-time passcode (OTP) to a user''s phone number. If you''d like to create a user and send them a passcode with one request, use our [log in or create](https://stytch.com/docs/api/log-in-or-create-user-by-sms) endpoint. Note that sending another OTP code before the first has expired will invalidate the first code. ### Cost to send SMS OTP Before configuring SMS or WhatsApp OTPs, please review how Stytch [bills the costs of international OTPs](https://stytch.com/pricing) and understand how to protect your app against [toll fraud](https://stytch.com/docs/guides/passcodes/toll-fraud/overview). __Note:__ SMS to phone numbers outside of the US and Canada is disabled by default for customers who did not use SMS prior to October 2023. If you''re interested in sending international SMS, please add those countries to your Project''s allowlist via the [Dashboard](https://stytch.com/dashboard/country-code-allowlists) or [Programmatic Workspace Actions](https://stytch.com/docs/workspace-management/pwa/set-allowed-country-codes), and [add credit card details](https://stytch.com/dashboard/settings/billing) to your account. Even when international SMS is enabled, we do not support sending SMS to countries on our [Unsupported countries list](https://stytch.com/docs/guides/passcodes/unsupported-countries). ### Add a phone number to an existing user This endpoint also allows you to add a new phone number to an existing Stytch User. Including a `user_id`, `session_token`, or `session_jwt` in your Send one-time passcode by SMS request will add the new, unverified phone number to the existing Stytch User. If the user successfully authenticates within 5 minutes, the new phone number will be marked as verified and remain permanently on the existing Stytch User. Otherwise, it will be removed from the User object, and any subsequent login requests using that phone number will create a new User. ### Next steps Collect the OTP which was delivered to the user. Call [Authenticate OTP](https://stytch.com/docs/api/authenticate-otp) using the OTP `code` along with the `phone_id` found in the response as the `method_id`.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_otp_sms_SendRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_otp_sms_SendResponse' '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: "// POST /v1/otps/sms/send\nconst stytch = require('stytch');\n\n\ const client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n phone_number: \"${examplePhoneNumber}\"\ ,\n};\n\nclient.OTPs.Sms.Send(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/otps/sms/send\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/otp/sms\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &sms.SendParams{\n\t\tPhoneNumber:\ \ \"${examplePhoneNumber}\",\n\t}\n\n\tresp, err := client.OTPs.Sms.Send(context.Background(),\ \ params)\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: "// POST /v1/otps/sms/send\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.otpsms.SendRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ SendRequest params = new SendRequest();\n params.setPhoneNumber(\"\ ${examplePhoneNumber}\");\n\n Object result = StytchClient.getOTPs().getSms().send(params);\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: "// POST /v1/otps/sms/send\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.otpsms.SendRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.otps.sms.send(\n SendRequest(\n\ \ phoneNumber = \"${examplePhoneNumber}\",\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: "// POST /v1/otps/sms/send\nconst stytch = require('stytch');\n\n\ const client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n phone_number: \"${examplePhoneNumber}\"\ ,\n};\n\nclient.otps.sms.send(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->otps->sms->send([\n 'phone_number' => '${examplePhoneNumber}',\n\ ]);" - lang: python label: Python source: "# POST /v1/otps/sms/send\nfrom stytch import Client\n\nclient = Client(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.otps.sms.send(\n phone_number=\"${examplePhoneNumber}\",\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/otps/sms/send\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.otps.sms.send(\n\ \ phone_number: \"${examplePhoneNumber}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/otps/sms/send\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::otp_sms::SendRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.otps.sms.send(\n SendRequest{\n phone_number:\ \ \"${examplePhoneNumber}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/otps/sms/send\ncurl --request POST \\\n --url https://test.stytch.com/v1/otps/sms/send\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"phone_number\": \"${examplePhoneNumber}\"\n }'" /v1/otps/sms/login_or_create: post: summary: Loginorcreate operationId: api_otp_v1_otp_sms_LoginOrCreate tags: - Otp description: 'Send a One-Time Passcode (OTP) to a User using their phone number. If the phone number is not associated with a user already, a user will be created. ### Cost to send SMS OTP Before configuring SMS or WhatsApp OTPs, please review how Stytch [bills the costs of international OTPs](https://stytch.com/pricing) and understand how to protect your app against [toll fraud](https://stytch.com/docs/guides/passcodes/toll-fraud/overview). __Note:__ SMS to phone numbers outside of the US and Canada is disabled by default for customers who did not use SMS prior to October 2023. If you''re interested in sending international SMS, please add those countries to your Project''s allowlist via the [Dashboard](https://stytch.com/dashboard/country-code-allowlists) or [Programmatic Workspace Actions](https://stytch.com/docs/workspace-management/pwa/set-allowed-country-codes), and [add credit card details](https://stytch.com/dashboard/settings/billing) to your account. Even when international SMS is enabled, we do not support sending SMS to countries on our [Unsupported countries list](https://stytch.com/docs/guides/passcodes/unsupported-countries). ### Next steps Collect the OTP which was delivered to the User. Call [Authenticate OTP](https://stytch.com/docs/api/authenticate-otp) using the OTP `code` along with the `phone_id` found in the response as the `method_id`.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_otp_sms_LoginOrCreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_otp_sms_LoginOrCreateResponse' '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: "// POST /v1/otps/sms/login_or_create\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n phone_number: \"${examplePhoneNumber}\"\ ,\n};\n\nclient.OTPs.Sms.LoginOrCreate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/otps/sms/login_or_create\npackage main\n\nimport (\n\t\ \"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/otp/sms\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &sms.LoginOrCreateParams{\n\t\t\ PhoneNumber: \"${examplePhoneNumber}\",\n\t}\n\n\tresp, err := client.OTPs.Sms.LoginOrCreate(context.Background(),\ \ params)\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: "// POST /v1/otps/sms/login_or_create\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.otpsms.LoginOrCreateRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n LoginOrCreateRequest params =\ \ new LoginOrCreateRequest();\n params.setPhoneNumber(\"${examplePhoneNumber}\"\ );\n\n Object result = StytchClient.getOTPs().getSms().loginOrCreate(params);\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: "// POST /v1/otps/sms/login_or_create\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.otpsms.LoginOrCreateRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.otps.sms.loginOrCreate(\n LoginOrCreateRequest(\n\ \ phoneNumber = \"${examplePhoneNumber}\",\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: "// POST /v1/otps/sms/login_or_create\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n phone_number: \"${examplePhoneNumber}\"\ ,\n};\n\nclient.otps.sms.loginOrCreate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->otps->sms->login_or_create([\n 'phone_number'\ \ => '${examplePhoneNumber}',\n]);" - lang: python label: Python source: "# POST /v1/otps/sms/login_or_create\nfrom stytch import Client\n\n\ client = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.otps.sms.login_or_create(\n phone_number=\"${examplePhoneNumber}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/otps/sms/login_or_create\nrequire 'stytch'\n\nclient =\ \ Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.otps.sms.login_or_create(\n phone_number: \"${examplePhoneNumber}\"\ \n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/otps/sms/login_or_create\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::otp_sms::LoginOrCreateRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.otps.sms.login_or_create(\n LoginOrCreateRequest{\n\ \ phone_number: \"${examplePhoneNumber}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/otps/sms/login_or_create\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/otps/sms/login_or_create \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"phone_number\"\ : \"${examplePhoneNumber}\"\n }'" /v1/otps/whatsapp/send: post: summary: Send operationId: api_otp_v1_otp_whatsapp_Send tags: - Otp description: 'Send a One-Time Passcode (OTP) to a User''s WhatsApp. If you''d like to create a user and send them a passcode with one request, use our [log in or create](https://stytch.com/docs/api/whatsapp-login-or-create) endpoint. Note that sending another OTP code before the first has expired will invalidate the first code. ### Cost to send SMS OTP Before configuring SMS or WhatsApp OTPs, please review how Stytch [bills the costs of international OTPs](https://stytch.com/pricing) and understand how to protect your app against [toll fraud](https://stytch.com/docs/guides/passcodes/toll-fraud/overview). ### Add a phone number to an existing user This endpoint also allows you to add a new phone number to an existing Stytch User. Including a `user_id`, `session_token`, or `session_jwt` in your Send one-time passcode by WhatsApp request will add the new, unverified phone number to the existing Stytch User. If the user successfully authenticates within 5 minutes, the new phone number will be marked as verified and remain permanently on the existing Stytch User. Otherwise, it will be removed from the User object, and any subsequent login requests using that phone number will create a new User. ### Next steps Collect the OTP which was delivered to the user. Call [Authenticate OTP](https://stytch.com/docs/api/authenticate-otp) using the OTP `code` along with the `phone_id` found in the response as the `method_id`.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_otp_whatsapp_SendRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_otp_whatsapp_SendResponse' '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: "// POST /v1/otps/whatsapp/send\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n phone_number: \"${examplePhoneNumber}\"\ ,\n};\n\nclient.OTPs.WhatsApp.Send(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/otps/whatsapp/send\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/otp/whatsapp\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &whatsapp.SendParams{\n\t\tPhoneNumber:\ \ \"${examplePhoneNumber}\",\n\t}\n\n\tresp, err := client.OTPs.WhatsApp.Send(context.Background(),\ \ params)\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: "// POST /v1/otps/whatsapp/send\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.otpwhatsapp.SendRequest;\nimport\ \ com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n public\ \ static void main(String[] args) {\n StytchClient.configure(\"${projectId}\"\ , \"${secret}\");\n\n SendRequest params = new SendRequest();\n \ \ params.setPhoneNumber(\"${examplePhoneNumber}\");\n\n Object\ \ result = StytchClient.getOTPs().getWhatsApp().send(params);\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: "// POST /v1/otps/whatsapp/send\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.otpwhatsapp.SendRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.otps.whatsapp.send(\n SendRequest(\n\ \ phoneNumber = \"${examplePhoneNumber}\",\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: "// POST /v1/otps/whatsapp/send\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n phone_number: \"${examplePhoneNumber}\"\ ,\n};\n\nclient.otps.whatsapp.send(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->otps->whatsapp->send([\n 'phone_number' =>\ \ '${examplePhoneNumber}',\n]);" - lang: python label: Python source: "# POST /v1/otps/whatsapp/send\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.otps.whatsapp.send(\n phone_number=\"${examplePhoneNumber}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/otps/whatsapp/send\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.otps.whatsapp.send(\n\ \ phone_number: \"${examplePhoneNumber}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/otps/whatsapp/send\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::otp_whatsapp::SendRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.otps.whatsapp.send(\n SendRequest{\n phone_number:\ \ \"${examplePhoneNumber}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/otps/whatsapp/send\ncurl --request POST \\\n --url https://test.stytch.com/v1/otps/whatsapp/send\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"phone_number\": \"${examplePhoneNumber}\"\n }'" /v1/otps/whatsapp/login_or_create: post: summary: Loginorcreate operationId: api_otp_v1_otp_whatsapp_LoginOrCreate tags: - Otp description: 'Send a one-time passcode (OTP) to a User''s WhatsApp using their phone number. If the phone number is not associated with a User already, a User will be created. ### Cost to send SMS OTP Before configuring SMS or WhatsApp OTPs, please review how Stytch [bills the costs of international OTPs](https://stytch.com/pricing) and understand how to protect your app against [toll fraud](https://stytch.com/docs/guides/passcodes/toll-fraud/overview). ### Next steps Collect the OTP which was delivered to the User. Call [Authenticate OTP](https://stytch.com/docs/api/authenticate-otp) using the OTP `code` along with the `phone_id` found in the response as the `method_id`.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_otp_whatsapp_LoginOrCreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_otp_whatsapp_LoginOrCreateResponse' '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: "// POST /v1/otps/whatsapp/login_or_create\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n phone_number: \"${examplePhoneNumber}\"\ ,\n};\n\nclient.OTPs.WhatsApp.LoginOrCreate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/otps/whatsapp/login_or_create\npackage main\n\nimport\ \ (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/otp/whatsapp\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &whatsapp.LoginOrCreateParams{\n\ \t\tPhoneNumber: \"${examplePhoneNumber}\",\n\t}\n\n\tresp, err := client.OTPs.WhatsApp.LoginOrCreate(context.Background(),\ \ params)\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: "// POST /v1/otps/whatsapp/login_or_create\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.otpwhatsapp.LoginOrCreateRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n LoginOrCreateRequest params =\ \ new LoginOrCreateRequest();\n params.setPhoneNumber(\"${examplePhoneNumber}\"\ );\n\n Object result = StytchClient.getOTPs().getWhatsApp().loginOrCreate(params);\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: "// POST /v1/otps/whatsapp/login_or_create\npackage com.example\n\n\ import com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.otpwhatsapp.LoginOrCreateRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.otps.whatsapp.loginOrCreate(\n \ \ LoginOrCreateRequest(\n phoneNumber = \"${examplePhoneNumber}\"\ ,\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: "// POST /v1/otps/whatsapp/login_or_create\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n phone_number: \"${examplePhoneNumber}\"\ ,\n};\n\nclient.otps.whatsapp.loginOrCreate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->otps->whatsapp->login_or_create([\n 'phone_number'\ \ => '${examplePhoneNumber}',\n]);" - lang: python label: Python source: "# POST /v1/otps/whatsapp/login_or_create\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.otps.whatsapp.login_or_create(\n phone_number=\"\ ${examplePhoneNumber}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/otps/whatsapp/login_or_create\nrequire 'stytch'\n\nclient\ \ = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.otps.whatsapp.login_or_create(\n phone_number: \"\ ${examplePhoneNumber}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/otps/whatsapp/login_or_create\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::otp_whatsapp::LoginOrCreateRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.otps.whatsapp.login_or_create(\n LoginOrCreateRequest{\n\ \ phone_number: \"${examplePhoneNumber}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/otps/whatsapp/login_or_create\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/otps/whatsapp/login_or_create \\\n \ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"phone_number\": \"${examplePhoneNumber}\"\n }'" /v1/otps/email/send: post: summary: Send operationId: api_otp_v1_otp_email_Send tags: - Otp description: 'Send a One-Time Passcode (OTP) to a User using their email. If you''d like to create a user and send them a passcode with one request, use our [log in or create endpoint](https://stytch.com/docs/api/log-in-or-create-user-by-email-otp). ### Add an email to an existing user This endpoint also allows you to add a new email address to an existing Stytch User. Including a `user_id`, `session_token`, or `session_jwt` in your Send one-time passcode by email request will add the new, unverified email address to the existing Stytch User. If the user successfully authenticates within 5 minutes, the new email address will be marked as verified and remain permanently on the existing Stytch User. Otherwise, it will be removed from the User object, and any subsequent login requests using that email address will create a new User. ### Next steps Collect the OTP which was delivered to the user. Call [Authenticate OTP](https://stytch.com/docs/api/authenticate-otp) using the OTP `code` along with the `email_id` found in the response as the `method_id`.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_otp_email_SendRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_otp_email_SendResponse' '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: "// POST /v1/otps/email/send\nconst stytch = require('stytch');\n\n\ const client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.OTPs.Email.Send(params)\n .then(resp => { console.log(resp) })\n\ \ .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/otps/email/send\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/otp/email\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &email.SendParams{\n\t\tEmail:\ \ \"${email}\",\n\t}\n\n\tresp, err := client.OTPs.Email.Send(context.Background(),\ \ params)\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: "// POST /v1/otps/email/send\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.otpemail.SendRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ SendRequest params = new SendRequest();\n params.setEmail(\"\ ${email}\");\n\n Object result = StytchClient.getOTPs().getEmail().send(params);\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: "// POST /v1/otps/email/send\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.otpemail.SendRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.otps.email.send(\n SendRequest(\n\ \ email = \"${email}\",\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: "// POST /v1/otps/email/send\nconst stytch = require('stytch');\n\n\ const client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.otps.email.send(params)\n .then(resp => { console.log(resp) })\n\ \ .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->otps->email->send([\n 'email' => '${email}',\n\ ]);" - lang: python label: Python source: "# POST /v1/otps/email/send\nfrom stytch import Client\n\nclient =\ \ Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\",\n\ )\n\nresp = client.otps.email.send(\n email=\"${email}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/otps/email/send\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.otps.email.send(\n\ \ email: \"${email}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/otps/email/send\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::otp_email::SendRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.otps.email.send(\n SendRequest{\n email: \"\ ${email}\",\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/otps/email/send\ncurl --request POST \\\n --url https://test.stytch.com/v1/otps/email/send\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"email\": \"${email}\"\n }'" /v1/otps/email/login_or_create: post: summary: Loginorcreate operationId: api_otp_v1_otp_email_LoginOrCreate tags: - Otp description: 'Send a one-time passcode (OTP) to a User using their email. If the email is not associated with a User already, a User will be created. ### Next steps Collect the OTP which was delivered to the User. Call [Authenticate OTP](https://stytch.com/docs/api/authenticate-otp) using the OTP `code` along with the `phone_id` found in the response as the `method_id`.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_otp_email_LoginOrCreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_otp_v1_otp_email_LoginOrCreateResponse' '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: "// POST /v1/otps/email/login_or_create\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.OTPs.Email.LoginOrCreate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/otps/email/login_or_create\npackage main\n\nimport (\n\ \t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/otp/email\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\n\ )\n\nfunc main() {\n\tclient, err := stytchapi.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 := &email.LoginOrCreateParams{\n\t\ \tEmail: \"${email}\",\n\t}\n\n\tresp, err := client.OTPs.Email.LoginOrCreate(context.Background(),\ \ params)\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: "// POST /v1/otps/email/login_or_create\npackage com.example;\n\n\ import com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.otpemail.LoginOrCreateRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n LoginOrCreateRequest params =\ \ new LoginOrCreateRequest();\n params.setEmail(\"${email}\");\n\n\ \ Object result = StytchClient.getOTPs().getEmail().loginOrCreate(params);\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: "// POST /v1/otps/email/login_or_create\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.otpemail.LoginOrCreateRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.otps.email.loginOrCreate(\n \ \ LoginOrCreateRequest(\n email = \"${email}\",\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: "// POST /v1/otps/email/login_or_create\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n email: \"${email}\",\n};\n\n\ client.otps.email.loginOrCreate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->otps->email->login_or_create([\n 'email'\ \ => '${email}',\n]);" - lang: python label: Python source: "# POST /v1/otps/email/login_or_create\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.otps.email.login_or_create(\n email=\"${email}\"\ ,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/otps/email/login_or_create\nrequire 'stytch'\n\nclient\ \ = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.otps.email.login_or_create(\n email: \"${email}\"\n\ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/otps/email/login_or_create\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::otp_email::LoginOrCreateRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.otps.email.login_or_create(\n LoginOrCreateRequest{\n\ \ email: \"${email}\",\n ..Default::default()\n \ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/otps/email/login_or_create\ncurl --request POST \\\n \ \ --url https://test.stytch.com/v1/otps/email/login_or_create \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"email\":\ \ \"${email}\"\n }'" /v1/projects/metrics: get: summary: Metrics operationId: api_project_v1_Metrics tags: - Project responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_project_v1_MetricsResponse' '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/projects/metrics\nconst stytch = require('stytch');\n\n\ const client = new stytch.B2BClient({\n project_id: '${projectId}',\n \ \ secret: '${secret}',\n});\n\nconst params = {\n};\n\nclient.Project.Metrics(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/projects/metrics\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/consumer/project\"\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 := &project.MetricsParams{}\n\n\t\ resp, err := client.Project.Metrics(context.Background(), params)\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/projects/metrics\npackage com.example;\n\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.project.MetricsRequest;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ MetricsRequest params = new MetricsRequest();\n\n Object\ \ result = StytchB2BClient.getProject().metrics(params);\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/projects/metrics\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.consumer.models.project.MetricsRequest\n\nfun main()\ \ {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.project.metrics(\n MetricsRequest(),\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: "// GET /v1/projects/metrics\nconst stytch = require('stytch');\n\n\ const client = new stytch.B2BClient({\n project_id: '${projectId}',\n \ \ secret: '${secret}',\n});\n\nconst params = {\n};\n\nclient.project.metrics(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: '$response = $client->project->metrics([ ]);' - lang: python label: Python source: "# GET /v1/projects/metrics\nfrom stytch import B2BClient\n\nclient\ \ = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.project.metrics()\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/projects/metrics\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.project.metrics(\n\ \ \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/projects/metrics\nuse stytch::b2b::client::Client;\nuse\ \ stytch::consumer::project::MetricsRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.project.metrics(\n MetricsRequest{\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/projects/metrics\ncurl --request GET \\\n --url https://test.stytch.com/v1/projects/metrics\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" /v1/b2b/sso/{organization_id}: get: summary: Getconnections operationId: api_sso_v1_GetConnections tags: - Sso description: Get all SSO Connections owned by the organization. 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: 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_sso_v1_GetConnectionsResponse' '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/sso/{organization_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};\n\nconst options = {\n authorization: {\n session_token:\ \ '${sessionToken}',\n },\n};\n\nclient.SSO.GetConnections(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/b2b/sso/{organization_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/sso\"\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 := &sso.GetConnectionsParams{\n\t\t\ OrganizationID: \"${organizationId}\",\n\t}\n\n\toptions := &sso.GetConnectionsParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.SSO.GetConnections(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/sso/{organization_id}\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.models.sso.GetConnectionsRequest;\nimport com.stytch.java.b2b.models.sso.GetConnectionsRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n GetConnectionsRequest params\ \ = new GetConnectionsRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n\n GetConnectionsRequestOptions options = new GetConnectionsRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getSSO().getConnections(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/sso/{organization_id}\npackage com.example\n\nimport\ \ com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.sso.GetConnectionsRequest\n\ import com.stytch.java.b2b.models.sso.GetConnectionsRequestOptions\nimport\ \ 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.sso.getConnections(\n GetConnectionsRequest(\n\ \ organizationId = \"${organizationId}\",\n \ \ ),\n GetConnectionsRequestOptions(\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: "// GET /v1/b2b/sso/{organization_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};\n\nconst options = {\n authorization: {\n session_token:\ \ '${sessionToken}',\n },\n};\n\nclient.sso.getConnections(params, options)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->sso->get_connections([\n 'organization_id'\ \ => '${organizationId}',\n], [\n 'authorization' => ['session_token'\ \ => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# GET /v1/b2b/sso/{organization_id}\nfrom stytch import B2BClient\n\ from stytch.b2b.models.sso import GetConnectionsRequestOptions\nfrom stytch.shared.method_options\ \ import Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.sso.get_connections(\n\ \ organization_id=\"${organizationId}\",\n method_options=GetConnectionsRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/b2b/sso/{organization_id}\nrequire 'stytch'\n\nclient =\ \ StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.sso.get_connections(\n organization_id:\ \ \"${organizationId}\",\n method_options: StytchB2B::SSO::GetConnectionsRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/b2b/sso/{organization_id}\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::sso::GetConnectionsRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.sso.get_connections(\n GetConnectionsRequest{\n \ \ organization_id: \"${organizationId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# GET /v1/b2b/sso/{organization_id}\ncurl --request GET \\\n --url\ \ https://test.stytch.com/v1/b2b/sso/${organizationId} \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -H \"X-Stytch-Member-Session:\ \ ${sessionToken}\"" /v1/b2b/sso/{organization_id}/connections/{connection_id}: delete: summary: Deleteconnection operationId: api_sso_v1_DeleteConnection tags: - Sso description: Delete an existing SSO connection. parameters: - name: organization_id in: path required: true schema: type: string description: The organization ID that the SSO connection belongs to. You may also use the organization_slug or organization_external_id here as a convenience. description: The organization ID that the SSO connection belongs to. 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 SSO connection. SAML, OIDC, and External connection IDs can be provided. description: The ID of the SSO connection. SAML, OIDC, and External connection IDs can be provided. - 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_sso_v1_DeleteConnectionResponse' '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/sso/{organization_id}/connections/{connection_id}\n\ const 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: \"${samlConnectionId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.SSO.DeleteConnection(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/b2b/sso/{organization_id}/connections/{connection_id}\n\ package 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/sso\"\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 := &sso.DeleteConnectionParams{\n\t\ \tOrganizationID: \"${organizationId}\",\n\t\tConnectionID: \"${samlConnectionId}\"\ ,\n\t}\n\n\toptions := &sso.DeleteConnectionParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.SSO.DeleteConnection(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/sso/{organization_id}/connections/{connection_id}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.sso.DeleteConnectionRequest;\n\ import com.stytch.java.b2b.models.sso.DeleteConnectionRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteConnectionRequest params\ \ = new DeleteConnectionRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setConnectionId(\"${samlConnectionId}\"\ );\n\n DeleteConnectionRequestOptions options = new DeleteConnectionRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getSSO().deleteConnection(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/sso/{organization_id}/connections/{connection_id}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.sso.DeleteConnectionRequest\nimport com.stytch.java.b2b.models.sso.DeleteConnectionRequestOptions\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.sso.deleteConnection(\n \ \ DeleteConnectionRequest(\n organizationId = \"${organizationId}\"\ ,\n connectionId = \"${samlConnectionId}\",\n \ \ ),\n DeleteConnectionRequestOptions(\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/sso/{organization_id}/connections/{connection_id}\n\ const 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: \"${samlConnectionId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.sso.deleteConnection(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sso->delete_connection([\n 'organization_id'\ \ => '${organizationId}',\n 'connection_id' => '${samlConnectionId}',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# DELETE /v1/b2b/sso/{organization_id}/connections/{connection_id}\n\ from stytch import B2BClient\nfrom stytch.b2b.models.sso import DeleteConnectionRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.sso.delete_connection(\n organization_id=\"${organizationId}\"\ ,\n connection_id=\"${samlConnectionId}\",\n method_options=DeleteConnectionRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/b2b/sso/{organization_id}/connections/{connection_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.sso.delete_connection(\n\ \ organization_id: \"${organizationId}\",\n connection_id: \"${samlConnectionId}\"\ ,\n method_options: StytchB2B::SSO::DeleteConnectionRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/b2b/sso/{organization_id}/connections/{connection_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::sso::DeleteConnectionRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.sso.delete_connection(\n DeleteConnectionRequest{\n\ \ organization_id: \"${organizationId}\",\n connection_id:\ \ \"${samlConnectionId}\",\n ..Default::default()\n }\n\ \ ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# DELETE /v1/b2b/sso/{organization_id}/connections/{connection_id}\n\ curl --request DELETE \\\n --url https://test.stytch.com/v1/b2b/sso/${organizationId}/connections/${samlConnectionId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/sso/authenticate: post: summary: Authenticate operationId: api_sso_v1_Authenticate tags: - Sso description: "Authenticate a user given a token. \nThis endpoint verifies that\ \ the user completed the SSO Authentication flow by verifying that the token\ \ is valid and hasn't expired.\nProvide the `session_duration_minutes` parameter\ \ to set the lifetime of the session. \nIf the `session_duration_minutes`\ \ parameter is not specified, a Stytch session will be created with a 60 minute\ \ duration.\nTo link this authentication event to an existing Stytch session,\ \ include either the `session_token` or `session_jwt` param.\n\nIf the Member\ \ is required to complete MFA to log in to the Organization, the returned\ \ value of `member_authenticated` will be `false`, and an `intermediate_session_token`\ \ will be returned.\nThe `intermediate_session_token` can be passed into the\ \ [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms),\ \ [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp),\n\ or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover)\ \ to complete the MFA step and acquire a full member session.\nThe `session_duration_minutes`\ \ and `session_custom_claims` parameters will be ignored.\n\nIf a valid `session_token`\ \ or `session_jwt` is passed in, the Member will not be required to complete\ \ an MFA step." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_sso_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_sso_v1_AuthenticateResponse' '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: "// POST /v1/b2b/sso/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n sso_token: \"${token}\"\ ,\n};\n\nclient.SSO.Authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/sso/authenticate\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/sso\"\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 := &sso.AuthenticateParams{\n\t\t\ SSOToken: \"${token}\",\n\t}\n\n\tresp, err := client.SSO.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/b2b/sso/authenticate\npackage com.example;\n\nimport\ \ com.stytch.java.b2b.models.sso.AuthenticateRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthenticateRequest params =\ \ new AuthenticateRequest();\n params.setSSOToken(\"${token}\");\n\ \n Object result = StytchB2BClient.getSSO().authenticate(params);\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: "// POST /v1/b2b/sso/authenticate\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\n\ import com.stytch.java.b2b.models.sso.AuthenticateRequest\n\nfun main()\ \ {\n StytchB2BClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchB2BClient.sso.authenticate(\n AuthenticateRequest(\n\ \ ssoToken = \"${token}\",\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: "// POST /v1/b2b/sso/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n\ \ secret: '${secret}',\n});\n\nconst params = {\n sso_token: \"${token}\"\ ,\n};\n\nclient.sso.authenticate(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sso->authenticate([\n 'sso_token' => '${token}',\n\ ]);" - lang: python label: Python source: "# POST /v1/b2b/sso/authenticate\nfrom stytch import B2BClient\n\n\ client = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.sso.authenticate(\n sso_token=\"${token}\",\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/sso/authenticate\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.sso.authenticate(\n\ \ sso_token: \"${token}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/sso/authenticate\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::sso::AuthenticateRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.sso.authenticate(\n AuthenticateRequest{\n \ \ sso_token: \"${token}\",\n ..Default::default()\n }\n\ \ ).await;\n println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/sso/authenticate\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/b2b/sso/authenticate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"sso_token\"\ : \"${token}\"\n }'" /v1/b2b/sso/oidc/{organization_id}: post: summary: Createconnection operationId: api_sso_v1_sso_oidc_CreateConnection tags: - Sso description: Create a new OIDC Connection. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_sso_v1_sso_oidc_CreateConnectionRequest' 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: 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_sso_v1_sso_oidc_CreateConnectionResponse' '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: "// POST /v1/b2b/sso/oidc/{organization_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 display_name: \"Example OIDC connection\",\n};\n\ \nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.SSO.OIDC.CreateConnection(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/sso/oidc/{organization_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/sso/oidc\"\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 := &oidc.CreateConnectionParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tDisplayName: \"Example\ \ OIDC connection\",\n\t}\n\n\toptions := &oidc.CreateConnectionParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.SSO.OIDC.CreateConnection(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: "// POST /v1/b2b/sso/oidc/{organization_id}\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.ssooidc.CreateConnectionRequest;\nimport\ \ com.stytch.java.b2b.models.ssooidc.CreateConnectionRequestOptions;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n CreateConnectionRequest params\ \ = new CreateConnectionRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setDisplayName(\"Example OIDC connection\"\ );\n\n CreateConnectionRequestOptions options = new CreateConnectionRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getSSO().getOIDC().createConnection(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: "// POST /v1/b2b/sso/oidc/{organization_id}\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.ssooidc.CreateConnectionRequest\n\ import com.stytch.java.b2b.models.ssooidc.CreateConnectionRequestOptions\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.sso.oidc.createConnection(\n \ \ CreateConnectionRequest(\n organizationId = \"\ ${organizationId}\",\n displayName = \"Example OIDC connection\"\ ,\n ),\n CreateConnectionRequestOptions(\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: "// POST /v1/b2b/sso/oidc/{organization_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 display_name: \"Example OIDC connection\",\n};\n\ \nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.sso.oidc.createConnection(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sso->oidc->create_connection([\n 'organization_id'\ \ => '${organizationId}',\n 'display_name' => 'Example OIDC connection',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# POST /v1/b2b/sso/oidc/{organization_id}\nfrom stytch import B2BClient\n\ from stytch.b2b.models.sso_oidc import CreateConnectionRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.sso.oidc.create_connection(\n organization_id=\"${organizationId}\"\ ,\n display_name=\"Example OIDC connection\",\n method_options=CreateConnectionRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/sso/oidc/{organization_id}\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.sso.oidc.create_connection(\n organization_id:\ \ \"${organizationId}\",\n display_name: \"Example OIDC connection\",\n\ \ method_options: StytchB2B::SSO::OIDC::CreateConnectionRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/sso/oidc/{organization_id}\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::sso_oidc::CreateConnectionRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.sso.oidc.create_connection(\n CreateConnectionRequest{\n\ \ organization_id: \"${organizationId}\",\n display_name:\ \ Some(String::from(\"Example OIDC connection\")),\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/sso/oidc/{organization_id}\ncurl --request POST \\\ \n --url https://test.stytch.com/v1/b2b/sso/oidc/${organizationId} \\\n\ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"display_name\": \"Example OIDC connection\"\n }'" /v1/b2b/sso/oidc/{organization_id}/connections/{connection_id}: put: summary: Updateconnection operationId: api_sso_v1_sso_oidc_UpdateConnection tags: - Sso description: "Updates an existing OIDC connection.\n\nWhen the value of `issuer`\ \ changes, Stytch will attempt to retrieve the [OpenID Provider Metadata](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata)\ \ document found at `$/.well-known/openid-configuration`.\nIf the metadata\ \ document can be retrieved successfully, Stytch will use it to infer the\ \ values of `authorization_url`, `token_url`, `jwks_url`, and `userinfo_url`.\n\ The `client_id` and `client_secret` values cannot be inferred from the metadata\ \ document, and *must* be passed in explicitly.\n\nIf the metadata document\ \ cannot be retrieved, Stytch will still update the connection using values\ \ from the request body.\n\nIf the metadata document can be retrieved, and\ \ values are passed in the request body, the explicit values passed in from\ \ the request body will take precedence over the values inferred from the\ \ metadata document. \n\nNote that a newly created connection will not become\ \ active until all of the following fields are provided:\n* `issuer`\n* `client_id`\n\ * `client_secret`\n* `authorization_url`\n* `token_url`\n* `userinfo_url`\n\ * `jwks_url`" requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_sso_v1_sso_oidc_UpdateConnectionRequest' 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: Globally unique UUID that identifies a specific SSO `connection_id` for a Member. description: Globally unique UUID that identifies a specific SSO `connection_id` for a Member. - 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_sso_v1_sso_oidc_UpdateConnectionResponse' '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/sso/oidc/{organization_id}/connections/{connection_id}\n\ const 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: \"${oidcConnectionId}\"\ ,\n client_id: \"${exampleClientID}\",\n client_secret: \"${token}\",\n\ };\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.SSO.OIDC.UpdateConnection(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// PUT /v1/b2b/sso/oidc/{organization_id}/connections/{connection_id}\n\ package 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/sso/oidc\"\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 := &oidc.UpdateConnectionParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tConnectionID: \"${oidcConnectionId}\"\ ,\n\t\tClientID: \"${exampleClientID}\",\n\t\tClientSecret: \"${token}\"\ ,\n\t}\n\n\toptions := &oidc.UpdateConnectionParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.SSO.OIDC.UpdateConnection(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/sso/oidc/{organization_id}/connections/{connection_id}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.ssooidc.UpdateConnectionRequest;\n\ import com.stytch.java.b2b.models.ssooidc.UpdateConnectionRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n UpdateConnectionRequest params\ \ = new UpdateConnectionRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setConnectionId(\"${oidcConnectionId}\"\ );\n params.setClientId(\"${exampleClientID}\");\n params.setClientSecret(\"\ ${token}\");\n\n UpdateConnectionRequestOptions options = new UpdateConnectionRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getSSO().getOIDC().updateConnection(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/sso/oidc/{organization_id}/connections/{connection_id}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.ssooidc.UpdateConnectionRequest\nimport com.stytch.java.b2b.models.ssooidc.UpdateConnectionRequestOptions\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.sso.oidc.updateConnection(\n \ \ UpdateConnectionRequest(\n organizationId = \"\ ${organizationId}\",\n connectionId = \"${oidcConnectionId}\"\ ,\n clientId = \"${exampleClientID}\",\n \ \ clientSecret = \"${token}\",\n ),\n \ \ UpdateConnectionRequestOptions(\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/sso/oidc/{organization_id}/connections/{connection_id}\n\ const 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: \"${oidcConnectionId}\"\ ,\n client_id: \"${exampleClientID}\",\n client_secret: \"${token}\",\n\ };\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.sso.oidc.updateConnection(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sso->oidc->update_connection([\n 'organization_id'\ \ => '${organizationId}',\n 'connection_id' => '${oidcConnectionId}',\n\ \ 'client_id' => '${exampleClientID}',\n 'client_secret' => '${token}',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# PUT /v1/b2b/sso/oidc/{organization_id}/connections/{connection_id}\n\ from stytch import B2BClient\nfrom stytch.b2b.models.sso_oidc import UpdateConnectionRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.sso.oidc.update_connection(\n organization_id=\"${organizationId}\"\ ,\n connection_id=\"${oidcConnectionId}\",\n client_id=\"${exampleClientID}\"\ ,\n client_secret=\"${token}\",\n method_options=UpdateConnectionRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# PUT /v1/b2b/sso/oidc/{organization_id}/connections/{connection_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.sso.oidc.update_connection(\n\ \ organization_id: \"${organizationId}\",\n connection_id: \"${oidcConnectionId}\"\ ,\n client_id: \"${exampleClientID}\",\n client_secret: \"${token}\",\n\ \ method_options: StytchB2B::SSO::OIDC::UpdateConnectionRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// PUT /v1/b2b/sso/oidc/{organization_id}/connections/{connection_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::sso_oidc::UpdateConnectionRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.sso.oidc.update_connection(\n \ \ UpdateConnectionRequest{\n organization_id: \"${organizationId}\"\ ,\n connection_id: \"${oidcConnectionId}\",\n client_id:\ \ Some(String::from(\"${exampleClientID}\")),\n client_secret:\ \ Some(String::from(\"${token}\")),\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# PUT /v1/b2b/sso/oidc/{organization_id}/connections/{connection_id}\n\ curl --request PUT \\\n --url https://test.stytch.com/v1/b2b/sso/oidc/${organizationId}/connections/${oidcConnectionId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"client_id\": \"${exampleClientID}\",\n \"client_secret\": \"${token}\"\ \n }'" /v1/b2b/sso/saml/{organization_id}: post: summary: Createconnection operationId: api_sso_v1_sso_saml_CreateConnection tags: - Sso description: Create a new SAML Connection. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_sso_v1_sso_saml_CreateConnectionRequest' 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: 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_sso_v1_sso_saml_CreateConnectionResponse' '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: "// POST /v1/b2b/sso/saml/{organization_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 display_name: \"Example SAML connection\",\n};\n\ \nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.SSO.SAML.CreateConnection(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/b2b/sso/saml/{organization_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/sso/saml\"\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 := &saml.CreateConnectionParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tDisplayName: \"Example\ \ SAML connection\",\n\t}\n\n\toptions := &saml.CreateConnectionParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.SSO.SAML.CreateConnection(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: "// POST /v1/b2b/sso/saml/{organization_id}\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.ssosaml.CreateConnectionRequest;\nimport\ \ com.stytch.java.b2b.models.ssosaml.CreateConnectionRequestOptions;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n CreateConnectionRequest params\ \ = new CreateConnectionRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setDisplayName(\"Example SAML connection\"\ );\n\n CreateConnectionRequestOptions options = new CreateConnectionRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getSSO().getSAML().createConnection(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: "// POST /v1/b2b/sso/saml/{organization_id}\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.ssosaml.CreateConnectionRequest\n\ import com.stytch.java.b2b.models.ssosaml.CreateConnectionRequestOptions\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.sso.saml.createConnection(\n \ \ CreateConnectionRequest(\n organizationId = \"\ ${organizationId}\",\n displayName = \"Example SAML connection\"\ ,\n ),\n CreateConnectionRequestOptions(\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: "// POST /v1/b2b/sso/saml/{organization_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 display_name: \"Example SAML connection\",\n};\n\ \nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.sso.saml.createConnection(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sso->saml->create_connection([\n 'organization_id'\ \ => '${organizationId}',\n 'display_name' => 'Example SAML connection',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# POST /v1/b2b/sso/saml/{organization_id}\nfrom stytch import B2BClient\n\ from stytch.b2b.models.sso_saml import CreateConnectionRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.sso.saml.create_connection(\n organization_id=\"${organizationId}\"\ ,\n display_name=\"Example SAML connection\",\n method_options=CreateConnectionRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/sso/saml/{organization_id}\nrequire 'stytch'\n\nclient\ \ = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"\ ${secret}\"\n)\n\nresp = client.sso.saml.create_connection(\n organization_id:\ \ \"${organizationId}\",\n display_name: \"Example SAML connection\",\n\ \ method_options: StytchB2B::SSO::SAML::CreateConnectionRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/sso/saml/{organization_id}\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::sso_saml::CreateConnectionRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.sso.saml.create_connection(\n CreateConnectionRequest{\n\ \ organization_id: \"${organizationId}\",\n display_name:\ \ Some(String::from(\"Example SAML connection\")),\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/b2b/sso/saml/{organization_id}\ncurl --request POST \\\ \n --url https://test.stytch.com/v1/b2b/sso/saml/${organizationId} \\\n\ \ -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"display_name\": \"Example SAML connection\"\n }'" /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}: put: summary: Updateconnection operationId: api_sso_v1_sso_saml_UpdateConnection tags: - Sso description: 'Updates an existing SAML connection. Note that a newly created connection will not become active until all of the following are provided: * `idp_sso_url` * `attribute_mapping` * `idp_entity_id` * `x509_certificate`' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_sso_v1_sso_saml_UpdateConnectionRequest' 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: Globally unique UUID that identifies a specific SSO `connection_id` for a Member. description: Globally unique UUID that identifies a specific SSO `connection_id` for a Member. - 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_sso_v1_sso_saml_UpdateConnectionResponse' '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/sso/saml/{organization_id}/connections/{connection_id}\n\ const 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: \"${samlConnectionId}\"\ ,\n x509_certificate: \"${exampleCertificate}\",\n idp_sso_url: \"${exampleIdpSsoUrl}\"\ ,\n signing_private_key: \"${examplePrivateKey}\",\n saml_encryption_private_key:\ \ \"${examplePrivateKey}\",\n};\n\nconst options = {\n authorization: {\n\ \ session_token: '${sessionToken}',\n },\n};\n\nclient.SSO.SAML.UpdateConnection(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// PUT /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}\n\ package 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/sso/saml\"\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 := &saml.UpdateConnectionParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tConnectionID:\ \ \"${samlConnectionId}\",\n\t\tX509Certificate: \"\ ${exampleCertificate}\",\n\t\tIDPSSOURL: \"${exampleIdpSsoUrl}\"\ ,\n\t\tSigningPrivateKey: \"${examplePrivateKey}\",\n\t\tSAMLEncryptionPrivateKey:\ \ \"${examplePrivateKey}\",\n\t}\n\n\toptions := &saml.UpdateConnectionParamsOptions{\n\ \t\tAuthorization: methodoptions.Authorization{\n\t\t\tSessionToken: \"\ ${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err := client.SSO.SAML.UpdateConnection(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/sso/saml/{organization_id}/connections/{connection_id}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.ssosaml.UpdateConnectionRequest;\n\ import com.stytch.java.b2b.models.ssosaml.UpdateConnectionRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n UpdateConnectionRequest params\ \ = new UpdateConnectionRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setConnectionId(\"${samlConnectionId}\"\ );\n params.setX509Certificate(\"${exampleCertificate}\");\n \ \ params.setIDPSSOURL(\"${exampleIdpSsoUrl}\");\n params.setSigningPrivateKey(\"\ ${examplePrivateKey}\");\n params.setSAMLEncryptionPrivateKey(\"\ ${examplePrivateKey}\");\n\n UpdateConnectionRequestOptions options\ \ = new UpdateConnectionRequestOptions();\n Authorization authorization\ \ = new Authorization();\n authorization.setSessionToken(\"${sessionToken}\"\ );\n options.setAuthorization(authorization);\n\n Object result\ \ = StytchB2BClient.getSSO().getSAML().updateConnection(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/sso/saml/{organization_id}/connections/{connection_id}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.ssosaml.UpdateConnectionRequest\nimport com.stytch.java.b2b.models.ssosaml.UpdateConnectionRequestOptions\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.sso.saml.updateConnection(\n \ \ UpdateConnectionRequest(\n organizationId = \"\ ${organizationId}\",\n connectionId = \"${samlConnectionId}\"\ ,\n x509Certificate = \"${exampleCertificate}\",\n \ \ idpSSOURL = \"${exampleIdpSsoUrl}\",\n \ \ signingPrivateKey = \"${examplePrivateKey}\",\n \ \ samlEncryptionPrivateKey = \"${examplePrivateKey}\",\n \ \ ),\n UpdateConnectionRequestOptions(\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/sso/saml/{organization_id}/connections/{connection_id}\n\ const 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: \"${samlConnectionId}\"\ ,\n x509_certificate: \"${exampleCertificate}\",\n idp_sso_url: \"${exampleIdpSsoUrl}\"\ ,\n signing_private_key: \"${examplePrivateKey}\",\n saml_encryption_private_key:\ \ \"${examplePrivateKey}\",\n};\n\nconst options = {\n authorization: {\n\ \ session_token: '${sessionToken}',\n },\n};\n\nclient.sso.saml.updateConnection(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->sso->saml->update_connection([\n 'organization_id'\ \ => '${organizationId}',\n 'connection_id' => '${samlConnectionId}',\n\ \ 'x509_certificate' => '${exampleCertificate}',\n 'idp_sso_url' =>\ \ '${exampleIdpSsoUrl}',\n 'signing_private_key' => '${examplePrivateKey}',\n\ \ 'saml_encryption_private_key' => '${examplePrivateKey}',\n], [\n \ \ 'authorization' => ['session_token' => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# PUT /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}\n\ from stytch import B2BClient\nfrom stytch.b2b.models.sso_saml import UpdateConnectionRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.sso.saml.update_connection(\n organization_id=\"${organizationId}\"\ ,\n connection_id=\"${samlConnectionId}\",\n x509_certificate=\"${exampleCertificate}\"\ ,\n idp_sso_url=\"${exampleIdpSsoUrl}\",\n signing_private_key=\"\ ${examplePrivateKey}\",\n saml_encryption_private_key=\"${examplePrivateKey}\"\ ,\n method_options=UpdateConnectionRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# PUT /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.sso.saml.update_connection(\n\ \ organization_id: \"${organizationId}\",\n connection_id: \"${samlConnectionId}\"\ ,\n x509_certificate: \"${exampleCertificate}\",\n idp_sso_url: \"${exampleIdpSsoUrl}\"\ ,\n signing_private_key: \"${examplePrivateKey}\",\n saml_encryption_private_key:\ \ \"${examplePrivateKey}\",\n method_options: StytchB2B::SSO::SAML::UpdateConnectionRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// PUT /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::sso_saml::UpdateConnectionRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.sso.saml.update_connection(\n \ \ UpdateConnectionRequest{\n organization_id: \"${organizationId}\"\ ,\n connection_id: \"${samlConnectionId}\",\n x509_certificate:\ \ Some(String::from(\"${exampleCertificate}\")),\n idp_sso_url:\ \ Some(String::from(\"${exampleIdpSsoUrl}\")),\n signing_private_key:\ \ Some(String::from(\"${examplePrivateKey}\")),\n saml_encryption_private_key:\ \ Some(String::from(\"${examplePrivateKey}\")),\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# PUT /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}\n\ curl --request PUT \\\n --url https://test.stytch.com/v1/b2b/sso/saml/${organizationId}/connections/${samlConnectionId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"x509_certificate\": \"${exampleCertificate}\",\n \"idp_sso_url\"\ : \"${exampleIdpSsoUrl}\",\n \"signing_private_key\": \"${examplePrivateKey}\"\ ,\n \"saml_encryption_private_key\": \"${examplePrivateKey}\"\n }'" /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/url: put: summary: Updatebyurl operationId: api_sso_v1_sso_saml_UpdateByURL tags: - Sso description: 'Used to update an existing SAML connection using an IDP metadata URL. A newly created connection will not become active until all the following are provided: * `idp_sso_url` * `idp_entity_id` * `x509_certificate` * `attribute_mapping` (must be supplied using [Update SAML Connection](update-saml-connection))' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_sso_v1_sso_saml_UpdateByURLRequest' 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: Globally unique UUID that identifies a specific SSO `connection_id` for a Member. description: Globally unique UUID that identifies a specific SSO `connection_id` for a Member. - 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_sso_v1_sso_saml_UpdateByURLResponse' '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/sso/saml/{organization_id}/connections/{connection_id}/url\n\ const 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: \"${samlConnectionId}\"\ ,\n metadata_url: \"${exampleIdpMetadataUrl}\",\n};\n\nconst options =\ \ {\n authorization: {\n session_token: '${sessionToken}',\n },\n};\n\ \nclient.SSO.SAML.UpdateByURL(params, options)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// PUT /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/url\n\ package 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/sso/saml\"\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 := &saml.UpdateByURLParams{\n\t\t\ OrganizationID: \"${organizationId}\",\n\t\tConnectionID: \"${samlConnectionId}\"\ ,\n\t\tMetadataURL: \"${exampleIdpMetadataUrl}\",\n\t}\n\n\toptions :=\ \ &saml.UpdateByURLParamsOptions{\n\t\tAuthorization: methodoptions.Authorization{\n\ \t\t\tSessionToken: \"${sessionToken}\",\n\t\t},\n\t}\n\n\tresp, err :=\ \ client.SSO.SAML.UpdateByURL(context.Background(), params, options)\n\t\ if 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/sso/saml/{organization_id}/connections/{connection_id}/url\n\ package com.example;\n\nimport com.stytch.java.b2b.models.ssosaml.UpdateByURLRequest;\n\ import com.stytch.java.b2b.models.ssosaml.UpdateByURLRequestOptions;\nimport\ \ com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n UpdateByURLRequest params = new\ \ UpdateByURLRequest();\n params.setOrganizationId(\"${organizationId}\"\ );\n params.setConnectionId(\"${samlConnectionId}\");\n params.setMetadataURL(\"\ ${exampleIdpMetadataUrl}\");\n\n UpdateByURLRequestOptions options\ \ = new UpdateByURLRequestOptions();\n Authorization authorization\ \ = new Authorization();\n authorization.setSessionToken(\"${sessionToken}\"\ );\n options.setAuthorization(authorization);\n\n Object result\ \ = StytchB2BClient.getSSO().getSAML().updateByURL(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/sso/saml/{organization_id}/connections/{connection_id}/url\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.ssosaml.UpdateByURLRequest\nimport com.stytch.java.b2b.models.ssosaml.UpdateByURLRequestOptions\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.sso.saml.updateByURL(\n \ \ UpdateByURLRequest(\n organizationId = \"${organizationId}\"\ ,\n connectionId = \"${samlConnectionId}\",\n \ \ metadataURL = \"${exampleIdpMetadataUrl}\",\n \ \ ),\n UpdateByURLRequestOptions(\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/sso/saml/{organization_id}/connections/{connection_id}/url\n\ const 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: \"${samlConnectionId}\"\ ,\n metadata_url: \"${exampleIdpMetadataUrl}\",\n};\n\nconst options =\ \ {\n authorization: {\n session_token: '${sessionToken}',\n },\n};\n\ \nclient.sso.saml.updateByURL(params, options)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sso->saml->update_by_url([\n 'organization_id'\ \ => '${organizationId}',\n 'connection_id' => '${samlConnectionId}',\n\ \ 'metadata_url' => '${exampleIdpMetadataUrl}',\n], [\n 'authorization'\ \ => ['session_token' => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# PUT /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/url\n\ from stytch import B2BClient\nfrom stytch.b2b.models.sso_saml import UpdateByURLRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.sso.saml.update_by_url(\n organization_id=\"${organizationId}\"\ ,\n connection_id=\"${samlConnectionId}\",\n metadata_url=\"${exampleIdpMetadataUrl}\"\ ,\n method_options=UpdateByURLRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# PUT /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/url\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.sso.saml.update_by_url(\n\ \ organization_id: \"${organizationId}\",\n connection_id: \"${samlConnectionId}\"\ ,\n metadata_url: \"${exampleIdpMetadataUrl}\",\n method_options: StytchB2B::SSO::SAML::UpdateByURLRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// PUT /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/url\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::sso_saml::UpdateByURLRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.sso.saml.update_by_url(\n UpdateByURLRequest{\n\ \ organization_id: \"${organizationId}\",\n connection_id:\ \ \"${samlConnectionId}\",\n metadata_url: \"${exampleIdpMetadataUrl}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# PUT /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/url\n\ curl --request PUT \\\n --url https://test.stytch.com/v1/b2b/sso/saml/${organizationId}/connections/${samlConnectionId}/url\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"metadata_url\": \"${exampleIdpMetadataUrl}\"\n }'" /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/verification_certificates/{certificate_id}: delete: summary: Deleteverificationcertificate operationId: api_sso_v1_sso_saml_DeleteVerificationCertificate tags: - Sso description: 'Delete a SAML verification certificate. You may need to do this when rotating certificates from your IdP, since Stytch allows a maximum of 5 certificates per connection. There must always be at least one certificate per active connection.' parameters: - name: organization_id in: path required: true schema: type: string description: The organization ID that the SAML connection belongs to. You may also use the organization_slug or organization_external_id here as a convenience. description: The organization ID that the SAML connection belongs to. 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 SAML connection. description: The ID of the SAML connection. - name: certificate_id in: path required: true schema: type: string description: The ID of the certificate to be deleted. description: The ID of the certificate to be deleted. - 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_sso_v1_sso_saml_DeleteVerificationCertificateResponse' '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/sso/saml/{organization_id}/connections/{connection_id}/verification_certificates/{certificate_id}\n\ const 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: \"${samlConnectionId}\"\ ,\n certificate_id: \"${verificationCertificateId}\",\n};\n\nconst options\ \ = {\n authorization: {\n session_token: '${sessionToken}',\n },\n\ };\n\nclient.SSO.SAML.DeleteVerificationCertificate(params, options)\n \ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// DELETE /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/verification_certificates/{certificate_id}\n\ package 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/sso/saml\"\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 := &saml.DeleteVerificationCertificateParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tConnectionID: \"${samlConnectionId}\"\ ,\n\t\tCertificateID: \"${verificationCertificateId}\",\n\t}\n\n\toptions\ \ := &saml.DeleteVerificationCertificateParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.SSO.SAML.DeleteVerificationCertificate(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/sso/saml/{organization_id}/connections/{connection_id}/verification_certificates/{certificate_id}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.ssosaml.DeleteVerificationCertificateRequest;\n\ import com.stytch.java.b2b.models.ssosaml.DeleteVerificationCertificateRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteVerificationCertificateRequest\ \ params = new DeleteVerificationCertificateRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setConnectionId(\"${samlConnectionId}\"\ );\n params.setCertificateId(\"${verificationCertificateId}\");\n\ \n DeleteVerificationCertificateRequestOptions options = new DeleteVerificationCertificateRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getSSO().getSAML().deleteVerificationCertificate(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/sso/saml/{organization_id}/connections/{connection_id}/verification_certificates/{certificate_id}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.ssosaml.DeleteVerificationCertificateRequest\n\ import com.stytch.java.b2b.models.ssosaml.DeleteVerificationCertificateRequestOptions\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.sso.saml.deleteVerificationCertificate(\n\ \ DeleteVerificationCertificateRequest(\n \ \ organizationId = \"${organizationId}\",\n connectionId\ \ = \"${samlConnectionId}\",\n certificateId = \"${verificationCertificateId}\"\ ,\n ),\n DeleteVerificationCertificateRequestOptions(\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/sso/saml/{organization_id}/connections/{connection_id}/verification_certificates/{certificate_id}\n\ const 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: \"${samlConnectionId}\"\ ,\n certificate_id: \"${verificationCertificateId}\",\n};\n\nconst options\ \ = {\n authorization: {\n session_token: '${sessionToken}',\n },\n\ };\n\nclient.sso.saml.deleteVerificationCertificate(params, options)\n \ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->sso->saml->delete_verification_certificate([\n\ \ 'organization_id' => '${organizationId}',\n 'connection_id' => '${samlConnectionId}',\n\ \ 'certificate_id' => '${verificationCertificateId}',\n], [\n \ \ 'authorization' => ['session_token' => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# DELETE /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/verification_certificates/{certificate_id}\n\ from stytch import B2BClient\nfrom stytch.b2b.models.sso_saml import DeleteVerificationCertificateRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.sso.saml.delete_verification_certificate(\n organization_id=\"\ ${organizationId}\",\n connection_id=\"${samlConnectionId}\",\n certificate_id=\"\ ${verificationCertificateId}\",\n method_options=DeleteVerificationCertificateRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/verification_certificates/{certificate_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.sso.saml.delete_verification_certificate(\n\ \ organization_id: \"${organizationId}\",\n connection_id: \"${samlConnectionId}\"\ ,\n certificate_id: \"${verificationCertificateId}\",\n method_options:\ \ StytchB2B::SSO::SAML::DeleteVerificationCertificateRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/verification_certificates/{certificate_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::sso_saml::DeleteVerificationCertificateRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.sso.saml.delete_verification_certificate(\n\ \ DeleteVerificationCertificateRequest{\n organization_id:\ \ \"${organizationId}\",\n connection_id: \"${samlConnectionId}\"\ ,\n certificate_id: \"${verificationCertificateId}\",\n \ \ ..Default::default()\n }\n ).await;\n println!(\"The\ \ response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# DELETE /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/verification_certificates/{certificate_id}\n\ curl --request DELETE \\\n --url https://test.stytch.com/v1/b2b/sso/saml/${organizationId}/connections/${samlConnectionId}/verification_certificates/${verificationCertificateId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/encryption_private_keys/{private_key_id}: delete: summary: Deleteencryptionprivatekey operationId: api_sso_v1_sso_saml_DeleteEncryptionPrivateKey tags: - Sso description: Delete a SAML encryption private key. 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: Globally unique UUID that identifies a specific SSO `connection_id` for a Member. description: Globally unique UUID that identifies a specific SSO `connection_id` for a Member. - name: private_key_id in: path required: true schema: type: string description: The ID of the encryption private key to be deleted. description: The ID of the encryption private key to be deleted. - 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_sso_v1_sso_saml_DeleteEncryptionPrivateKeyResponse' '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/sso/saml/{organization_id}/connections/{connection_id}/encryption_private_keys/{private_key_id}\n\ const 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: \"${samlConnectionId}\"\ ,\n private_key_id: \"${encryptionPrivateKeyId}\",\n};\n\nconst options\ \ = {\n authorization: {\n session_token: '${sessionToken}',\n },\n\ };\n\nclient.SSO.SAML.DeleteEncryptionPrivateKey(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// DELETE /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/encryption_private_keys/{private_key_id}\n\ package 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/sso/saml\"\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 := &saml.DeleteEncryptionPrivateKeyParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tConnectionID: \"${samlConnectionId}\"\ ,\n\t\tPrivateKeyID: \"${encryptionPrivateKeyId}\",\n\t}\n\n\toptions\ \ := &saml.DeleteEncryptionPrivateKeyParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.SSO.SAML.DeleteEncryptionPrivateKey(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/sso/saml/{organization_id}/connections/{connection_id}/encryption_private_keys/{private_key_id}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.ssosaml.DeleteEncryptionPrivateKeyRequest;\n\ import com.stytch.java.b2b.models.ssosaml.DeleteEncryptionPrivateKeyRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n DeleteEncryptionPrivateKeyRequest\ \ params = new DeleteEncryptionPrivateKeyRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setConnectionId(\"${samlConnectionId}\"\ );\n params.setPrivateKeyId(\"${encryptionPrivateKeyId}\");\n\n \ \ DeleteEncryptionPrivateKeyRequestOptions options = new DeleteEncryptionPrivateKeyRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getSSO().getSAML().deleteEncryptionPrivateKey(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/sso/saml/{organization_id}/connections/{connection_id}/encryption_private_keys/{private_key_id}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.ssosaml.DeleteEncryptionPrivateKeyRequest\n\ import com.stytch.java.b2b.models.ssosaml.DeleteEncryptionPrivateKeyRequestOptions\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.sso.saml.deleteEncryptionPrivateKey(\n\ \ DeleteEncryptionPrivateKeyRequest(\n \ \ organizationId = \"${organizationId}\",\n connectionId\ \ = \"${samlConnectionId}\",\n privateKeyId = \"${encryptionPrivateKeyId}\"\ ,\n ),\n DeleteEncryptionPrivateKeyRequestOptions(\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/sso/saml/{organization_id}/connections/{connection_id}/encryption_private_keys/{private_key_id}\n\ const 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: \"${samlConnectionId}\"\ ,\n private_key_id: \"${encryptionPrivateKeyId}\",\n};\n\nconst options\ \ = {\n authorization: {\n session_token: '${sessionToken}',\n },\n\ };\n\nclient.sso.saml.deleteEncryptionPrivateKey(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sso->saml->delete_encryption_private_key([\n\ \ 'organization_id' => '${organizationId}',\n 'connection_id' => '${samlConnectionId}',\n\ \ 'private_key_id' => '${encryptionPrivateKeyId}',\n], [\n 'authorization'\ \ => ['session_token' => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# DELETE /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/encryption_private_keys/{private_key_id}\n\ from stytch import B2BClient\nfrom stytch.b2b.models.sso_saml import DeleteEncryptionPrivateKeyRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.sso.saml.delete_encryption_private_key(\n organization_id=\"\ ${organizationId}\",\n connection_id=\"${samlConnectionId}\",\n private_key_id=\"\ ${encryptionPrivateKeyId}\",\n method_options=DeleteEncryptionPrivateKeyRequestOptions(\n\ \ authorization=Authorization(\n session_token=\"${sessionToken}\"\ ,\n ),\n ),\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# DELETE /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/encryption_private_keys/{private_key_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.sso.saml.delete_encryption_private_key(\n\ \ organization_id: \"${organizationId}\",\n connection_id: \"${samlConnectionId}\"\ ,\n private_key_id: \"${encryptionPrivateKeyId}\",\n method_options: StytchB2B::SSO::SAML::DeleteEncryptionPrivateKeyRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// DELETE /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/encryption_private_keys/{private_key_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::sso_saml::DeleteEncryptionPrivateKeyRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.sso.saml.delete_encryption_private_key(\n\ \ DeleteEncryptionPrivateKeyRequest{\n organization_id:\ \ \"${organizationId}\",\n connection_id: \"${samlConnectionId}\"\ ,\n private_key_id: \"${encryptionPrivateKeyId}\",\n \ \ ..Default::default()\n }\n ).await;\n println!(\"The response\ \ is {:?}\", resp);\n}" - lang: bash label: cURL source: "# DELETE /v1/b2b/sso/saml/{organization_id}/connections/{connection_id}/encryption_private_keys/{private_key_id}\n\ curl --request DELETE \\\n --url https://test.stytch.com/v1/b2b/sso/saml/${organizationId}/connections/${samlConnectionId}/encryption_private_keys/${encryptionPrivateKeyId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/b2b/sso/external/{organization_id}: post: summary: Createconnection operationId: api_sso_v1_sso_external_CreateConnection tags: - Sso description: Create a new External SSO Connection. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_sso_v1_sso_external_CreateConnectionRequest' 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: 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_sso_v1_sso_external_CreateConnectionResponse' '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: "// POST /v1/b2b/sso/external/{organization_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 external_organization_id: \"${organizationId}\"\ ,\n external_connection_id: \"${samlConnectionId}\",\n display_name: \"\ Example External connection\",\n};\n\nconst options = {\n authorization:\ \ {\n session_token: '${sessionToken}',\n },\n};\n\nclient.SSO.External.CreateConnection(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/b2b/sso/external/{organization_id}\npackage main\n\n\ import (\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/sso/external\"\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 := &external.CreateConnectionParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tExternalOrganizationID:\ \ \"${organizationId}\",\n\t\tExternalConnectionID: \"${samlConnectionId}\"\ ,\n\t\tDisplayName: \"Example External connection\",\n\t}\n\n\ \toptions := &external.CreateConnectionParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.SSO.External.CreateConnection(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: "// POST /v1/b2b/sso/external/{organization_id}\npackage com.example;\n\ \nimport com.stytch.java.b2b.models.ssoexternal.CreateConnectionRequest;\n\ import com.stytch.java.b2b.models.ssoexternal.CreateConnectionRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n CreateConnectionRequest params\ \ = new CreateConnectionRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setExternalOrganizationId(\"${organizationId}\"\ );\n params.setExternalConnectionId(\"${samlConnectionId}\");\n \ \ params.setDisplayName(\"Example External connection\");\n\n \ \ CreateConnectionRequestOptions options = new CreateConnectionRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getSSO().getExternal().createConnection(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: "// POST /v1/b2b/sso/external/{organization_id}\npackage com.example\n\ \nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.ssoexternal.CreateConnectionRequest\n\ import com.stytch.java.b2b.models.ssoexternal.CreateConnectionRequestOptions\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.sso.external.createConnection(\n \ \ CreateConnectionRequest(\n organizationId\ \ = \"${organizationId}\",\n externalOrganizationId =\ \ \"${organizationId}\",\n externalConnectionId = \"\ ${samlConnectionId}\",\n displayName = \"Example External\ \ connection\",\n ),\n CreateConnectionRequestOptions(\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: "// POST /v1/b2b/sso/external/{organization_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 external_organization_id: \"${organizationId}\"\ ,\n external_connection_id: \"${samlConnectionId}\",\n display_name: \"\ Example External connection\",\n};\n\nconst options = {\n authorization:\ \ {\n session_token: '${sessionToken}',\n },\n};\n\nclient.sso.external.createConnection(params,\ \ options)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->sso->external->create_connection([\n 'organization_id'\ \ => '${organizationId}',\n 'external_organization_id' => '${organizationId}',\n\ \ 'external_connection_id' => '${samlConnectionId}',\n 'display_name'\ \ => 'Example External connection',\n], [\n 'authorization' => ['session_token'\ \ => '${sessionToken}'],\n\n]);" - lang: python label: Python source: "# POST /v1/b2b/sso/external/{organization_id}\nfrom stytch import\ \ B2BClient\nfrom stytch.b2b.models.sso_external import CreateConnectionRequestOptions\n\ from stytch.shared.method_options import Authorization\n\nclient = B2BClient(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.sso.external.create_connection(\n organization_id=\"${organizationId}\"\ ,\n external_organization_id=\"${organizationId}\",\n external_connection_id=\"\ ${samlConnectionId}\",\n display_name=\"Example External connection\"\ ,\n method_options=CreateConnectionRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/b2b/sso/external/{organization_id}\nrequire 'stytch'\n\ \nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.sso.external.create_connection(\n organization_id:\ \ \"${organizationId}\",\n external_organization_id: \"${organizationId}\"\ ,\n external_connection_id: \"${samlConnectionId}\",\n display_name: \"\ Example External connection\",\n method_options: StytchB2B::SSO::External::CreateConnectionRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/b2b/sso/external/{organization_id}\nuse stytch::b2b::client::Client;\n\ use stytch::b2b::sso_external::CreateConnectionRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.sso.external.create_connection(\n CreateConnectionRequest{\n\ \ organization_id: \"${organizationId}\",\n external_organization_id:\ \ \"${organizationId}\",\n external_connection_id: \"${samlConnectionId}\"\ ,\n display_name: Some(String::from(\"Example External connection\"\ )),\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/b2b/sso/external/{organization_id}\ncurl --request POST\ \ \\\n --url https://test.stytch.com/v1/b2b/sso/external/${organizationId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\" \\\n -d '{\n \ \ \"external_organization_id\": \"${organizationId}\",\n \"external_connection_id\"\ : \"${samlConnectionId}\",\n \"display_name\": \"Example External connection\"\ \n }'" /v1/b2b/sso/external/{organization_id}/connections/{connection_id}: put: summary: Updateconnection operationId: api_sso_v1_sso_external_UpdateConnection tags: - Sso description: Updates an existing External SSO connection. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_sso_v1_sso_external_UpdateConnectionRequest' 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: Globally unique UUID that identifies a specific External SSO Connection. description: Globally unique UUID that identifies a specific External SSO 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_sso_v1_sso_external_UpdateConnectionResponse' '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/sso/external/{organization_id}/connections/{connection_id}\n\ const 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: \"${externalConnectionId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.SSO.External.UpdateConnection(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// PUT /v1/b2b/sso/external/{organization_id}/connections/{connection_id}\n\ package 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/sso/external\"\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 := &external.UpdateConnectionParams{\n\ \t\tOrganizationID: \"${organizationId}\",\n\t\tConnectionID: \"${externalConnectionId}\"\ ,\n\t}\n\n\toptions := &external.UpdateConnectionParamsOptions{\n\t\tAuthorization:\ \ methodoptions.Authorization{\n\t\t\tSessionToken: \"${sessionToken}\"\ ,\n\t\t},\n\t}\n\n\tresp, err := client.SSO.External.UpdateConnection(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/sso/external/{organization_id}/connections/{connection_id}\n\ package com.example;\n\nimport com.stytch.java.b2b.models.ssoexternal.UpdateConnectionRequest;\n\ import com.stytch.java.b2b.models.ssoexternal.UpdateConnectionRequestOptions;\n\ import com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.methodoptions.Authorization;\n\ import com.stytch.java.common.StytchResult;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchB2BClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n UpdateConnectionRequest params\ \ = new UpdateConnectionRequest();\n params.setOrganizationId(\"\ ${organizationId}\");\n params.setConnectionId(\"${externalConnectionId}\"\ );\n\n UpdateConnectionRequestOptions options = new UpdateConnectionRequestOptions();\n\ \ Authorization authorization = new Authorization();\n authorization.setSessionToken(\"\ ${sessionToken}\");\n options.setAuthorization(authorization);\n\n\ \ Object result = StytchB2BClient.getSSO().getExternal().updateConnection(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/sso/external/{organization_id}/connections/{connection_id}\n\ package com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport\ \ com.stytch.java.b2b.models.ssoexternal.UpdateConnectionRequest\nimport\ \ com.stytch.java.b2b.models.ssoexternal.UpdateConnectionRequestOptions\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.sso.external.updateConnection(\n \ \ UpdateConnectionRequest(\n organizationId\ \ = \"${organizationId}\",\n connectionId = \"${externalConnectionId}\"\ ,\n ),\n UpdateConnectionRequestOptions(\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/sso/external/{organization_id}/connections/{connection_id}\n\ const 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: \"${externalConnectionId}\"\ ,\n};\n\nconst options = {\n authorization: {\n session_token: '${sessionToken}',\n\ \ },\n};\n\nclient.sso.external.updateConnection(params, options)\n .then(resp\ \ => { console.log(resp) })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->sso->external->update_connection([\n 'organization_id'\ \ => '${organizationId}',\n 'connection_id' => '${externalConnectionId}',\n\ ], [\n 'authorization' => ['session_token' => '${sessionToken}'],\n\ \n]);" - lang: python label: Python source: "# PUT /v1/b2b/sso/external/{organization_id}/connections/{connection_id}\n\ from stytch import B2BClient\nfrom stytch.b2b.models.sso_external import\ \ UpdateConnectionRequestOptions\nfrom stytch.shared.method_options import\ \ Authorization\n\nclient = B2BClient(\n project_id=\"${projectId}\"\ ,\n secret=\"${secret}\",\n)\n\nresp = client.sso.external.update_connection(\n\ \ organization_id=\"${organizationId}\",\n connection_id=\"${externalConnectionId}\"\ ,\n method_options=UpdateConnectionRequestOptions(\n authorization=Authorization(\n\ \ session_token=\"${sessionToken}\",\n ),\n ),\n)\n\ \nprint(resp)\n" - lang: ruby label: Ruby source: "# PUT /v1/b2b/sso/external/{organization_id}/connections/{connection_id}\n\ require 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\"\ ,\n secret: \"${secret}\"\n)\n\nresp = client.sso.external.update_connection(\n\ \ organization_id: \"${organizationId}\",\n connection_id: \"${externalConnectionId}\"\ ,\n method_options: StytchB2B::SSO::External::UpdateConnectionRequestOptions.new(\n\ \ authorization: Stytch::MethodOptions::Authorization.new(session_token:\ \ '${sessionToken}')\n )\n)\n\nputs resp" - lang: rust label: Rust source: "// PUT /v1/b2b/sso/external/{organization_id}/connections/{connection_id}\n\ use stytch::b2b::client::Client;\nuse stytch::b2b::sso_external::UpdateConnectionRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.sso.external.update_connection(\n \ \ UpdateConnectionRequest{\n organization_id: \"${organizationId}\"\ ,\n connection_id: \"${externalConnectionId}\",\n \ \ ..Default::default()\n }\n ).await;\n println!(\"The response\ \ is {:?}\", resp);\n}" - lang: bash label: cURL source: "# PUT /v1/b2b/sso/external/{organization_id}/connections/{connection_id}\n\ curl --request PUT \\\n --url https://test.stytch.com/v1/b2b/sso/external/${organizationId}/connections/${externalConnectionId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -H \"X-Stytch-Member-Session: ${sessionToken}\"" /v1/totps: post: summary: Create operationId: api_totp_v1_Create tags: - Totp description: Create a new TOTP instance for a user. The user can use the authenticator application of their choice to scan the QR code or enter the secret. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_totp_v1_CreateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_totp_v1_CreateResponse' '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: "// POST /v1/totps\nconst stytch = require('stytch');\n\nconst client\ \ = new stytch.Client({\n project_id: '${projectId}',\n secret: '${secret}',\n\ });\n\nconst params = {\n user_id: \"${userId}\",\n};\n\nclient.TOTPs.Create(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/totps\npackage main\n\nimport (\n\t\"context\"\n\t\"\ log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/totps\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &totps.CreateParams{\n\t\tUserID:\ \ \"${userId}\",\n\t}\n\n\tresp, err := client.TOTPs.Create(context.Background(),\ \ params)\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: "// POST /v1/totps\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.totps.CreateRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ CreateRequest params = new CreateRequest();\n params.setUserId(\"\ ${userId}\");\n\n Object result = StytchClient.getTOTPs().create(params);\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: "// POST /v1/totps\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.totps.CreateRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.totps.create(\n CreateRequest(\n\ \ userId = \"${userId}\",\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: "// POST /v1/totps\nconst stytch = require('stytch');\n\nconst client\ \ = new stytch.Client({\n project_id: '${projectId}',\n secret: '${secret}',\n\ });\n\nconst params = {\n user_id: \"${userId}\",\n};\n\nclient.totps.create(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->totps->create([\n 'user_id' => '${userId}',\n\ ]);" - lang: python label: Python source: "# POST /v1/totps\nfrom stytch import Client\n\nclient = Client(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.totps.create(\n user_id=\"${userId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/totps\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.totps.create(\n\ \ user_id: \"${userId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/totps\nuse stytch::consumer::client::Client;\nuse stytch::consumer::totps::CreateRequest;\n\ \nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\"\ ).unwrap();\n let resp = client.totps.create(\n CreateRequest{\n\ \ user_id: \"${userId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/totps\ncurl --request POST \\\n --url https://test.stytch.com/v1/totps\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"user_id\": \"${userId}\"\n }'" /v1/totps/authenticate: post: summary: Authenticate operationId: api_totp_v1_Authenticate tags: - Totp description: Authenticate a TOTP code entered by a user. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_totp_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_totp_v1_AuthenticateResponse' '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: "// POST /v1/totps/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n totp_code:\ \ \"${exampleTotpCode}\",\n session_duration_minutes: 60,\n};\n\nclient.TOTPs.Authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/totps/authenticate\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/totps\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &totps.AuthenticateParams{\n\t\t\ UserID: \"${userId}\",\n\t\tTOTPCode: \"${exampleTotpCode}\"\ ,\n\t\tSessionDurationMinutes: 60,\n\t}\n\n\tresp, err := client.TOTPs.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/totps/authenticate\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.totps.AuthenticateRequest;\nimport\ \ com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n public\ \ static void main(String[] args) {\n StytchClient.configure(\"${projectId}\"\ , \"${secret}\");\n\n AuthenticateRequest params = new AuthenticateRequest();\n\ \ params.setUserId(\"${userId}\");\n params.setTOTPCode(\"\ ${exampleTotpCode}\");\n params.setSessionDurationMinutes(60);\n\n\ \ Object result = StytchClient.getTOTPs().authenticate(params);\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: "// POST /v1/totps/authenticate\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.totps.AuthenticateRequest\n\nfun\ \ main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.totps.authenticate(\n AuthenticateRequest(\n\ \ userId = \"${userId}\",\n totpCode\ \ = \"${exampleTotpCode}\",\n sessionDurationMinutes\ \ = 60,\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: "// POST /v1/totps/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n totp_code:\ \ \"${exampleTotpCode}\",\n session_duration_minutes: 60,\n};\n\nclient.totps.authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->totps->authenticate([\n 'user_id' => '${userId}',\n\ \ 'totp_code' => '${exampleTotpCode}',\n 'session_duration_minutes'\ \ => 60,\n]);" - lang: python label: Python source: "# POST /v1/totps/authenticate\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.totps.authenticate(\n user_id=\"${userId}\",\n\ \ totp_code=\"${exampleTotpCode}\",\n session_duration_minutes=60,\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/totps/authenticate\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.totps.authenticate(\n\ \ user_id: \"${userId}\",\n totp_code: \"${exampleTotpCode}\",\n session_duration_minutes:\ \ 60\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/totps/authenticate\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::totps::AuthenticateRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.totps.authenticate(\n AuthenticateRequest{\n \ \ user_id: \"${userId}\",\n totp_code: \"${exampleTotpCode}\"\ ,\n session_duration_minutes: 60,\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/totps/authenticate\ncurl --request POST \\\n --url https://test.stytch.com/v1/totps/authenticate\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"user_id\": \"${userId}\",\n \"totp_code\": \"${exampleTotpCode}\"\ ,\n \"session_duration_minutes\": 60\n }'" /v1/totps/recovery_codes: post: summary: Recoverycodes operationId: api_totp_v1_RecoveryCodes tags: - Totp description: Retrieve the recovery codes for a TOTP instance tied to a User. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_totp_v1_RecoveryCodesRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_totp_v1_RecoveryCodesResponse' '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: "// POST /v1/totps/recovery_codes\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n};\n\ \nclient.TOTPs.RecoveryCodes(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/totps/recovery_codes\npackage main\n\nimport (\n\t\"\ context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/totps\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &totps.RecoveryCodesParams{\n\t\ \tUserID: \"${userId}\",\n\t}\n\n\tresp, err := client.TOTPs.RecoveryCodes(context.Background(),\ \ params)\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: "// POST /v1/totps/recovery_codes\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.totps.RecoveryCodesRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n RecoveryCodesRequest params =\ \ new RecoveryCodesRequest();\n params.setUserId(\"${userId}\");\n\ \n Object result = StytchClient.getTOTPs().recoveryCodes(params);\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: "// POST /v1/totps/recovery_codes\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.totps.RecoveryCodesRequest\n\nfun\ \ main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.totps.recoveryCodes(\n RecoveryCodesRequest(\n\ \ userId = \"${userId}\",\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: "// POST /v1/totps/recovery_codes\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n};\n\ \nclient.totps.recoveryCodes(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->totps->recovery_codes([\n 'user_id' => '${userId}',\n\ ]);" - lang: python label: Python source: "# POST /v1/totps/recovery_codes\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.totps.recovery_codes(\n user_id=\"${userId}\",\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/totps/recovery_codes\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.totps.recovery_codes(\n\ \ user_id: \"${userId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/totps/recovery_codes\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::totps::RecoveryCodesRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.totps.recovery_codes(\n RecoveryCodesRequest{\n \ \ user_id: \"${userId}\",\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/totps/recovery_codes\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/totps/recovery_codes \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"user_id\"\ : \"${userId}\"\n }'" /v1/totps/recover: post: summary: Recover operationId: api_totp_v1_Recover tags: - Totp description: Authenticate a recovery code for a TOTP instance. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_totp_v1_RecoverRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_totp_v1_RecoverResponse' '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: "// POST /v1/totps/recover\nconst stytch = require('stytch');\n\n\ const client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n recovery_code:\ \ \"${exampleTotpRecoveryCode}\",\n session_duration_minutes: 60,\n};\n\ \nclient.TOTPs.Recover(params)\n .then(resp => { console.log(resp) })\n\ \ .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/totps/recover\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/totps\"\n)\n\n\ func main() {\n\tclient, err := stytchapi.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 := &totps.RecoverParams{\n\t\tUserID:\ \ \"${userId}\",\n\t\tRecoveryCode: \"${exampleTotpRecoveryCode}\"\ ,\n\t\tSessionDurationMinutes: 60,\n\t}\n\n\tresp, err := client.TOTPs.Recover(context.Background(),\ \ params)\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: "// POST /v1/totps/recover\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.totps.RecoverRequest;\nimport com.stytch.java.consumer.StytchClient;\n\ \npublic class Main {\n public static void main(String[] args) {\n \ \ StytchClient.configure(\"${projectId}\", \"${secret}\");\n\n \ \ RecoverRequest params = new RecoverRequest();\n params.setUserId(\"\ ${userId}\");\n params.setRecoveryCode(\"${exampleTotpRecoveryCode}\"\ );\n params.setSessionDurationMinutes(60);\n\n Object result\ \ = StytchClient.getTOTPs().recover(params);\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: "// POST /v1/totps/recover\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.totps.RecoverRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.totps.recover(\n RecoverRequest(\n\ \ userId = \"${userId}\",\n recoveryCode\ \ = \"${exampleTotpRecoveryCode}\",\n sessionDurationMinutes\ \ = 60,\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: "// POST /v1/totps/recover\nconst stytch = require('stytch');\n\n\ const client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n recovery_code:\ \ \"${exampleTotpRecoveryCode}\",\n session_duration_minutes: 60,\n};\n\ \nclient.totps.recover(params)\n .then(resp => { console.log(resp) })\n\ \ .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->totps->recover([\n 'user_id' => '${userId}',\n\ \ 'recovery_code' => '${exampleTotpRecoveryCode}',\n 'session_duration_minutes'\ \ => 60,\n]);" - lang: python label: Python source: "# POST /v1/totps/recover\nfrom stytch import Client\n\nclient = Client(\n\ \ project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp\ \ = client.totps.recover(\n user_id=\"${userId}\",\n recovery_code=\"\ ${exampleTotpRecoveryCode}\",\n session_duration_minutes=60,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/totps/recover\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.totps.recover(\n\ \ user_id: \"${userId}\",\n recovery_code: \"${exampleTotpRecoveryCode}\"\ ,\n session_duration_minutes: 60\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/totps/recover\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::totps::RecoverRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.totps.recover(\n RecoverRequest{\n user_id:\ \ \"${userId}\",\n recovery_code: \"${exampleTotpRecoveryCode}\"\ ,\n session_duration_minutes: 60,\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/totps/recover\ncurl --request POST \\\n --url https://test.stytch.com/v1/totps/recover\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"user_id\": \"${userId}\",\n \"recovery_code\": \"\ ${exampleTotpRecoveryCode}\",\n \"session_duration_minutes\": 60\n }'" /v1/webauthn/register/start: post: summary: Registerstart operationId: api_webauthn_v1_RegisterStart tags: - Webauthn description: "Initiate the process of creating a new Passkey or WebAuthn registration.\ \ \n\nTo optimize for Passkeys, set the `return_passkey_credential_options`\ \ field to `true`.\n\nAfter calling this endpoint, the browser will need to\ \ call [navigator.credentials.create()](https://www.w3.org/TR/webauthn-2/#sctn-createCredential)\ \ with the data from [public_key_credential_creation_options](https://w3c.github.io/webauthn/#dictionary-makecredentialoptions)\ \ passed to the [navigator.credentials.create()](https://www.w3.org/TR/webauthn-2/#sctn-createCredential)\ \ request via the public key argument.\n\nWhen using built-in browser methods\ \ like `navigator.credentials.create()`, set the `use_base64_url_encoding`\ \ option to `true`.\n\nSee our [WebAuthn setup guide](https://stytch.com/docs/guides/webauthn/api)\ \ for additional usage instructions and example code." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_webauthn_v1_RegisterStartRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_webauthn_v1_RegisterStartResponse' '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: "// POST /v1/webauthn/register/start\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n domain:\ \ \"${exampleDomain}\",\n};\n\nclient.WebAuthn.RegisterStart(params)\n \ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/webauthn/register/start\npackage main\n\nimport (\n\t\ \"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/webauthn\"\n)\n\ \nfunc main() {\n\tclient, err := stytchapi.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 := &webauthn.RegisterStartParams{\n\ \t\tUserID: \"${userId}\",\n\t\tDomain: \"${exampleDomain}\",\n\t}\n\n\t\ resp, err := client.WebAuthn.RegisterStart(context.Background(), params)\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: "// POST /v1/webauthn/register/start\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.webauthn.RegisterStartRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n RegisterStartRequest params =\ \ new RegisterStartRequest();\n params.setUserId(\"${userId}\");\n\ \ params.setDomain(\"${exampleDomain}\");\n\n Object result\ \ = StytchClient.getWebAuthn().registerStart(params);\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: "// POST /v1/webauthn/register/start\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.webauthn.RegisterStartRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.webauthn.registerStart(\n RegisterStartRequest(\n\ \ userId = \"${userId}\",\n domain\ \ = \"${exampleDomain}\",\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: "// POST /v1/webauthn/register/start\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n domain:\ \ \"${exampleDomain}\",\n};\n\nclient.webauthn.registerStart(params)\n \ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->webauthn->register_start([\n 'user_id' =>\ \ '${userId}',\n 'domain' => '${exampleDomain}',\n]);" - lang: python label: Python source: "# POST /v1/webauthn/register/start\nfrom stytch import Client\n\n\ client = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.webauthn.register_start(\n user_id=\"${userId}\"\ ,\n domain=\"${exampleDomain}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/webauthn/register/start\nrequire 'stytch'\n\nclient =\ \ Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.webauthn.register_start(\n user_id: \"${userId}\"\ ,\n domain: \"${exampleDomain}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/webauthn/register/start\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::webauthn::RegisterStartRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.webauthn.register_start(\n RegisterStartRequest{\n\ \ user_id: \"${userId}\",\n domain: \"${exampleDomain}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/webauthn/register/start\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/webauthn/register/start \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"user_id\"\ : \"${userId}\",\n \"domain\": \"${exampleDomain}\"\n }'" /v1/webauthn/register: post: summary: Register operationId: api_webauthn_v1_Register tags: - Webauthn description: "Complete the creation of a WebAuthn registration by passing the\ \ response from the [navigator.credentials.create()](https://www.w3.org/TR/webauthn-2/#sctn-createCredential)\ \ request to this endpoint as the `public_key_credential` parameter. \n\n\ See our [WebAuthn setup guide](https://stytch.com/docs/guides/webauthn/api)\ \ for additional usage instructions and example code." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_webauthn_v1_RegisterRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_webauthn_v1_RegisterResponse' '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: "// POST /v1/webauthn/register\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n public_key_credential:\ \ \"${exampleCreatePublicKeyCredential}\",\n session_duration_minutes:\ \ 60,\n};\n\nclient.WebAuthn.Register(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: go label: Go source: "// POST /v1/webauthn/register\npackage main\n\nimport (\n\t\"context\"\ \n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/webauthn\"\n)\n\ \nfunc main() {\n\tclient, err := stytchapi.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 := &webauthn.RegisterParams{\n\t\t\ UserID: \"${userId}\",\n\t\tPublicKeyCredential: \"${exampleCreatePublicKeyCredential}\"\ ,\n\t\tSessionDurationMinutes: 60,\n\t}\n\n\tresp, err := client.WebAuthn.Register(context.Background(),\ \ params)\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: "// POST /v1/webauthn/register\npackage com.example;\n\nimport com.stytch.java.common.StytchResult;\n\ import com.stytch.java.consumer.models.webauthn.RegisterRequest;\nimport\ \ com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n public\ \ static void main(String[] args) {\n StytchClient.configure(\"${projectId}\"\ , \"${secret}\");\n\n RegisterRequest params = new RegisterRequest();\n\ \ params.setUserId(\"${userId}\");\n params.setPublicKeyCredential(\"\ ${exampleCreatePublicKeyCredential}\");\n params.setSessionDurationMinutes(60);\n\ \n Object result = StytchClient.getWebAuthn().register(params);\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: "// POST /v1/webauthn/register\npackage com.example\n\nimport com.stytch.java.consumer.StytchClient\n\ import com.stytch.java.consumer.models.webauthn.RegisterRequest\n\nfun main()\ \ {\n StytchClient.configure(\n projectId = \"${projectId}\",\n\ \ secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.webauthn.register(\n RegisterRequest(\n\ \ userId = \"${userId}\",\n publicKeyCredential\ \ = \"${exampleCreatePublicKeyCredential}\",\n sessionDurationMinutes\ \ = 60,\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: "// POST /v1/webauthn/register\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n user_id: \"${userId}\",\n public_key_credential:\ \ \"${exampleCreatePublicKeyCredential}\",\n session_duration_minutes:\ \ 60,\n};\n\nclient.webauthn.register(params)\n .then(resp => { console.log(resp)\ \ })\n .catch(err => { console.log(err) });" - lang: php label: PHP source: "$response = $client->webauthn->register([\n 'user_id' => '${userId}',\n\ \ 'public_key_credential' => '${exampleCreatePublicKeyCredential}',\n\ \ 'session_duration_minutes' => 60,\n]);" - lang: python label: Python source: "# POST /v1/webauthn/register\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.webauthn.register(\n user_id=\"${userId}\",\n \ \ public_key_credential=\"${exampleCreatePublicKeyCredential}\",\n \ \ session_duration_minutes=60,\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/webauthn/register\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.webauthn.register(\n\ \ user_id: \"${userId}\",\n public_key_credential: \"${exampleCreatePublicKeyCredential}\"\ ,\n session_duration_minutes: 60\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/webauthn/register\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::webauthn::RegisterRequest;\n\nfn main() {\n let\ \ client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let\ \ resp = client.webauthn.register(\n RegisterRequest{\n \ \ user_id: \"${userId}\",\n public_key_credential: \"${exampleCreatePublicKeyCredential}\"\ ,\n session_duration_minutes: 60,\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/webauthn/register\ncurl --request POST \\\n --url https://test.stytch.com/v1/webauthn/register\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"user_id\": \"${userId}\",\n \"public_key_credential\"\ : \"${exampleCreatePublicKeyCredential}\",\n \"session_duration_minutes\"\ : 60\n }'" /v1/webauthn/authenticate/start: post: summary: Authenticatestart operationId: api_webauthn_v1_AuthenticateStart tags: - Webauthn description: "Initiate the authentication of a Passkey or WebAuthn registration.\ \ \n\nTo optimize for Passkeys, set the `return_passkey_credential_options`\ \ field to `true`.\n\nAfter calling this endpoint, the browser will need to\ \ call [navigator.credentials.get()](https://www.w3.org/TR/webauthn-2/#sctn-getAssertion)\ \ with the data from `public_key_credential_request_options` passed to the\ \ [navigator.credentials.get()](https://www.w3.org/TR/webauthn-2/#sctn-getAssertion)\ \ request via the public key argument.\n\nWhen using built-in browser methods\ \ like `navigator.credentials.get()`, set the `use_base64_url_encoding` option\ \ to `true`.\n\nSee our [WebAuthn setup guide](https://stytch.com/docs/guides/webauthn/api)\ \ for additional usage instructions and example code." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_webauthn_v1_AuthenticateStartRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_webauthn_v1_AuthenticateStartResponse' '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: "// POST /v1/webauthn/authenticate/start\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n domain: \"${exampleDomain}\"\ ,\n user_id: \"${userId}\",\n};\n\nclient.WebAuthn.AuthenticateStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/webauthn/authenticate/start\npackage main\n\nimport (\n\ \t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/webauthn\"\n)\n\ \nfunc main() {\n\tclient, err := stytchapi.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 := &webauthn.AuthenticateStartParams{\n\ \t\tDomain: \"${exampleDomain}\",\n\t\tUserID: \"${userId}\",\n\t}\n\n\t\ resp, err := client.WebAuthn.AuthenticateStart(context.Background(), params)\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: "// POST /v1/webauthn/authenticate/start\npackage com.example;\n\n\ import com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.webauthn.AuthenticateStartRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthenticateStartRequest params\ \ = new AuthenticateStartRequest();\n params.setDomain(\"${exampleDomain}\"\ );\n params.setUserId(\"${userId}\");\n\n Object result =\ \ StytchClient.getWebAuthn().authenticateStart(params);\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: "// POST /v1/webauthn/authenticate/start\npackage com.example\n\n\ import com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.webauthn.AuthenticateStartRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.webauthn.authenticateStart(\n \ \ AuthenticateStartRequest(\n domain = \"${exampleDomain}\"\ ,\n userId = \"${userId}\",\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: "// POST /v1/webauthn/authenticate/start\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n domain: \"${exampleDomain}\"\ ,\n user_id: \"${userId}\",\n};\n\nclient.webauthn.authenticateStart(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->webauthn->authenticate_start([\n 'domain'\ \ => '${exampleDomain}',\n 'user_id' => '${userId}',\n]);" - lang: python label: Python source: "# POST /v1/webauthn/authenticate/start\nfrom stytch import Client\n\ \nclient = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.webauthn.authenticate_start(\n domain=\"${exampleDomain}\"\ ,\n user_id=\"${userId}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/webauthn/authenticate/start\nrequire 'stytch'\n\nclient\ \ = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\ \n)\n\nresp = client.webauthn.authenticate_start(\n domain: \"${exampleDomain}\"\ ,\n user_id: \"${userId}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/webauthn/authenticate/start\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::webauthn::AuthenticateStartRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.webauthn.authenticate_start(\n AuthenticateStartRequest{\n\ \ domain: \"${exampleDomain}\",\n user_id: Some(String::from(\"\ ${userId}\")),\n ..Default::default()\n }\n ).await;\n\ \ println!(\"The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# POST /v1/webauthn/authenticate/start\ncurl --request POST \\\n\ \ --url https://test.stytch.com/v1/webauthn/authenticate/start \\\n -u\ \ '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n\ \ -d '{\n \"domain\": \"${exampleDomain}\",\n \"user_id\": \"${userId}\"\ \n }'" /v1/webauthn/authenticate: post: summary: Authenticate operationId: api_webauthn_v1_Authenticate tags: - Webauthn description: "Complete the authentication of a Passkey or WebAuthn registration\ \ by passing the response from the [navigator.credentials.get()](https://www.w3.org/TR/webauthn-2/#sctn-getAssertion)\ \ request to the authenticate endpoint. \n\nSee our [WebAuthn setup guide](https://stytch.com/docs/guides/webauthn/api)\ \ for additional usage instructions and example code." requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_webauthn_v1_AuthenticateRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_webauthn_v1_AuthenticateResponse' '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: "// POST /v1/webauthn/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n public_key_credential: \"${exampleGetPublicKeyCredential}\"\ ,\n session_duration_minutes: 60,\n};\n\nclient.WebAuthn.Authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// POST /v1/webauthn/authenticate\npackage main\n\nimport (\n\t\"\ context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/webauthn\"\n)\n\ \nfunc main() {\n\tclient, err := stytchapi.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 := &webauthn.AuthenticateParams{\n\ \t\tPublicKeyCredential: \"${exampleGetPublicKeyCredential}\",\n\t\t\ SessionDurationMinutes: 60,\n\t}\n\n\tresp, err := client.WebAuthn.Authenticate(context.Background(),\ \ params)\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: "// POST /v1/webauthn/authenticate\npackage com.example;\n\nimport\ \ com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.webauthn.AuthenticateRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n AuthenticateRequest params =\ \ new AuthenticateRequest();\n params.setPublicKeyCredential(\"${exampleGetPublicKeyCredential}\"\ );\n params.setSessionDurationMinutes(60);\n\n Object result\ \ = StytchClient.getWebAuthn().authenticate(params);\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: "// POST /v1/webauthn/authenticate\npackage com.example\n\nimport\ \ com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.webauthn.AuthenticateRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.webauthn.authenticate(\n AuthenticateRequest(\n\ \ publicKeyCredential = \"${exampleGetPublicKeyCredential}\"\ ,\n sessionDurationMinutes = 60,\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: "// POST /v1/webauthn/authenticate\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n public_key_credential: \"${exampleGetPublicKeyCredential}\"\ ,\n session_duration_minutes: 60,\n};\n\nclient.webauthn.authenticate(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->webauthn->authenticate([\n 'public_key_credential'\ \ => '${exampleGetPublicKeyCredential}',\n 'session_duration_minutes'\ \ => 60,\n]);" - lang: python label: Python source: "# POST /v1/webauthn/authenticate\nfrom stytch import Client\n\nclient\ \ = Client(\n project_id=\"${projectId}\",\n secret=\"${secret}\"\ ,\n)\n\nresp = client.webauthn.authenticate(\n public_key_credential=\"\ ${exampleGetPublicKeyCredential}\",\n session_duration_minutes=60,\n\ )\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# POST /v1/webauthn/authenticate\nrequire 'stytch'\n\nclient = Stytch::Client.new(\n\ \ project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.webauthn.authenticate(\n\ \ public_key_credential: \"${exampleGetPublicKeyCredential}\",\n session_duration_minutes:\ \ 60\n \n)\n\nputs resp" - lang: rust label: Rust source: "// POST /v1/webauthn/authenticate\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::webauthn::AuthenticateRequest;\n\nfn main() {\n \ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.webauthn.authenticate(\n AuthenticateRequest{\n\ \ public_key_credential: \"${exampleGetPublicKeyCredential}\"\ ,\n session_duration_minutes: 60,\n ..Default::default()\n\ \ }\n ).await;\n println!(\"The response is {:?}\", resp);\n\ }" - lang: bash label: cURL source: "# POST /v1/webauthn/authenticate\ncurl --request POST \\\n --url\ \ https://test.stytch.com/v1/webauthn/authenticate \\\n -u '${projectId}:${secret}'\ \ \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"public_key_credential\"\ : \"${exampleGetPublicKeyCredential}\",\n \"session_duration_minutes\"\ : 60\n }'" /v1/webauthn/{webauthn_registration_id}: put: summary: Update operationId: api_webauthn_v1_Update tags: - Webauthn description: Updates a Passkey or WebAuthn registration. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/api_webauthn_v1_UpdateRequest' parameters: - name: webauthn_registration_id in: path required: true schema: type: string description: Globally unique UUID that identifies a Passkey or WebAuthn registration in the Stytch API. The `webauthn_registration_id` is used when you need to operate on a specific User's WebAuthn registration. description: Globally unique UUID that identifies a Passkey or WebAuthn registration in the Stytch API. The `webauthn_registration_id` is used when you need to operate on a specific User's WebAuthn registration. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_webauthn_v1_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/webauthn/{webauthn_registration_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n webauthn_registration_id: \"\ ${webauthnRegistrationId}\",\n name: \"Google Passkey\",\n};\n\nclient.WebAuthn.Update(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// PUT /v1/webauthn/{webauthn_registration_id}\npackage main\n\n\ import (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/webauthn\"\n)\n\ \nfunc main() {\n\tclient, err := stytchapi.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 := &webauthn.UpdateParams{\n\t\tWebAuthnRegistrationID:\ \ \"${webauthnRegistrationId}\",\n\t\tName: \"Google Passkey\"\ ,\n\t}\n\n\tresp, err := client.WebAuthn.Update(context.Background(), params)\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/webauthn/{webauthn_registration_id}\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.webauthn.UpdateRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n UpdateRequest params = new UpdateRequest();\n\ \ params.setWebAuthnRegistrationId(\"${webauthnRegistrationId}\"\ );\n params.setName(\"Google Passkey\");\n\n Object result\ \ = StytchClient.getWebAuthn().update(params);\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/webauthn/{webauthn_registration_id}\npackage com.example\n\ \nimport com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.webauthn.UpdateRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.webauthn.update(\n UpdateRequest(\n\ \ webauthnRegistrationId = \"${webauthnRegistrationId}\"\ ,\n name = \"Google Passkey\",\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/webauthn/{webauthn_registration_id}\nconst stytch = require('stytch');\n\ \nconst client = new stytch.Client({\n project_id: '${projectId}',\n secret:\ \ '${secret}',\n});\n\nconst params = {\n webauthn_registration_id: \"\ ${webauthnRegistrationId}\",\n name: \"Google Passkey\",\n};\n\nclient.webauthn.update(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->webauthn->update([\n 'webauthn_registration_id'\ \ => '${webauthnRegistrationId}',\n 'name' => 'Google Passkey',\n]);" - lang: python label: Python source: "# PUT /v1/webauthn/{webauthn_registration_id}\nfrom stytch import\ \ Client\n\nclient = Client(\n project_id=\"${projectId}\",\n secret=\"\ ${secret}\",\n)\n\nresp = client.webauthn.update(\n webauthn_registration_id=\"\ ${webauthnRegistrationId}\",\n name=\"Google Passkey\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# PUT /v1/webauthn/{webauthn_registration_id}\nrequire 'stytch'\n\ \nclient = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.webauthn.update(\n webauthn_registration_id:\ \ \"${webauthnRegistrationId}\",\n name: \"Google Passkey\"\n \n)\n\n\ puts resp" - lang: rust label: Rust source: "// PUT /v1/webauthn/{webauthn_registration_id}\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::webauthn::UpdateRequest;\n\nfn main() {\n let client\ \ = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp\ \ = client.webauthn.update(\n UpdateRequest{\n webauthn_registration_id:\ \ \"${webauthnRegistrationId}\",\n name: \"Google Passkey\",\n\ \ ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# PUT /v1/webauthn/{webauthn_registration_id}\ncurl --request PUT\ \ \\\n --url https://test.stytch.com/v1/webauthn/${webauthnRegistrationId}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'\ \ \\\n -d '{\n \"name\": \"Google Passkey\"\n }'" /v1/webauthn/credentials/{user_id}/{domain}: get: summary: Listcredentials operationId: api_webauthn_v1_ListCredentials tags: - Webauthn description: List the public key credentials of the WebAuthn Registrations or Passkeys registered to a specific User. parameters: - name: user_id in: path required: true schema: type: string description: The `user_id` of an active user the Passkey or WebAuthn registration should be tied to. description: The `user_id` of an active user the Passkey or WebAuthn registration should be tied to. - name: domain in: path required: true schema: type: string description: The domain for Passkeys or WebAuthn. Defaults to `window.location.hostname`. description: The domain for Passkeys or WebAuthn. Defaults to `window.location.hostname`. responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/api_webauthn_v1_ListCredentialsResponse' '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/webauthn/credentials/{user_id}/{domain}\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.Client({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n user_id:\ \ \"${userId}\",\n domain: \"${exampleDomain}\",\n};\n\nclient.WebAuthn.ListCredentials(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: go label: Go source: "// GET /v1/webauthn/credentials/{user_id}/{domain}\npackage main\n\ \nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/stytchapi\"\ \n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/webauthn\"\n)\n\ \nfunc main() {\n\tclient, err := stytchapi.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 := &webauthn.ListCredentialsParams{\n\ \t\tUserID: \"${userId}\",\n\t\tDomain: \"${exampleDomain}\",\n\t}\n\n\t\ resp, err := client.WebAuthn.ListCredentials(context.Background(), params)\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/webauthn/credentials/{user_id}/{domain}\npackage com.example;\n\ \nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.webauthn.ListCredentialsRequest;\n\ import com.stytch.java.consumer.StytchClient;\n\npublic class Main {\n \ \ public static void main(String[] args) {\n StytchClient.configure(\"\ ${projectId}\", \"${secret}\");\n\n ListCredentialsRequest params\ \ = new ListCredentialsRequest();\n params.setUserId(\"${userId}\"\ );\n params.setDomain(\"${exampleDomain}\");\n\n Object result\ \ = StytchClient.getWebAuthn().listCredentials(params);\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/webauthn/credentials/{user_id}/{domain}\npackage com.example\n\ \nimport com.stytch.java.consumer.StytchClient\nimport com.stytch.java.consumer.models.webauthn.ListCredentialsRequest\n\ \nfun main() {\n StytchClient.configure(\n projectId = \"${projectId}\"\ ,\n secret = \"${secret}\",\n )\n\n when (\n val result\ \ =\n StytchClient.webauthn.listCredentials(\n \ \ ListCredentialsRequest(\n userId = \"${userId}\",\n\ \ domain = \"${exampleDomain}\",\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: "// GET /v1/webauthn/credentials/{user_id}/{domain}\nconst stytch\ \ = require('stytch');\n\nconst client = new stytch.Client({\n project_id:\ \ '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n user_id:\ \ \"${userId}\",\n domain: \"${exampleDomain}\",\n};\n\nclient.webauthn.listCredentials(params)\n\ \ .then(resp => { console.log(resp) })\n .catch(err => { console.log(err)\ \ });" - lang: php label: PHP source: "$response = $client->webauthn->list_credentials([\n 'user_id'\ \ => '${userId}',\n 'domain' => '${exampleDomain}',\n]);" - lang: python label: Python source: "# GET /v1/webauthn/credentials/{user_id}/{domain}\nfrom stytch import\ \ Client\n\nclient = Client(\n project_id=\"${projectId}\",\n secret=\"\ ${secret}\",\n)\n\nresp = client.webauthn.list_credentials(\n user_id=\"\ ${userId}\",\n domain=\"${exampleDomain}\",\n)\n\nprint(resp)\n" - lang: ruby label: Ruby source: "# GET /v1/webauthn/credentials/{user_id}/{domain}\nrequire 'stytch'\n\ \nclient = Stytch::Client.new(\n project_id: \"${projectId}\",\n secret:\ \ \"${secret}\"\n)\n\nresp = client.webauthn.list_credentials(\n user_id:\ \ \"${userId}\",\n domain: \"${exampleDomain}\"\n \n)\n\nputs resp" - lang: rust label: Rust source: "// GET /v1/webauthn/credentials/{user_id}/{domain}\nuse stytch::consumer::client::Client;\n\ use stytch::consumer::webauthn::ListCredentialsRequest;\n\nfn main() {\n\ \ let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n\ \ let resp = client.webauthn.list_credentials(\n ListCredentialsRequest{\n\ \ user_id: \"${userId}\",\n domain: \"${exampleDomain}\"\ ,\n ..Default::default()\n }\n ).await;\n println!(\"\ The response is {:?}\", resp);\n}" - lang: bash label: cURL source: "# GET /v1/webauthn/credentials/{user_id}/{domain}\ncurl --request\ \ GET \\\n --url https://test.stytch.com/v1/webauthn/credentials/${userId}/${exampleDomain}\ \ \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'" components: securitySchemes: basicAuth: type: http scheme: basic schemas: api_attribute_v1_Attributes: type: object properties: ip_address: type: string description: The IP address of the user. user_agent: type: string description: The user agent of the User. api_connectedapps_v1_ConnectedApp: type: object properties: client_id: type: string description: The ID of the Connected App client. client_name: type: string description: A human-readable name for the client. client_description: type: string description: A human-readable description for the client. status: type: string full_access_allowed: type: boolean description: Valid for first party clients only. If `true`, an authorization token granted to this Client can be exchanged for a full Stytch session. client_type: type: string description: The type of Connected App. Supported values are `first_party`, `first_party_public`, `third_party`, and `third_party_public`. redirect_urls: type: array items: type: string description: Array of redirect URI values for use in OAuth Authorization flows. access_token_expiry_minutes: type: integer format: int32 access_token_template_content: type: string post_logout_redirect_urls: type: array items: type: string description: Array of redirect URI values for use in OIDC Logout flows. bypass_consent_for_offline_access: type: boolean description: Valid for first party clients only. If true, the client does not need to request explicit user consent for the `offline_access` scope. creation_method: type: string client_secret_last_four: type: string description: The last four characters of the client secret. next_client_secret_last_four: type: string description: The last four characters of the `next_client_secret`. Null if no `next_client_secret` exists. access_token_custom_audience: type: string logo_url: type: string description: The logo URL of the Connected App, if any. client_id_metadata_url: type: string required: - client_id - client_name - client_description - status - full_access_allowed - client_type - redirect_urls - access_token_expiry_minutes - access_token_template_content - post_logout_redirect_urls - bypass_consent_for_offline_access - creation_method api_connectedapps_v1_ConnectedAppPublic: type: object properties: client_id: type: string client_name: type: string client_description: type: string client_type: type: string logo_url: type: string required: - client_id - client_name - client_description - client_type api_connectedapps_v1_ConnectedAppWithClientSecret: type: object properties: client_id: type: string description: The ID of the Connected App client. client_name: type: string description: A human-readable name for the client. client_description: type: string description: A human-readable description for the client. status: type: string full_access_allowed: type: boolean description: Valid for first party clients only. If `true`, an authorization token granted to this Client can be exchanged for a full Stytch session. client_type: type: string description: The type of Connected App. Supported values are `first_party`, `first_party_public`, `third_party`, and `third_party_public`. redirect_urls: type: array items: type: string description: Array of redirect URI values for use in OAuth Authorization flows. access_token_expiry_minutes: type: integer format: int32 access_token_template_content: type: string post_logout_redirect_urls: type: array items: type: string description: Array of redirect URI values for use in OIDC Logout flows. bypass_consent_for_offline_access: type: boolean description: Valid for first party clients only. If true, the client does not need to request explicit user consent for the `offline_access` scope. client_secret_last_four: type: string description: The last four characters of the client secret. next_client_secret_last_four: type: string description: The last four characters of the `next_client_secret`. Null if no `next_client_secret` exists. client_secret: type: string description: The secret of the Connected App client. **Required for confidential clients** access_token_custom_audience: type: string logo_url: type: string description: The logo URL of the Connected App, if any. client_id_metadata_url: type: string required: - client_id - client_name - client_description - status - full_access_allowed - client_type - redirect_urls - access_token_expiry_minutes - access_token_template_content - post_logout_redirect_urls - bypass_consent_for_offline_access api_connectedapps_v1_ConnectedAppWithNextClientSecret: type: object properties: client_id: type: string description: The ID of the Connected App client. client_name: type: string description: A human-readable name for the client. client_description: type: string description: A human-readable description for the client. status: type: string client_secret_last_four: type: string description: The last four characters of the client secret. full_access_allowed: type: boolean description: Valid for first party clients only. If `true`, an authorization token granted to this Client can be exchanged for a full Stytch session. client_type: type: string description: The type of Connected App. Supported values are `first_party`, `first_party_public`, `third_party`, and `third_party_public`. redirect_urls: type: array items: type: string description: Array of redirect URI values for use in OAuth Authorization flows. next_client_secret: type: string access_token_expiry_minutes: type: integer format: int32 access_token_template_content: type: string post_logout_redirect_urls: type: array items: type: string description: Array of redirect URI values for use in OIDC Logout flows. bypass_consent_for_offline_access: type: boolean description: Valid for first party clients only. If true, the client does not need to request explicit user consent for the `offline_access` scope. next_client_secret_last_four: type: string description: The last four characters of the `next_client_secret`. Null if no `next_client_secret` exists. access_token_custom_audience: type: string logo_url: type: string description: The logo URL of the Connected App, if any. client_id_metadata_url: type: string required: - client_id - client_name - client_description - status - client_secret_last_four - full_access_allowed - client_type - redirect_urls - next_client_secret - access_token_expiry_minutes - access_token_template_content - post_logout_redirect_urls - bypass_consent_for_offline_access api_connectedapps_v1_ResultsMetadata: type: object properties: total: type: integer format: int32 description: The total number of results returned by your search query. If totals have been disabled for your Stytch Workspace to improve search performance, the value will always be -1. next_cursor: type: string description: The `next_cursor` string is returned when your search result contains more than one page of results. This value is passed into your next search call in the `cursor` field. required: - total api_connectedapps_v1_connected_apps_clients_CreateRequest: type: object properties: client_type: $ref: '#/components/schemas/api_connectedapps_v1_CreateRequestClientType' description: The type of Connected App. Supported values are `first_party`, `first_party_public`, `third_party`, and `third_party_public`. client_name: type: string description: A human-readable name for the client. client_description: type: string description: A human-readable description for the client. redirect_urls: type: array items: type: string description: Array of redirect URI values for use in OAuth Authorization flows. full_access_allowed: type: boolean description: Valid for first party clients only. If `true`, an authorization token granted to this Client can be exchanged for a full Stytch session. access_token_expiry_minutes: type: integer format: int32 description: The number of minutes before the access token expires. The default is 60 minutes. access_token_custom_audience: type: string description: The custom audience for the access token. access_token_template_content: type: string description: The content of the access token custom claims template. The template must be a valid JSON object. post_logout_redirect_urls: type: array items: type: string description: Array of redirect URI values for use in OIDC Logout flows. logo_url: type: string description: The logo URL of the Connected App, if any. bypass_consent_for_offline_access: type: boolean description: Valid for first party clients only. If true, the client does not need to request explicit user consent for the `offline_access` scope. description: Request type required: - client_type api_connectedapps_v1_connected_apps_clients_CreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. connected_app: $ref: '#/components/schemas/api_connectedapps_v1_ConnectedAppWithClientSecret' description: The Connected App created by this API call. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - connected_app - status_code api_connectedapps_v1_connected_apps_clients_DeleteResponse: type: object properties: request_id: type: string client_id: type: string description: The ID of the client. status_code: type: integer format: int32 required: - request_id - client_id - status_code api_connectedapps_v1_connected_apps_clients_GetRequest: type: object properties: {} description: Request type api_connectedapps_v1_connected_apps_clients_GetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. connected_app: $ref: '#/components/schemas/api_connectedapps_v1_ConnectedApp' description: The Connected App affected by this operation. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - connected_app - status_code api_connectedapps_v1_connected_apps_clients_SearchRequest: type: object properties: cursor: 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. limit: 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. description: Request type api_connectedapps_v1_connected_apps_clients_SearchResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. connected_apps: type: array items: $ref: '#/components/schemas/api_connectedapps_v1_ConnectedApp' results_metadata: $ref: '#/components/schemas/api_connectedapps_v1_ResultsMetadata' description: The search `results_metadata` object contains metadata relevant to your specific query like total and `next_cursor`. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - connected_apps - results_metadata - status_code api_connectedapps_v1_connected_apps_clients_UpdateRequest: type: object properties: client_name: type: string description: A human-readable name for the client. client_description: type: string description: A human-readable description for the client. redirect_urls: type: array items: type: string description: Array of redirect URI values for use in OAuth Authorization flows. full_access_allowed: type: boolean description: Valid for first party clients only. If `true`, an authorization token granted to this Client can be exchanged for a full Stytch session. access_token_expiry_minutes: type: integer format: int32 description: The number of minutes before the access token expires. The default is 60 minutes. access_token_custom_audience: type: string description: The custom audience for the access token. access_token_template_content: type: string description: The content of the access token custom claims template. The template must be a valid JSON object. post_logout_redirect_urls: type: array items: type: string description: Array of redirect URI values for use in OIDC Logout flows. logo_url: type: string description: The logo URL of the Connected App, if any. bypass_consent_for_offline_access: type: boolean description: Valid for first party clients only. If true, the client does not need to request explicit user consent for the `offline_access` scope. description: Request type api_connectedapps_v1_connected_apps_clients_UpdateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. connected_app: $ref: '#/components/schemas/api_connectedapps_v1_ConnectedApp' description: The Connected App affected by this operation. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - connected_app - status_code api_connectedapps_v1_CreateRequestClientType: type: string enum: - first_party - first_party_public - third_party - third_party_public api_connectedapps_v1_connected_apps_clients_secrets_RotateCancelRequest: type: object properties: {} description: Request type api_connectedapps_v1_connected_apps_clients_secrets_RotateCancelResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. connected_app: $ref: '#/components/schemas/api_connectedapps_v1_ConnectedApp' description: The Connected App affected by this operation. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - connected_app - status_code api_connectedapps_v1_connected_apps_clients_secrets_RotateRequest: type: object properties: {} description: Request type api_connectedapps_v1_connected_apps_clients_secrets_RotateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. connected_app: $ref: '#/components/schemas/api_connectedapps_v1_ConnectedApp' description: The Connected App affected by this operation. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - connected_app - status_code api_connectedapps_v1_connected_apps_clients_secrets_RotateStartRequest: type: object properties: {} description: Request type api_connectedapps_v1_connected_apps_clients_secrets_RotateStartResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. connected_app: $ref: '#/components/schemas/api_connectedapps_v1_ConnectedAppWithNextClientSecret' description: The Connected App affected by this operation. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - connected_app - status_code api_b2b_scim_v1_Address: type: object properties: formatted: type: string street_address: type: string locality: type: string region: type: string postal_code: type: string country: type: string type: type: string primary: type: boolean required: - formatted - street_address - locality - region - postal_code - country - type - primary api_b2b_scim_v1_Email: type: object properties: value: type: string type: type: string primary: type: boolean required: - value - type - primary api_b2b_scim_v1_EnterpriseExtension: type: object properties: employee_number: type: string cost_center: type: string division: type: string department: type: string organization: type: string manager: $ref: '#/components/schemas/api_b2b_scim_v1_Manager' required: - employee_number - cost_center - division - department - organization api_b2b_scim_v1_Entitlement: type: object properties: value: type: string type: type: string primary: type: boolean required: - value - type - primary api_b2b_scim_v1_Group: type: object properties: value: type: string display: type: string required: - value - display api_b2b_scim_v1_IMs: type: object properties: value: type: string type: type: string primary: type: boolean required: - value - type - primary api_b2b_scim_v1_Manager: type: object properties: value: type: string ref: type: string display_name: type: string required: - value - ref - display_name api_b2b_scim_v1_Name: type: object properties: formatted: type: string family_name: type: string given_name: type: string middle_name: type: string honorific_prefix: type: string honorific_suffix: type: string required: - formatted - family_name - given_name - middle_name - honorific_prefix - honorific_suffix api_b2b_scim_v1_PhoneNumber: type: object properties: value: type: string type: type: string primary: type: boolean required: - value - type - primary api_b2b_scim_v1_Photo: type: object properties: value: type: string type: type: string primary: type: boolean required: - value - type - primary api_b2b_scim_v1_Role: type: object properties: value: type: string type: type: string primary: type: boolean required: - value - type - primary api_b2b_scim_v1_SCIMAttributes: type: object properties: user_name: type: string id: type: string external_id: type: string active: type: boolean groups: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_Group' display_name: type: string nick_name: type: string profile_url: type: string user_type: type: string title: type: string preferred_language: type: string locale: type: string timezone: type: string emails: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_Email' phone_numbers: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_PhoneNumber' addresses: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_Address' ims: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_IMs' photos: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_Photo' entitlements: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_Entitlement' roles: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_Role' x509certificates: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_X509Certificate' name: $ref: '#/components/schemas/api_b2b_scim_v1_Name' enterprise_extension: $ref: '#/components/schemas/api_b2b_scim_v1_EnterpriseExtension' required: - user_name - id - external_id - active - groups - display_name - nick_name - profile_url - user_type - title - preferred_language - locale - timezone - emails - phone_numbers - addresses - ims - photos - entitlements - roles - x509certificates api_b2b_scim_v1_SCIMConnection: type: object properties: organization_id: 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. connection_id: type: string description: The ID of the SCIM connection. status: type: string description: The status of the connection. The possible values are deleted or active. display_name: type: string description: A human-readable display name for the connection. identity_provider: type: string description: "Name of the IdP. Enum with possible values: `okta`, `microsoft-entra`,\ \ `cyberark`, `jumpcloud`, `onelogin`, `pingfederate`, `rippling` or `generic`.\ \ \n\nSpecifying a known provider allows Stytch to handle any provider-specific\ \ logic, such as automatically appending `?aadOptscim062020` to the returned\ \ BaseURL for `microsoft-entra` SCIM Connections to [enable the SCIM 2.0\ \ compliant flag](https://learn.microsoft.com/en-us/entra/identity/app-provisioning/application-provisioning-config-problem-scim-compatibility#scim-20-compliance-issues-and-status)." base_url: type: string description: The URL supplied to the Identity Provider (IdP) alongside the bearer token enabling access to Stytch's SCIM API endpoints bearer_token_last_four: type: string description: The last four digits of the bearer token. If you've lost access to your `bearer_token` and need to generate a new one, use the [SCIM rotate token start endpoint](https://stytch.com/docs/b2b/api/scim-rotate-token-start). scim_group_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_SCIMGroupImplicitRoleAssignments' description: An array of SCIM group implicit role assignments. Each object in the array must contain a `group_id` and a `role_id`. next_bearer_token_last_four: type: string bearer_token_expires_at: type: string description: The bearer token expiry time. next_bearer_token_expires_at: type: string description: This field is supplied only during [token rotation](https://stytch.com/docs/b2b/api/scim-rotate-token-start). The next bearer token expiry time. required: - organization_id - connection_id - status - display_name - identity_provider - base_url - bearer_token_last_four - scim_group_implicit_role_assignments - next_bearer_token_last_four api_b2b_scim_v1_SCIMConnectionWithNextToken: type: object properties: organization_id: 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. connection_id: type: string description: The ID of the SCIM connection. status: type: string description: The status of the connection. The possible values are deleted or active. display_name: type: string description: A human-readable display name for the connection. base_url: type: string description: The URL supplied to the Identity Provider (IdP) alongside the bearer token enabling access to Stytch's SCIM API endpoints identity_provider: type: string description: "Name of the IdP. Enum with possible values: `okta`, `microsoft-entra`,\ \ `cyberark`, `jumpcloud`, `onelogin`, `pingfederate`, `rippling` or `generic`.\ \ \n\nSpecifying a known provider allows Stytch to handle any provider-specific\ \ logic, such as automatically appending `?aadOptscim062020` to the returned\ \ BaseURL for `microsoft-entra` SCIM Connections to [enable the SCIM 2.0\ \ compliant flag](https://learn.microsoft.com/en-us/entra/identity/app-provisioning/application-provisioning-config-problem-scim-compatibility#scim-20-compliance-issues-and-status)." bearer_token_last_four: type: string description: The last four digits of the bearer token. If you've lost access to your `bearer_token` and need to generate a new one, use the [SCIM rotate token start endpoint](https://stytch.com/docs/b2b/api/scim-rotate-token-start). next_bearer_token: type: string description: This field is supplied only during [token rotation](https://stytch.com/docs/b2b/api/scim-rotate-token-start). This token should be used as the new bearer token for the SCIM connection after token rotation has been completed using the [SCIM rotate token complete endpoint](https://stytch.com/docs/b2b/api/scim-rotate-token-complete). scim_group_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_SCIMGroupImplicitRoleAssignments' description: An array of SCIM group implicit role assignments. Each object in the array must contain a `group_id` and a `role_id`. bearer_token_expires_at: type: string description: The bearer token expiry time. next_bearer_token_expires_at: type: string description: This field is supplied only during [token rotation](https://stytch.com/docs/b2b/api/scim-rotate-token-start). The next bearer token expiry time. required: - organization_id - connection_id - status - display_name - base_url - identity_provider - bearer_token_last_four - next_bearer_token - scim_group_implicit_role_assignments api_b2b_scim_v1_SCIMConnectionWithToken: type: object properties: organization_id: 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. connection_id: type: string description: The ID of the SCIM connection. status: type: string description: The status of the connection. The possible values are deleted or active. display_name: type: string description: A human-readable display name for the connection. identity_provider: type: string description: "Name of the IdP. Enum with possible values: `okta`, `microsoft-entra`,\ \ `cyberark`, `jumpcloud`, `onelogin`, `pingfederate`, `rippling` or `generic`.\ \ \n\nSpecifying a known provider allows Stytch to handle any provider-specific\ \ logic, such as automatically appending `?aadOptscim062020` to the returned\ \ BaseURL for `microsoft-entra` SCIM Connections to [enable the SCIM 2.0\ \ compliant flag](https://learn.microsoft.com/en-us/entra/identity/app-provisioning/application-provisioning-config-problem-scim-compatibility#scim-20-compliance-issues-and-status)." base_url: type: string description: The URL supplied to the Identity Provider (IdP) alongside the bearer token enabling access to Stytch's SCIM API endpoints bearer_token: type: string description: The token supplied to the Identity Provider (IdP) alongside the base URL that grants access to Stytch's SCIM API endpoints. It should be included in HTTP authorization headers. This field is supplied only on creation of the SCIM connection. scim_group_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_SCIMGroupImplicitRoleAssignments' description: An array of SCIM group implicit role assignments. Each object in the array must contain a `group_id` and a `role_id`. bearer_token_expires_at: type: string description: The bearer token expiry time. required: - organization_id - connection_id - status - display_name - identity_provider - base_url - bearer_token - scim_group_implicit_role_assignments api_b2b_scim_v1_SCIMGroup: type: object properties: group_id: type: string description: Stytch-issued, globally unique UUID that identifies a specific SCIM Group. The entity `id` in the SCIM specification is issued by the Service Provider (SP) and returned to the Identity Provider (IdP) to store and use for uniquely identify and updating the Group moving forward. group_name: type: string description: The displayName of the SCIM group, sent from the Identity Provider (IdP). organization_id: 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. connection_id: type: string description: The ID of the SCIM connection. required: - group_id - group_name - organization_id - connection_id api_b2b_scim_v1_SCIMGroupImplicitRoleAssignments: type: object properties: role_id: type: string description: The ID of the role. group_id: type: string description: The ID of the group. group_name: type: string required: - role_id - group_id - group_name api_b2b_scim_v1_X509Certificate: type: object properties: value: type: string type: type: string primary: type: boolean required: - value - type - primary api_b2b_scim_v1_b2b_scim_connection_CreateRequest: type: object properties: display_name: type: string description: A human-readable display name for the connection. identity_provider: $ref: '#/components/schemas/api_b2b_scim_v1_CreateRequestIdentityProvider' description: Request type api_b2b_scim_v1_b2b_scim_connection_CreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_b2b_scim_v1_SCIMConnectionWithToken' description: The [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object). required: - request_id - status_code api_b2b_scim_v1_b2b_scim_connection_DeleteResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. connection_id: type: string description: The `connection_id` that was deleted as part of the delete request. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - connection_id - status_code api_b2b_scim_v1_b2b_scim_connection_GetGroupsRequest: type: object properties: cursor: 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. limit: 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. description: Request type api_b2b_scim_v1_b2b_scim_connection_GetGroupsResponse: type: object properties: scim_groups: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_SCIMGroup' description: A list of SCIM Connection Groups belonging to the connection. status_code: type: integer format: int32 next_cursor: type: string description: The `next_cursor` string is returned when your search result contains more than one page of results. This value is passed into your next search call in the `cursor` field. required: - scim_groups - status_code api_b2b_scim_v1_b2b_scim_connection_GetRequest: type: object properties: {} description: Request type api_b2b_scim_v1_b2b_scim_connection_GetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_b2b_scim_v1_SCIMConnection' description: The [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object). required: - request_id - status_code api_b2b_scim_v1_b2b_scim_connection_RotateCancelRequest: type: object properties: {} description: Request type api_b2b_scim_v1_b2b_scim_connection_RotateCancelResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_b2b_scim_v1_SCIMConnection' description: The [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object). required: - request_id - status_code api_b2b_scim_v1_b2b_scim_connection_RotateCompleteRequest: type: object properties: {} description: Request type api_b2b_scim_v1_b2b_scim_connection_RotateCompleteResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_b2b_scim_v1_SCIMConnection' description: The [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object). required: - request_id - status_code api_b2b_scim_v1_b2b_scim_connection_RotateStartRequest: type: object properties: {} description: Request type api_b2b_scim_v1_b2b_scim_connection_RotateStartResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_b2b_scim_v1_SCIMConnectionWithNextToken' description: The [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object). required: - request_id - status_code api_b2b_scim_v1_b2b_scim_connection_UpdateRequest: type: object properties: display_name: type: string description: A human-readable display name for the connection. identity_provider: $ref: '#/components/schemas/api_b2b_scim_v1_UpdateRequestIdentityProvider' scim_group_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_b2b_scim_v1_SCIMGroupImplicitRoleAssignments' description: An array of SCIM group implicit role assignments. Each object in the array must contain a `group_id` and a `role_id`. description: Request type api_b2b_scim_v1_b2b_scim_connection_UpdateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_b2b_scim_v1_SCIMConnection' description: The [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object). required: - request_id - status_code api_b2b_scim_v1_CreateRequestIdentityProvider: type: string enum: - generic - okta - microsoft-entra - cyberark - jumpcloud - onelogin - pingfederate - rippling api_b2b_scim_v1_UpdateRequestIdentityProvider: type: string enum: - generic - okta - microsoft-entra - cyberark - jumpcloud - onelogin - pingfederate - rippling api_organization_v1_ActiveSCIMConnection: type: object properties: connection_id: type: string description: The ID of the SCIM connection. display_name: type: string description: A human-readable display name for the connection. bearer_token_last_four: type: string bearer_token_expires_at: type: string required: - connection_id - display_name - bearer_token_last_four api_organization_v1_ActiveSSOConnection: type: object properties: connection_id: type: string description: Globally unique UUID that identifies a specific SSO `connection_id` for a Member. display_name: type: string description: A human-readable display name for the connection. identity_provider: type: string required: - connection_id - display_name - identity_provider api_organization_v1_CustomRole: type: object properties: role_id: type: string description: type: string permissions: type: array items: $ref: '#/components/schemas/api_organization_v1_CustomRolePermission' required: - role_id - description - permissions api_organization_v1_CustomRolePermission: type: object properties: resource_id: type: string actions: type: array items: type: string required: - resource_id - actions api_organization_v1_EmailImplicitRoleAssignment: type: object properties: domain: type: string description: Email domain that grants the specified Role. role_id: type: string description: "The unique identifier of the RBAC Role, provided by the developer\ \ and intended to be human-readable.\n\n Reserved `role_id`s that are\ \ predefined by Stytch include:\n\n * `stytch_member`\n * `stytch_admin`\n\ \n Check out the [guide on Stytch default Roles](https://stytch.com/docs/b2b/guides/rbac/stytch-default)\ \ for a more detailed explanation.\n\n " required: - domain - role_id api_organization_v1_GithubProviderInfo: type: object properties: provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. provider_tenant_ids: type: array items: type: string description: All tenant IDs returned by the OAuth provider. These is typically used to identify organizations or groups within the provider's domain. For example, in HubSpot this is a Hub ID, in Slack this is the Workspace ID, and in GitHub this is an organization ID. Some OAuth providers do not return tenant IDs, some providers are guaranteed to return one, and some may return multiple. This field will always be populated if at least one tenant ID was returned from the OAuth provider and developers should prefer this field over `provider_tenant_id`. access_token: type: string description: The `access_token` that you may use to access the User's data in the provider's API. scopes: type: array items: type: string description: The OAuth scopes included for a given provider. See each provider's section above to see which scopes are included by default and how to add custom scopes. required: - provider_subject - provider_tenant_ids - access_token - scopes api_organization_v1_HubspotProviderInfo: type: object properties: provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. provider_tenant_id: type: string description: The tenant ID returned by the OAuth provider. This is typically used to identify an organization or group within the provider's domain. For example, in HubSpot this is a Hub ID, in Slack this is the Workspace ID, and in GitHub this is an organization ID. This field will only be populated if exactly one tenant ID is returned from a successful OAuth authentication and developers should prefer `provider_tenant_ids` over this since it accounts for the possibility of an OAuth provider yielding multiple tenant IDs. access_token: type: string description: The `access_token` that you may use to access the User's data in the provider's API. access_token_expires_in: type: integer format: int32 description: The number of seconds until the access token expires. scopes: type: array items: type: string description: The OAuth scopes included for a given provider. See each provider's section above to see which scopes are included by default and how to add custom scopes. refresh_token: type: string description: The `refresh_token` that you may use to obtain a new `access_token` for the User within the provider's API. required: - provider_subject - provider_tenant_id - access_token - access_token_expires_in - scopes api_organization_v1_Member: type: object properties: organization_id: 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. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. email_address: type: string description: The email address of the Member. status: type: string description: 'The status of the Member. The possible values are: `pending`, `invited`, `active`, or `deleted`.' name: type: string description: The name of the Member. sso_registrations: type: array items: $ref: '#/components/schemas/api_organization_v1_SSORegistration' description: An array of registered [SAML Connection](https://stytch.com/docs/b2b/api/saml-connection-object) or [OIDC Connection](https://stytch.com/docs/b2b/api/oidc-connection-object) objects the Member has authenticated with. is_breakglass: type: boolean description: Identifies the Member as a break glass user - someone who has permissions to authenticate into an Organization by bypassing the Organization's settings. A break glass account is typically used for emergency purposes to gain access outside of normal authentication procedures. Refer to the [Organization object](https://stytch.com/docs/b2b/api/organization-object) and its `auth_methods` and `allowed_auth_methods` fields for more details. member_password_id: type: string description: Globally unique UUID that identifies a Member's password. oauth_registrations: type: array items: $ref: '#/components/schemas/api_organization_v1_OAuthRegistration' description: A list of OAuth registrations for this member. email_address_verified: type: boolean description: Whether or not the Member's email address is verified. mfa_phone_number_verified: type: boolean description: Whether or not the Member's phone number is verified. is_admin: type: boolean description: "Whether or not the Member has the `stytch_admin` Role. This\ \ Role is automatically granted to Members\n who create an Organization\ \ through the [discovery flow](https://stytch.com/docs/b2b/api/create-organization-via-discovery).\ \ See the\n [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/stytch-default)\ \ for more details on this Role." totp_registration_id: type: string description: Globally unique UUID that identifies a TOTP instance. retired_email_addresses: type: array items: $ref: '#/components/schemas/api_organization_v1_RetiredEmail' description: "\n A list of retired email addresses for this member.\n \ \ A previously active email address can be marked as retired in one of\ \ two ways:\n - It's replaced with a new primary email address during\ \ an explicit Member update.\n - A new email address is surfaced by an\ \ OAuth, SAML or OIDC provider. In this case the new email address becomes\ \ the\n Member's primary email address and the old primary email address\ \ is retired.\n \n A retired email address cannot be used by other Members\ \ in the same Organization. However, unlinking retired email\n addresses\ \ allows them to be subsequently re-used by other Organization Members.\ \ Retired email addresses can be unlinked\n using the [Unlink Retired\ \ Email endpoint](https://stytch.com/docs/b2b/api/unlink-retired-member-email).\n\ \ " is_locked: type: boolean description: Whether the Member is temporarily locked due to too many failed authentication attempts. See the [User Locking Guide](https://stytch.com/docs/resources/platform/user-locks) for more information. mfa_enrolled: type: boolean description: Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step whenever they wish to log in to their Organization. If false, the Member only needs to complete an MFA step if the Organization's MFA policy is set to `REQUIRED_FOR_ALL`. mfa_phone_number: type: string description: The Member's phone number. A Member may only have one phone number. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX). default_mfa_method: type: string description: The Member's default MFA method. This value is used to determine which secondary MFA method to use in the case of multiple methods registered for a Member. The current possible values are `sms_otp` and `totp`. roles: type: array items: $ref: '#/components/schemas/api_organization_v1_MemberRole' description: "Explicit or implicit Roles assigned to this Member, along\ \ with details about the role assignment source.\n See the [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\ \ for more information about role assignment." trusted_metadata: type: object additionalProperties: true description: An arbitrary JSON object for storing application-specific data or identity-provider-specific data. untrusted_metadata: type: object additionalProperties: true description: "An arbitrary JSON object of application-specific data. These\ \ fields can be edited directly by the\n frontend SDK, and should not\ \ be used to store critical information. See the [Metadata resource](https://stytch.com/docs/b2b/api/metadata)\n\ \ for complete field behavior details." created_at: type: string description: The timestamp of the Member's creation. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. updated_at: type: string description: The timestamp of when the Member was last updated. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. scim_registration: $ref: '#/components/schemas/api_organization_v1_SCIMRegistration' description: A scim member registration, referencing a [SCIM Connection](https://stytch.com/docs/b2b/api/scim-connection-object) object in use for the Member creation. external_id: type: string description: The ID of the member given by the identity provider. lock_created_at: type: string description: When the member lock was created, if there is one. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. lock_expires_at: type: string description: When the member lock expires, if there is one. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. required: - organization_id - member_id - email_address - status - name - sso_registrations - is_breakglass - member_password_id - oauth_registrations - email_address_verified - mfa_phone_number_verified - is_admin - totp_registration_id - retired_email_addresses - is_locked - mfa_enrolled - mfa_phone_number - default_mfa_method - roles api_organization_v1_MemberConnectedApp: type: object properties: connected_app_id: type: string description: The ID of the Connected App. name: type: string description: The name of the Connected App. description: type: string description: A description of the Connected App. client_type: type: string description: The type of Connected App. Supported values are `first_party`, `first_party_public`, `third_party`, and `third_party_public`. scopes_granted: type: string description: The scopes granted to the Connected App at the completion of the last authorization flow. logo_url: type: string description: The logo URL of the Connected App, if any. required: - connected_app_id - name - description - client_type - scopes_granted api_organization_v1_MemberRole: type: object properties: role_id: type: string description: "The unique identifier of the RBAC Role, provided by the developer\ \ and intended to be human-readable.\n\n Reserved `role_id`s that are\ \ predefined by Stytch include:\n\n * `stytch_member`\n * `stytch_admin`\n\ \n Check out the [guide on Stytch default Roles](https://stytch.com/docs/b2b/guides/rbac/stytch-default)\ \ for a more detailed explanation.\n\n " sources: type: array items: $ref: '#/components/schemas/api_organization_v1_MemberRoleSource' description: A list of sources for this role assignment. A role assignment can come from multiple sources - for example, the Role could be both explicitly assigned and implicitly granted from the Member's email domain. required: - role_id - sources api_organization_v1_MemberRoleSource: type: object properties: type: type: string description: "The type of role assignment. The possible values are:\n \n\ \ `direct_assignment` \u2013 an explicitly assigned Role.\n\n Directly\ \ assigned roles can be updated by passing in the `roles` argument to\ \ the\n [Update Member](https://stytch.com/docs/b2b/api/update-member)\ \ endpoint.\n \n `email_assignment` \u2013 an implicit Role granted by\ \ the Member's email domain, regardless of their login method.\n\n Email\ \ implicit role assignments can be updated by passing in the `rbac_email_implicit_role_assignments`\ \ argument to\n the [Update Organization](https://stytch.com/docs/b2b/api/update-organization)\ \ endpoint.\n \n `sso_connection` \u2013 an implicit Role granted by\ \ the Member's SSO connection. This is currently only available\n for\ \ SAML connections and not for OIDC. If the Member has a SAML Member registration\ \ with the given connection, this\n role assignment will appear in the\ \ list. However, for authorization check purposes (in\n [sessions authenticate](https://stytch.com/docs/b2b/api/authenticate-session)\ \ or in any endpoint that enforces RBAC with session\n headers), the\ \ Member will only be granted the Role if their session contains an authentication\ \ factor with the\n specified SAML connection.\n\n SAML connection implicit\ \ role assignments can be updated by passing in the\n `saml_connection_implicit_role_assignments`\ \ argument to the\n [Update SAML connection](https://stytch.com/docs/b2b/api/update-saml-connection)\ \ endpoint.\n \n `sso_connection_group` \u2013 an implicit Role granted\ \ by the Member's SSO connection and group. This is currently only\n \ \ available for SAML connections and not for OIDC. If the Member has a\ \ SAML Member registration with the given\n connection, and belongs to\ \ a specific group within the IdP, this role assignment will appear in\ \ the list. However,\n for authorization check purposes (in [sessions\ \ authenticate](https://stytch.com/docs/b2b/api/authenticate-session)\ \ or in any endpoint\n that enforces RBAC with session headers), the\ \ Member will only be granted the role if their session contains an\n\ \ authentication factor with the specified SAML connection.\n\n SAML\ \ group implicit role assignments can be updated by passing in the `saml_group_implicit_role_assignments`\n\ \ argument to the [Update SAML connection](https://stytch.com/docs/b2b/api/update-saml-connection)\ \ endpoint.\n\n `scim_connection_group` \u2013 an implicit Role granted\ \ by the Member's SCIM connection and group. If the Member has\n a SCIM\ \ Member registration with the given connection, and belongs to a specific\ \ group within the IdP, this role assignment will appear in the list.\n\ \n SCIM group implicit role assignments can be updated by passing in\ \ the `scim_group_implicit_role_assignments`\n argument to the [Update\ \ SCIM connection](https://stytch.com/docs/b2b/api/update-scim-connection)\ \ endpoint.\n " details: type: object additionalProperties: true description: "An object containing additional metadata about the source\ \ assignment. The fields will vary depending\n on the role assignment\ \ type as follows:\n \n `direct_assignment` \u2013 no additional details.\n\ \ \n `email_assignment` \u2013 will contain the email domain that granted\ \ the assignment.\n \n `sso_connection` \u2013 will contain the `connection_id`\ \ of the SAML connection that granted the assignment.\n \n `sso_connection_group`\ \ \u2013 will contain the `connection_id` of the SAML connection and the\ \ name of the `group`\n that granted the assignment.\n \n `scim_connection_group`\ \ \u2013 will contain the `connection_id` of the SAML connection and the\ \ `group_id`\n that granted the assignment.\n " required: - type api_organization_v1_OAuthRegistration: type: object properties: provider_type: type: string description: Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc. provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. member_oauth_registration_id: type: string description: The unique ID of an OAuth registration. profile_picture_url: type: string description: If available, the `profile_picture_url` is a URL of the User's profile picture set in OAuth identity the provider that the User has authenticated with, e.g. Google profile picture. locale: type: string description: If available, the `locale` is the Member's locale set in the OAuth identity provider that the user has authenticated with. required: - provider_type - provider_subject - member_oauth_registration_id api_organization_v1_OIDCProviderInfo: type: object properties: provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. id_token: type: string description: The `id_token` returned by the OAuth provider. ID Tokens are JWTs that contain structured information about a user. The exact content of each ID Token varies from provider to provider. ID Tokens are returned from OAuth providers that conform to the [OpenID Connect](https://openid.net/foundation/) specification, which is based on OAuth. access_token: type: string description: The `access_token` that you may use to access the User's data in the provider's API. access_token_expires_in: type: integer format: int32 description: The number of seconds until the access token expires. scopes: type: array items: type: string description: The OAuth scopes included for a given provider. See each provider's section above to see which scopes are included by default and how to add custom scopes. connection_id: type: string description: Globally unique UUID that identifies a specific SSO `connection_id` for a Member. refresh_token: type: string description: The `refresh_token` that you may use to obtain a new `access_token` for the User within the provider's API. required: - provider_subject - id_token - access_token - access_token_expires_in - scopes - connection_id api_organization_v1_Organization: type: object properties: organization_id: 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. organization_name: type: string description: The name of the Organization. Must be between 1 and 128 characters in length. organization_logo_url: type: string description: The image URL of the Organization logo. organization_slug: type: string description: 'The unique URL slug of the Organization. The slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`. Must be between 2 and 128 characters in length. Wherever an organization_id is expected in a path or request parameter, you may also use the organization_slug as a convenience.' sso_jit_provisioning: type: string description: "The authentication setting that controls the JIT provisioning\ \ of Members when authenticating via SSO. The accepted values are:\n \n\ \ `ALL_ALLOWED` \u2013 the default setting, new Members will be automatically\ \ provisioned upon successful authentication via any of the Organization's\ \ `sso_active_connections`.\n \n `RESTRICTED` \u2013 only new Members\ \ with SSO logins that comply with `sso_jit_provisioning_allowed_connections`\ \ can be provisioned upon authentication.\n \n `NOT_ALLOWED` \u2013 disable\ \ JIT provisioning via SSO.\n " sso_jit_provisioning_allowed_connections: type: array items: type: string description: "An array of `connection_id`s that reference [SAML Connection\ \ objects](https://stytch.com/docs/b2b/api/saml-connection-object).\n\ \ Only these connections will be allowed to JIT provision Members via\ \ SSO when `sso_jit_provisioning` is set to `RESTRICTED`." sso_active_connections: type: array items: $ref: '#/components/schemas/api_organization_v1_ActiveSSOConnection' description: An array of active [SAML Connection references](https://stytch.com/docs/b2b/api/saml-connection-object) or [OIDC Connection references](https://stytch.com/docs/b2b/api/oidc-connection-object). email_allowed_domains: type: array items: type: string description: "An array of email domains that allow invites or JIT provisioning\ \ for new Members. This list is enforced when either `email_invites` or\ \ `email_jit_provisioning` is set to `RESTRICTED`.\n \n \n Common\ \ domains such as `gmail.com` are not allowed. See the [common email domains\ \ resource](https://stytch.com/docs/b2b/api/common-email-domains) for\ \ the full list." email_jit_provisioning: type: string description: "The authentication setting that controls how a new Member\ \ can be provisioned by authenticating via Email Magic Link or OAuth.\ \ The accepted values are:\n \n `RESTRICTED` \u2013 only new Members\ \ with verified emails that comply with `email_allowed_domains` can be\ \ provisioned upon authentication via Email Magic Link or OAuth.\n \n\ \ `NOT_ALLOWED` \u2013 the default setting, disables JIT provisioning\ \ via Email Magic Link and OAuth.\n " email_invites: type: string description: "The authentication setting that controls how a new Member\ \ can be invited to an organization by email. The accepted values are:\n\ \ \n `ALL_ALLOWED` \u2013 any new Member can be invited to join via email.\n\ \ \n `RESTRICTED` \u2013 only new Members with verified emails that comply\ \ with `email_allowed_domains` can be invited via email.\n \n `NOT_ALLOWED`\ \ \u2013 disable email invites.\n " auth_methods: type: string description: "The setting that controls which authentication methods can\ \ be used by Members of an Organization. The accepted values are:\n \n\ \ `ALL_ALLOWED` \u2013 the default setting which allows all authentication\ \ methods to be used.\n \n `RESTRICTED` \u2013 only methods that comply\ \ with `allowed_auth_methods` can be used for authentication. This setting\ \ does not apply to Members with `is_breakglass` set to `true`.\n " allowed_auth_methods: type: array items: type: string description: "An array of allowed authentication methods. This list is enforced\ \ when `auth_methods` is set to `RESTRICTED`.\n The list's accepted values\ \ are: `sso`, `magic_link`, `email_otp`, `password`, `google_oauth`, `microsoft_oauth`,\ \ `slack_oauth`, `github_oauth`, and `hubspot_oauth`.\n " mfa_policy: type: string description: "The setting that controls the MFA policy for all Members in\ \ the Organization. The accepted values are:\n \n `REQUIRED_FOR_ALL`\ \ \u2013 All Members within the Organization will be required to complete\ \ MFA every time they wish to log in. However, any active Session that\ \ existed prior to this setting change will remain valid.\n \n `OPTIONAL`\ \ \u2013 The default value. The Organization does not require MFA by default\ \ for all Members. Members will be required to complete MFA only if their\ \ `mfa_enrolled` status is set to true.\n " rbac_email_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_organization_v1_EmailImplicitRoleAssignment' description: "Implicit role assignments based off of email domains.\n For\ \ each domain-Role pair, all Members whose email addresses have the specified\ \ email domain will be granted the\n associated Role, regardless of their\ \ login method. See the [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\n\ \ for more information about role assignment." mfa_methods: type: string description: "The setting that controls which MFA methods can be used by\ \ Members of an Organization. The accepted values are:\n \n `ALL_ALLOWED`\ \ \u2013 the default setting which allows all authentication methods to\ \ be used.\n \n `RESTRICTED` \u2013 only methods that comply with `allowed_mfa_methods`\ \ can be used for authentication. This setting does not apply to Members\ \ with `is_breakglass` set to `true`.\n " allowed_mfa_methods: type: array items: type: string description: "An array of allowed MFA authentication methods. This list\ \ is enforced when `mfa_methods` is set to `RESTRICTED`.\n The list's\ \ accepted values are: `sms_otp` and `totp`.\n " oauth_tenant_jit_provisioning: type: string description: "The authentication setting that controls how a new Member\ \ can JIT provision into an organization by tenant. The accepted values\ \ are:\n \n `RESTRICTED` \u2013 only new Members with tenants in `allowed_oauth_tenants`\ \ can JIT provision via tenant.\n \n `NOT_ALLOWED` \u2013 the default\ \ setting, disables JIT provisioning by OAuth Tenant.\n " claimed_email_domains: type: array items: type: string description: A list of email domains that are claimed by the Organization. first_party_connected_apps_allowed_type: type: string description: "The authentication setting that sets the Organization's policy\ \ towards first party Connected Apps. The accepted values are:\n \n `ALL_ALLOWED`\ \ \u2013 the default setting, any first party Connected App in the Project\ \ is permitted for use by Members.\n \n `RESTRICTED` \u2013 only first\ \ party Connected Apps with IDs in `allowed_first_party_connected_apps`\ \ can be used by Members.\n \n `NOT_ALLOWED` \u2013 no first party Connected\ \ Apps are permitted.\n " allowed_first_party_connected_apps: type: array items: type: string description: An array of first party Connected App IDs that are allowed for the Organization. Only used when the Organization's `first_party_connected_apps_allowed_type` is `RESTRICTED`. third_party_connected_apps_allowed_type: type: string description: "The authentication setting that sets the Organization's policy\ \ towards third party Connected Apps. The accepted values are:\n \n `ALL_ALLOWED`\ \ \u2013 the default setting, any third party Connected App in the Project\ \ is permitted for use by Members.\n \n `RESTRICTED` \u2013 only third\ \ party Connected Apps with IDs in `allowed_first_party_connected_apps`\ \ can be used by Members.\n \n `NOT_ALLOWED` \u2013 no third party Connected\ \ Apps are permitted.\n " allowed_third_party_connected_apps: type: array items: type: string description: An array of third party Connected App IDs that are allowed for the Organization. Only used when the Organization's `third_party_connected_apps_allowed_type` is `RESTRICTED`. custom_roles: type: array items: $ref: '#/components/schemas/api_organization_v1_CustomRole' trusted_metadata: type: object additionalProperties: true description: An arbitrary JSON object for storing application-specific data or identity-provider-specific data. created_at: type: string description: The timestamp of the Organization's creation. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. updated_at: type: string description: The timestamp of when the Organization was last updated. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. organization_external_id: type: string description: A unique identifier for the organization. sso_default_connection_id: type: string description: The default connection used for SSO when there are multiple active connections. scim_active_connection: $ref: '#/components/schemas/api_organization_v1_ActiveSCIMConnection' description: An active [SCIM Connection references](https://stytch.com/docs/b2b/api/scim-connection-object). allowed_oauth_tenants: type: object additionalProperties: true description: A map of allowed OAuth tenants. If this field is not passed in, the Organization will not allow JIT provisioning by OAuth Tenant. Allowed keys are "slack", "hubspot", and "github". required: - organization_id - organization_name - organization_logo_url - organization_slug - sso_jit_provisioning - sso_jit_provisioning_allowed_connections - sso_active_connections - email_allowed_domains - email_jit_provisioning - email_invites - auth_methods - allowed_auth_methods - mfa_policy - rbac_email_implicit_role_assignments - mfa_methods - allowed_mfa_methods - oauth_tenant_jit_provisioning - claimed_email_domains - first_party_connected_apps_allowed_type - allowed_first_party_connected_apps - third_party_connected_apps_allowed_type - allowed_third_party_connected_apps - custom_roles api_organization_v1_OrganizationConnectedApp: type: object properties: connected_app_id: type: string name: type: string description: type: string client_type: type: string logo_url: type: string required: - connected_app_id - name - description - client_type api_organization_v1_OrganizationConnectedAppActiveMember: type: object properties: member_id: type: string description: Globally unique UUID that identifies a specific Member. granted_scopes: type: array items: type: string description: Scopes that were granted at the completion of the last authorization flow. required: - member_id - granted_scopes api_organization_v1_ResultsMetadata: type: object properties: total: type: integer format: int32 description: The total number of results returned by your search query. If totals have been disabled for your Stytch Workspace to improve search performance, the value will always be -1. next_cursor: type: string description: The `next_cursor` string is returned when your search result contains more than one page of results. This value is passed into your next search call in the `cursor` field. required: - total api_organization_v1_RetiredEmail: type: object properties: email_id: type: string description: The globally unique UUID of a Member's email. email_address: type: string description: The email address of the Member. required: - email_id - email_address api_organization_v1_SCIMRegistration: type: object properties: connection_id: type: string description: The ID of the SCIM connection. registration_id: type: string description: The unique ID of a SCIM Registration. external_id: type: string description: The ID of the member given by the identity provider. scim_attributes: $ref: '#/components/schemas/api_b2b_scim_v1_SCIMAttributes' description: An object for storing SCIM attributes brought over from the identity provider. required: - connection_id - registration_id api_organization_v1_SSORegistration: type: object properties: connection_id: type: string description: Globally unique UUID that identifies a specific SSO `connection_id` for a Member. external_id: type: string description: The ID of the member given by the identity provider. registration_id: type: string description: The unique ID of an SSO Registration. sso_attributes: type: object additionalProperties: true description: An object for storing SSO attributes brought over from the identity provider. required: - connection_id - external_id - registration_id api_organization_v1_SearchQuery: type: object properties: operator: $ref: '#/components/schemas/api_organization_v1_SearchQueryOperator' description: "The action to perform on the operands. The accepted values\ \ are:\n\n `AND` \u2013 all the operand values provided must match.\n\ \n `OR` \u2013 **[DEPRECATED]** the operator will return any matches\ \ to at least one of the operand values you supply. This parameter is\ \ retained for legacy use cases only and is no longer supported. We strongly\ \ recommend breaking down complex queries into multiple search queries\ \ instead." operands: type: array items: type: object additionalProperties: true description: An array of operand objects that contains all of the filters and values to apply to your search query. required: - operator - operands api_organization_v1_SlackProviderInfo: type: object properties: provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. provider_tenant_id: type: string description: The tenant ID returned by the OAuth provider. This is typically used to identify an organization or group within the provider's domain. For example, in HubSpot this is a Hub ID, in Slack this is the Workspace ID, and in GitHub this is an organization ID. This field will only be populated if exactly one tenant ID is returned from a successful OAuth authentication and developers should prefer `provider_tenant_ids` over this since it accounts for the possibility of an OAuth provider yielding multiple tenant IDs. access_token: type: string description: The `access_token` that you may use to access the User's data in the provider's API. scopes: type: array items: type: string description: The OAuth scopes included for a given provider. See each provider's section above to see which scopes are included by default and how to add custom scopes. bot_access_token: type: string description: The `access_token` that you may use to access data as a bot application in Slack. Use in conjunction with `bot_scopes`. bot_scopes: type: array items: type: string description: The scopes that the bot application has access to in Slack. required: - provider_subject - provider_tenant_id - access_token - scopes - bot_access_token - bot_scopes api_organization_v1_ConnectedAppsRequest: type: object properties: {} description: Request type api_organization_v1_ConnectedAppsResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. connected_apps: type: array items: $ref: '#/components/schemas/api_organization_v1_OrganizationConnectedApp' status_code: type: integer format: int32 required: - request_id - connected_apps - status_code api_organization_v1_CreateRequest: type: object properties: organization_name: type: string description: The name of the Organization. Must be between 1 and 128 characters in length. organization_slug: type: string description: 'The unique URL slug of the Organization. The slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`. Must be between 2 and 128 characters in length. Wherever an organization_id is expected in a path or request parameter, you may also use the organization_slug as a convenience.' organization_logo_url: type: string description: The image URL of the Organization logo. trusted_metadata: type: object additionalProperties: true description: An arbitrary JSON object for storing application-specific data or identity-provider-specific data. organization_external_id: type: string description: An identifier that can be used in API calls wherever a organization_id is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters. External IDs must be unique within a project, but may be reused across different projects in the same workspace. sso_jit_provisioning: type: string description: "The authentication setting that controls the JIT provisioning\ \ of Members when authenticating via SSO. The accepted values are:\n \n\ \ `ALL_ALLOWED` \u2013 the default setting, new Members will be automatically\ \ provisioned upon successful authentication via any of the Organization's\ \ `sso_active_connections`.\n \n `RESTRICTED` \u2013 only new Members\ \ with SSO logins that comply with `sso_jit_provisioning_allowed_connections`\ \ can be provisioned upon authentication.\n \n `NOT_ALLOWED` \u2013 disable\ \ JIT provisioning via SSO.\n " email_allowed_domains: type: array items: type: string description: "An array of email domains that allow invites or JIT provisioning\ \ for new Members. This list is enforced when either `email_invites` or\ \ `email_jit_provisioning` is set to `RESTRICTED`.\n \n \n Common\ \ domains such as `gmail.com` are not allowed. See the [common email domains\ \ resource](https://stytch.com/docs/b2b/api/common-email-domains) for\ \ the full list." email_jit_provisioning: type: string description: "The authentication setting that controls how a new Member\ \ can be provisioned by authenticating via Email Magic Link or OAuth.\ \ The accepted values are:\n \n `RESTRICTED` \u2013 only new Members\ \ with verified emails that comply with `email_allowed_domains` can be\ \ provisioned upon authentication via Email Magic Link or OAuth.\n \n\ \ `NOT_ALLOWED` \u2013 the default setting, disables JIT provisioning\ \ via Email Magic Link and OAuth.\n " email_invites: type: string description: "The authentication setting that controls how a new Member\ \ can be invited to an organization by email. The accepted values are:\n\ \ \n `ALL_ALLOWED` \u2013 any new Member can be invited to join via email.\n\ \ \n `RESTRICTED` \u2013 only new Members with verified emails that comply\ \ with `email_allowed_domains` can be invited via email.\n \n `NOT_ALLOWED`\ \ \u2013 disable email invites.\n " auth_methods: type: string description: "The setting that controls which authentication methods can\ \ be used by Members of an Organization. The accepted values are:\n \n\ \ `ALL_ALLOWED` \u2013 the default setting which allows all authentication\ \ methods to be used.\n \n `RESTRICTED` \u2013 only methods that comply\ \ with `allowed_auth_methods` can be used for authentication. This setting\ \ does not apply to Members with `is_breakglass` set to `true`.\n " allowed_auth_methods: type: array items: type: string description: "An array of allowed authentication methods. This list is enforced\ \ when `auth_methods` is set to `RESTRICTED`.\n The list's accepted values\ \ are: `sso`, `magic_link`, `email_otp`, `password`, `google_oauth`, `microsoft_oauth`,\ \ `slack_oauth`, `github_oauth`, and `hubspot_oauth`.\n " mfa_policy: type: string description: "The setting that controls the MFA policy for all Members in\ \ the Organization. The accepted values are:\n \n `REQUIRED_FOR_ALL`\ \ \u2013 All Members within the Organization will be required to complete\ \ MFA every time they wish to log in. However, any active Session that\ \ existed prior to this setting change will remain valid.\n \n `OPTIONAL`\ \ \u2013 The default value. The Organization does not require MFA by default\ \ for all Members. Members will be required to complete MFA only if their\ \ `mfa_enrolled` status is set to true.\n " rbac_email_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_organization_v1_EmailImplicitRoleAssignment' description: "Implicit role assignments based off of email domains.\n For\ \ each domain-Role pair, all Members whose email addresses have the specified\ \ email domain will be granted the\n associated Role, regardless of their\ \ login method. See the [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\n\ \ for more information about role assignment." mfa_methods: type: string description: "The setting that controls which MFA methods can be used by\ \ Members of an Organization. The accepted values are:\n \n `ALL_ALLOWED`\ \ \u2013 the default setting which allows all authentication methods to\ \ be used.\n \n `RESTRICTED` \u2013 only methods that comply with `allowed_mfa_methods`\ \ can be used for authentication. This setting does not apply to Members\ \ with `is_breakglass` set to `true`.\n " allowed_mfa_methods: type: array items: type: string description: "An array of allowed MFA authentication methods. This list\ \ is enforced when `mfa_methods` is set to `RESTRICTED`.\n The list's\ \ accepted values are: `sms_otp` and `totp`.\n " oauth_tenant_jit_provisioning: type: string description: "The authentication setting that controls how a new Member\ \ can JIT provision into an organization by tenant. The accepted values\ \ are:\n \n `RESTRICTED` \u2013 only new Members with tenants in `allowed_oauth_tenants`\ \ can JIT provision via tenant.\n \n `NOT_ALLOWED` \u2013 the default\ \ setting, disables JIT provisioning by OAuth Tenant.\n " allowed_oauth_tenants: type: object additionalProperties: true description: A map of allowed OAuth tenants. If this field is not passed in, the Organization will not allow JIT provisioning by OAuth Tenant. Allowed keys are "slack", "hubspot", and "github". claimed_email_domains: type: array items: type: string description: A list of email domains that are claimed by the Organization. first_party_connected_apps_allowed_type: $ref: '#/components/schemas/api_organization_v1_CreateRequestFirstPartyConnectedAppsAllowedType' description: "The authentication setting that sets the Organization's policy\ \ towards first party Connected Apps. The accepted values are:\n \n `ALL_ALLOWED`\ \ \u2013 the default setting, any first party Connected App in the Project\ \ is permitted for use by Members.\n \n `RESTRICTED` \u2013 only first\ \ party Connected Apps with IDs in `allowed_first_party_connected_apps`\ \ can be used by Members.\n \n `NOT_ALLOWED` \u2013 no first party Connected\ \ Apps are permitted.\n " allowed_first_party_connected_apps: type: array items: type: string description: An array of first party Connected App IDs that are allowed for the Organization. Only used when the Organization's `first_party_connected_apps_allowed_type` is `RESTRICTED`. third_party_connected_apps_allowed_type: $ref: '#/components/schemas/api_organization_v1_CreateRequestThirdPartyConnectedAppsAllowedType' description: "The authentication setting that sets the Organization's policy\ \ towards third party Connected Apps. The accepted values are:\n \n `ALL_ALLOWED`\ \ \u2013 the default setting, any third party Connected App in the Project\ \ is permitted for use by Members.\n \n `RESTRICTED` \u2013 only third\ \ party Connected Apps with IDs in `allowed_first_party_connected_apps`\ \ can be used by Members.\n \n `NOT_ALLOWED` \u2013 no third party Connected\ \ Apps are permitted.\n " allowed_third_party_connected_apps: type: array items: type: string description: An array of third party Connected App IDs that are allowed for the Organization. Only used when the Organization's `third_party_connected_apps_allowed_type` is `RESTRICTED`. description: Request type required: - organization_name api_organization_v1_CreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - organization - status_code api_organization_v1_DeleteExternalIdResponse: type: object properties: request_id: type: string organization: $ref: '#/components/schemas/api_organization_v1_Organization' status_code: type: integer format: int32 required: - request_id - organization - status_code api_organization_v1_DeleteResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. organization_id: 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. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - organization_id - status_code api_organization_v1_GetConnectedAppRequest: type: object properties: {} description: Request type api_organization_v1_GetConnectedAppResponse: type: object properties: connected_app_id: type: string description: The ID of the Connected App. name: type: string description: The name of the Connected App. description: type: string description: A description of the Connected App. client_type: type: string description: The type of Connected App. Supported values are `first_party`, `first_party_public`, `third_party`, and `third_party_public`. active_members: type: array items: $ref: '#/components/schemas/api_organization_v1_OrganizationConnectedAppActiveMember' description: Details about Members who has installed a Connected App. status_code: type: integer format: int32 logo_url: type: string required: - connected_app_id - name - description - client_type - active_members - status_code api_organization_v1_GetRequest: type: object properties: {} description: Request type api_organization_v1_GetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - organization - status_code api_organization_v1_MetricsRequest: type: object properties: {} api_organization_v1_MetricsResponse: type: object properties: request_id: type: string member_count: type: integer format: int32 minimum: 0 status_code: type: integer format: int32 required: - request_id - member_count - status_code api_organization_v1_SearchRequest: type: object properties: cursor: 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. limit: 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. query: $ref: '#/components/schemas/api_organization_v1_SearchQuery' description: The optional query object contains the operator, i.e. `AND` or `OR`, and the operands that will filter your results. Only an operator is required. If you include no operands, no filtering will be applied. If you include no query object, it will return all Organizations with no filtering applied. description: Request type api_organization_v1_SearchResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. organizations: type: array items: $ref: '#/components/schemas/api_organization_v1_Organization' description: An array of [Organization objects](https://stytch.com/docs/b2b/api/organization-object). results_metadata: $ref: '#/components/schemas/api_organization_v1_ResultsMetadata' description: The search `results_metadata` object contains metadata relevant to your specific query like `total` and `next_cursor`. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - organizations - results_metadata - status_code api_organization_v1_UpdateRequest: type: object properties: organization_name: type: string description: 'The name of the Organization. Must be between 1 and 128 characters in length. If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.info.name` action on the `stytch.organization` Resource.' organization_slug: type: string description: 'The unique URL slug of the Organization. The slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`. Must be between 2 and 128 characters in length. Wherever an organization_id is expected in a path or request parameter, you may also use the organization_slug as a convenience. If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.info.slug` action on the `stytch.organization` Resource.' organization_logo_url: type: string description: 'The image URL of the Organization logo. If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.info.logo-url` action on the `stytch.organization` Resource.' trusted_metadata: type: object additionalProperties: true description: "An arbitrary JSON object for storing application-specific\ \ data or identity-provider-specific data.\n If a session header\ \ is passed into the request, this field may **not** be passed into the\ \ request. You cannot\n update trusted metadata when acting as\ \ a Member." organization_external_id: type: string description: An identifier that can be used in API calls wherever a organization_id is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters. External IDs must be unique within a project, but may be reused across different projects in the same workspace. sso_default_connection_id: type: string description: 'The default connection used for SSO when there are multiple active connections. If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.default-sso-connection` action on the `stytch.organization` Resource.' sso_jit_provisioning: type: string description: "The authentication setting that controls the JIT provisioning\ \ of Members when authenticating via SSO. The accepted values are:\n \n\ \ `ALL_ALLOWED` \u2013 the default setting, new Members will be automatically\ \ provisioned upon successful authentication via any of the Organization's\ \ `sso_active_connections`.\n \n `RESTRICTED` \u2013 only new Members\ \ with SSO logins that comply with `sso_jit_provisioning_allowed_connections`\ \ can be provisioned upon authentication.\n \n `NOT_ALLOWED` \u2013 disable\ \ JIT provisioning via SSO.\n \n\nIf this field is provided and a session\ \ header is passed into the request, the Member Session must have permission\ \ to perform the `update.settings.sso-jit-provisioning` action on the\ \ `stytch.organization` Resource." sso_jit_provisioning_allowed_connections: type: array items: type: string description: "An array of `connection_id`s that reference [SAML Connection\ \ objects](https://stytch.com/docs/b2b/api/saml-connection-object).\n\ \ Only these connections will be allowed to JIT provision Members via\ \ SSO when `sso_jit_provisioning` is set to `RESTRICTED`.\n\nIf this field\ \ is provided and a session header is passed into the request, the Member\ \ Session must have permission to perform the `update.settings.sso-jit-provisioning`\ \ action on the `stytch.organization` Resource." email_allowed_domains: type: array items: type: string description: "An array of email domains that allow invites or JIT provisioning\ \ for new Members. This list is enforced when either `email_invites` or\ \ `email_jit_provisioning` is set to `RESTRICTED`.\n \n \n Common\ \ domains such as `gmail.com` are not allowed. See the [common email domains\ \ resource](https://stytch.com/docs/b2b/api/common-email-domains) for\ \ the full list.\n\nIf this field is provided and a session header is\ \ passed into the request, the Member Session must have permission to\ \ perform the `update.settings.allowed-domains` action on the `stytch.organization`\ \ Resource." email_jit_provisioning: type: string description: "The authentication setting that controls how a new Member\ \ can be provisioned by authenticating via Email Magic Link or OAuth.\ \ The accepted values are:\n \n `RESTRICTED` \u2013 only new Members\ \ with verified emails that comply with `email_allowed_domains` can be\ \ provisioned upon authentication via Email Magic Link or OAuth.\n \n\ \ `NOT_ALLOWED` \u2013 the default setting, disables JIT provisioning\ \ via Email Magic Link and OAuth.\n \n\nIf this field is provided and\ \ a session header is passed into the request, the Member Session must\ \ have permission to perform the `update.settings.email-jit-provisioning`\ \ action on the `stytch.organization` Resource." email_invites: type: string description: "The authentication setting that controls how a new Member\ \ can be invited to an organization by email. The accepted values are:\n\ \ \n `ALL_ALLOWED` \u2013 any new Member can be invited to join via email.\n\ \ \n `RESTRICTED` \u2013 only new Members with verified emails that comply\ \ with `email_allowed_domains` can be invited via email.\n \n `NOT_ALLOWED`\ \ \u2013 disable email invites.\n \n\nIf this field is provided and a\ \ session header is passed into the request, the Member Session must have\ \ permission to perform the `update.settings.email-invites` action on\ \ the `stytch.organization` Resource." auth_methods: type: string description: "The setting that controls which authentication methods can\ \ be used by Members of an Organization. The accepted values are:\n \n\ \ `ALL_ALLOWED` \u2013 the default setting which allows all authentication\ \ methods to be used.\n \n `RESTRICTED` \u2013 only methods that comply\ \ with `allowed_auth_methods` can be used for authentication. This setting\ \ does not apply to Members with `is_breakglass` set to `true`.\n \n\n\ If this field is provided and a session header is passed into the request,\ \ the Member Session must have permission to perform the `update.settings.allowed-auth-methods`\ \ action on the `stytch.organization` Resource." allowed_auth_methods: type: array items: type: string description: "An array of allowed authentication methods. This list is enforced\ \ when `auth_methods` is set to `RESTRICTED`.\n The list's accepted values\ \ are: `sso`, `magic_link`, `email_otp`, `password`, `google_oauth`, `microsoft_oauth`,\ \ `slack_oauth`, `github_oauth`, and `hubspot_oauth`.\n \n\nIf this field\ \ is provided and a session header is passed into the request, the Member\ \ Session must have permission to perform the `update.settings.allowed-auth-methods`\ \ action on the `stytch.organization` Resource." mfa_policy: type: string description: "The setting that controls the MFA policy for all Members in\ \ the Organization. The accepted values are:\n \n `REQUIRED_FOR_ALL`\ \ \u2013 All Members within the Organization will be required to complete\ \ MFA every time they wish to log in. However, any active Session that\ \ existed prior to this setting change will remain valid.\n \n `OPTIONAL`\ \ \u2013 The default value. The Organization does not require MFA by default\ \ for all Members. Members will be required to complete MFA only if their\ \ `mfa_enrolled` status is set to true.\n \n\nIf this field is provided\ \ and a session header is passed into the request, the Member Session\ \ must have permission to perform the `update.settings.mfa-policy` action\ \ on the `stytch.organization` Resource." rbac_email_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_organization_v1_EmailImplicitRoleAssignment' description: "Implicit role assignments based off of email domains.\n For\ \ each domain-Role pair, all Members whose email addresses have the specified\ \ email domain will be granted the\n associated Role, regardless of their\ \ login method. See the [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\n\ \ for more information about role assignment.\n\nIf this field is provided\ \ and a session header is passed into the request, the Member Session\ \ must have permission to perform the `update.settings.implicit-roles`\ \ action on the `stytch.organization` Resource." mfa_methods: type: string description: "The setting that controls which MFA methods can be used by\ \ Members of an Organization. The accepted values are:\n \n `ALL_ALLOWED`\ \ \u2013 the default setting which allows all authentication methods to\ \ be used.\n \n `RESTRICTED` \u2013 only methods that comply with `allowed_mfa_methods`\ \ can be used for authentication. This setting does not apply to Members\ \ with `is_breakglass` set to `true`.\n \n\nIf this field is provided\ \ and a session header is passed into the request, the Member Session\ \ must have permission to perform the `update.settings.allowed-mfa-methods`\ \ action on the `stytch.organization` Resource." allowed_mfa_methods: type: array items: type: string description: "An array of allowed MFA authentication methods. This list\ \ is enforced when `mfa_methods` is set to `RESTRICTED`.\n The list's\ \ accepted values are: `sms_otp` and `totp`.\n \n\nIf this field is provided\ \ and a session header is passed into the request, the Member Session\ \ must have permission to perform the `update.settings.allowed-mfa-methods`\ \ action on the `stytch.organization` Resource." oauth_tenant_jit_provisioning: type: string description: "The authentication setting that controls how a new Member\ \ can JIT provision into an organization by tenant. The accepted values\ \ are:\n \n `RESTRICTED` \u2013 only new Members with tenants in `allowed_oauth_tenants`\ \ can JIT provision via tenant.\n \n `NOT_ALLOWED` \u2013 the default\ \ setting, disables JIT provisioning by OAuth Tenant.\n \n\nIf this field\ \ is provided and a session header is passed into the request, the Member\ \ Session must have permission to perform the `update.settings.oauth-tenant-jit-provisioning`\ \ action on the `stytch.organization` Resource." allowed_oauth_tenants: type: object additionalProperties: true description: 'A map of allowed OAuth tenants. If this field is not passed in, the Organization will not allow JIT provisioning by OAuth Tenant. Allowed keys are "slack", "hubspot", and "github". If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.allowed-oauth-tenants` action on the `stytch.organization` Resource.' claimed_email_domains: type: array items: type: string description: A list of email domains that are claimed by the Organization. first_party_connected_apps_allowed_type: $ref: '#/components/schemas/api_organization_v1_UpdateRequestFirstPartyConnectedAppsAllowedType' description: "The authentication setting that sets the Organization's policy\ \ towards first party Connected Apps. The accepted values are:\n \n `ALL_ALLOWED`\ \ \u2013 the default setting, any first party Connected App in the Project\ \ is permitted for use by Members.\n \n `RESTRICTED` \u2013 only first\ \ party Connected Apps with IDs in `allowed_first_party_connected_apps`\ \ can be used by Members.\n \n `NOT_ALLOWED` \u2013 no first party Connected\ \ Apps are permitted.\n " allowed_first_party_connected_apps: type: array items: type: string description: An array of first party Connected App IDs that are allowed for the Organization. Only used when the Organization's `first_party_connected_apps_allowed_type` is `RESTRICTED`. third_party_connected_apps_allowed_type: $ref: '#/components/schemas/api_organization_v1_UpdateRequestThirdPartyConnectedAppsAllowedType' description: "The authentication setting that sets the Organization's policy\ \ towards third party Connected Apps. The accepted values are:\n \n `ALL_ALLOWED`\ \ \u2013 the default setting, any third party Connected App in the Project\ \ is permitted for use by Members.\n \n `RESTRICTED` \u2013 only third\ \ party Connected Apps with IDs in `allowed_first_party_connected_apps`\ \ can be used by Members.\n \n `NOT_ALLOWED` \u2013 no third party Connected\ \ Apps are permitted.\n " allowed_third_party_connected_apps: type: array items: type: string description: An array of third party Connected App IDs that are allowed for the Organization. Only used when the Organization's `third_party_connected_apps_allowed_type` is `RESTRICTED`. description: Request type api_organization_v1_UpdateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - organization - status_code api_organization_v1_CreateRequestFirstPartyConnectedAppsAllowedType: type: string enum: - ALL_ALLOWED - RESTRICTED - NOT_ALLOWED api_organization_v1_CreateRequestThirdPartyConnectedAppsAllowedType: type: string enum: - ALL_ALLOWED - RESTRICTED - NOT_ALLOWED api_organization_v1_SearchQueryOperator: type: string enum: - OR - AND api_organization_v1_UpdateRequestFirstPartyConnectedAppsAllowedType: type: string enum: - ALL_ALLOWED - RESTRICTED - NOT_ALLOWED api_organization_v1_UpdateRequestThirdPartyConnectedAppsAllowedType: type: string enum: - ALL_ALLOWED - RESTRICTED - NOT_ALLOWED api_organization_v1_organizations_members_CreateRequest: type: object properties: email_address: type: string description: The email address of the Member. name: type: string description: The name of the Member. trusted_metadata: type: object additionalProperties: true description: An arbitrary JSON object for storing application-specific data or identity-provider-specific data. untrusted_metadata: type: object additionalProperties: true description: "An arbitrary JSON object of application-specific data. These\ \ fields can be edited directly by the\n frontend SDK, and should not\ \ be used to store critical information. See the [Metadata resource](https://stytch.com/docs/b2b/api/metadata)\n\ \ for complete field behavior details." create_member_as_pending: type: boolean description: Flag for whether or not to save a Member as `pending` or `active` in Stytch. It defaults to false. If true, new Members will be created with status `pending` in Stytch's backend. Their status will remain `pending` and they will continue to receive signup email templates for every Email Magic Link until that Member authenticates and becomes `active`. If false, new Members will be created with status `active`. is_breakglass: type: boolean description: Identifies the Member as a break glass user - someone who has permissions to authenticate into an Organization by bypassing the Organization's settings. A break glass account is typically used for emergency purposes to gain access outside of normal authentication procedures. Refer to the [Organization object](https://stytch.com/docs/b2b/api/organization-object) and its `auth_methods` and `allowed_auth_methods` fields for more details. mfa_phone_number: type: string description: The Member's phone number. A Member may only have one phone number. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX). mfa_enrolled: type: boolean description: Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step whenever they wish to log in to their Organization. If false, the Member only needs to complete an MFA step if the Organization's MFA policy is set to `REQUIRED_FOR_ALL`. roles: type: array items: type: string description: "Roles to explicitly assign to this Member. See the [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\n\ \ for more information about role assignment." external_id: type: string description: An identifier that can be used in most API calls where a `member_id` is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters. External IDs must be unique within an organization, but may be reused across different organizations in the same project. description: Request type required: - email_address api_organization_v1_organizations_members_CreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - status_code api_organization_v1_organizations_members_DangerouslyGetRequest: type: object properties: include_deleted: type: boolean description: Whether to include deleted Members in the response. Defaults to false. description: Request type api_organization_v1_organizations_members_DeleteExternalIdResponse: type: object properties: request_id: type: string member_id: type: string member: $ref: '#/components/schemas/api_organization_v1_Member' organization: $ref: '#/components/schemas/api_organization_v1_Organization' status_code: type: integer format: int32 required: - request_id - member_id - member - organization - status_code api_organization_v1_organizations_members_DeleteMFAPhoneNumberResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - status_code api_organization_v1_organizations_members_DeletePasswordResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - status_code api_organization_v1_organizations_members_DeleteResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - status_code api_organization_v1_organizations_members_DeleteTOTPResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - status_code api_organization_v1_organizations_members_GetConnectedAppsRequest: type: object properties: {} description: Request type api_organization_v1_organizations_members_GetConnectedAppsResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. connected_apps: type: array items: $ref: '#/components/schemas/api_organization_v1_MemberConnectedApp' description: An array of Connected Apps with which the Member has successfully completed an authorization flow. status_code: type: integer format: int32 required: - request_id - connected_apps - status_code api_organization_v1_organizations_members_GetRequest: type: object properties: member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. email_address: type: string description: The email address of the Member. description: Request type api_organization_v1_organizations_members_GetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - status_code api_organization_v1_organizations_members_OIDCProviderInformationRequest: type: object properties: include_refresh_token: type: boolean description: Whether to return the refresh token Stytch has stored for the OAuth Provider. Defaults to false. **Important:** If your application exchanges the refresh token, Stytch may not be able to automatically refresh access tokens in the future. description: Request type api_organization_v1_organizations_members_OIDCProvidersResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. registrations: type: array items: $ref: '#/components/schemas/api_organization_v1_OIDCProviderInfo' description: A list of tokens the member is registered with. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - registrations - status_code api_organization_v1_organizations_members_ReactivateRequest: type: object properties: {} description: Request type api_organization_v1_organizations_members_ReactivateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - status_code api_organization_v1_organizations_members_SearchRequest: type: object properties: organization_ids: type: array items: type: string description: An array of organization_ids. At least one value is required. cursor: 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. limit: 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. query: $ref: '#/components/schemas/api_organization_v1_SearchQuery' description: The optional query object contains the operator, i.e. `AND` or `OR`, and the operands that will filter your results. Only an operator is required. If you include no operands, no filtering will be applied. If you include no query object, it will return all Members with no filtering applied. description: Request type required: - organization_ids api_organization_v1_organizations_members_SearchResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. members: type: array items: $ref: '#/components/schemas/api_organization_v1_Member' description: An array of [Member objects](https://stytch.com/docs/b2b/api/member-object). results_metadata: $ref: '#/components/schemas/api_organization_v1_ResultsMetadata' description: The search `results_metadata` object contains metadata relevant to your specific query like `total` and `next_cursor`. organizations: type: object additionalProperties: $ref: '#/components/schemas/api_organization_v1_Organization' status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - members - results_metadata - organizations - status_code api_organization_v1_organizations_members_StartEmailUpdateRequest: type: object properties: email_address: type: string description: The new email address for the Member. login_redirect_url: type: string description: "The URL that the Member clicks from the login Email Magic\ \ Link. This URL should be an endpoint in the backend server that\n verifies\ \ the request by querying Stytch's authenticate endpoint and finishes\ \ the login. If this value is not passed, the default login\n redirect\ \ URL that you set in your Dashboard is used. If you have not set a default\ \ login redirect URL, an error is returned." locale: $ref: '#/components/schemas/api_organization_v1_StartEmailUpdateRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' login_template_id: type: string description: "Use a custom template for login emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201CMagic\ \ Links - Login\u201D." delivery_method: $ref: '#/components/schemas/api_organization_v1_StartEmailUpdateRequestDeliveryMethod' description: The method that should be used to verify a member's new email address. The options are `EMAIL_MAGIC_LINK` or `EMAIL_OTP`. This field is optional, if no value is provided, `EMAIL_MAGIC_LINK` will be used. description: Request type required: - email_address api_organization_v1_organizations_members_StartEmailUpdateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - status_code api_organization_v1_organizations_members_UnlinkRetiredEmailRequest: type: object properties: email_id: type: string description: The globally unique UUID of a Member's email. email_address: type: string description: The email address of the Member. description: Request type api_organization_v1_organizations_members_UnlinkRetiredEmailResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. organization_id: 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. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - organization_id - member - organization - status_code api_organization_v1_organizations_members_UpdateRequest: type: object properties: name: type: string description: 'The name of the Member. If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.info.name` action on the `stytch.member` Resource. Alternatively, if the Member Session matches the Member associated with the `member_id` passed in the request, the authorization check will also allow a Member Session that has permission to perform the `update.info.name` action on the `stytch.self` Resource.' trusted_metadata: type: object additionalProperties: true description: "An arbitrary JSON object for storing application-specific\ \ data or identity-provider-specific data.\n If a session header\ \ is passed into the request, this field may **not** be passed into the\ \ request. You cannot\n update trusted metadata when acting as\ \ a Member." untrusted_metadata: type: object additionalProperties: true description: "An arbitrary JSON object of application-specific data. These\ \ fields can be edited directly by the\n frontend SDK, and should not\ \ be used to store critical information. See the [Metadata resource](https://stytch.com/docs/b2b/api/metadata)\n\ \ for complete field behavior details.\n\nIf this field is provided and\ \ a session header is passed into the request, the Member Session must\ \ have permission to perform the `update.info.untrusted-metadata` action\ \ on the `stytch.member` Resource. Alternatively, if the Member Session\ \ matches the Member associated with the `member_id` passed in the request,\ \ the authorization check will also allow a Member Session that has permission\ \ to perform the `update.info.untrusted-metadata` action on the `stytch.self`\ \ Resource." is_breakglass: type: boolean description: 'Identifies the Member as a break glass user - someone who has permissions to authenticate into an Organization by bypassing the Organization''s settings. A break glass account is typically used for emergency purposes to gain access outside of normal authentication procedures. Refer to the [Organization object](https://stytch.com/docs/b2b/api/organization-object) and its `auth_methods` and `allowed_auth_methods` fields for more details. If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.is-breakglass` action on the `stytch.member` Resource.' mfa_phone_number: type: string description: 'Sets the Member''s phone number. Throws an error if the Member already has a phone number. To change the Member''s phone number, use the [Delete member phone number endpoint](https://stytch.com/docs/b2b/api/delete-member-mfa-phone-number) to delete the Member''s existing phone number first. If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.info.mfa-phone` action on the `stytch.member` Resource. Alternatively, if the Member Session matches the Member associated with the `member_id` passed in the request, the authorization check will also allow a Member Session that has permission to perform the `update.info.mfa-phone` action on the `stytch.self` Resource.' mfa_enrolled: type: boolean description: 'Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step whenever they wish to log in to their Organization. If false, the Member only needs to complete an MFA step if the Organization''s MFA policy is set to `REQUIRED_FOR_ALL`. If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.mfa-enrolled` action on the `stytch.member` Resource. Alternatively, if the Member Session matches the Member associated with the `member_id` passed in the request, the authorization check will also allow a Member Session that has permission to perform the `update.settings.mfa-enrolled` action on the `stytch.self` Resource.' roles: type: array items: type: string description: "Roles to explicitly assign to this Member.\n Will completely\ \ replace any existing explicitly assigned roles. See the\n [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\ \ for more information about role assignment.\n\n If a Role is removed\ \ from a Member, and the Member is also implicitly assigned this Role\ \ from an SSO connection\n or an SSO group, we will by default revoke\ \ any existing sessions for the Member that contain any SSO\n authentication\ \ factors with the affected connection ID. You can preserve these sessions\ \ by passing in the\n `preserve_existing_sessions` parameter with a\ \ value of `true`.\n\nIf this field is provided and a session header is\ \ passed into the request, the Member Session must have permission to\ \ perform the `update.settings.roles` action on the `stytch.member` Resource." preserve_existing_sessions: type: boolean description: "Whether to preserve existing sessions when explicit Roles\ \ that are revoked are also implicitly assigned\n by SSO connection or\ \ SSO group. Defaults to `false` - that is, existing Member Sessions that\ \ contain SSO\n authentication factors with the affected SSO connection\ \ IDs will be revoked." default_mfa_method: type: string description: 'The Member''s default MFA method. This value is used to determine which secondary MFA method to use in the case of multiple methods registered for a Member. The current possible values are `sms_otp` and `totp`. If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.default-mfa-method` action on the `stytch.member` Resource. Alternatively, if the Member Session matches the Member associated with the `member_id` passed in the request, the authorization check will also allow a Member Session that has permission to perform the `update.settings.default-mfa-method` action on the `stytch.self` Resource.' email_address: type: string description: "Updates the Member's `email_address`, if provided. This will\ \ clear any existing passwords and require re-verification of the new\ \ email address.\n If a Member's email address is changed, other\ \ Members in the same Organization cannot use the old email address, although\ \ the Member may update back to their old email address.\n A Member's\ \ email address can only be useable again by other Members if the Member\ \ is deleted.\n\nIf this field is provided and a session header is passed\ \ into the request, the Member Session must have permission to perform\ \ the `update.info.email` action on the `stytch.member` Resource. Members\ \ cannot update their own email address." external_id: type: string description: An identifier that can be used in most API calls where a `member_id` is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters. External IDs must be unique within an organization, but may be reused across different organizations in the same project. unlink_email: type: boolean description: If `unlink_email` is `true` and an `email_address` is provided, the Member's previous email will be deleted instead of retired. Defaults to `false`. description: Request type api_organization_v1_organizations_members_UpdateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - status_code api_organization_v1_StartEmailUpdateRequestDeliveryMethod: type: string enum: - EMAIL_MAGIC_LINK - EMAIL_OTP api_organization_v1_StartEmailUpdateRequestLocale: type: string enum: - en - es - pt-br - fr api_organization_v1_organizations_members_oauth_providers_GithubResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. provider_type: type: string description: Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc. registrations: type: array items: $ref: '#/components/schemas/api_organization_v1_GithubProviderInfo' description: A list of tokens the member is registered with. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - provider_type - registrations - status_code api_organization_v1_organizations_members_oauth_providers_GoogleResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. provider_type: type: string description: Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc. provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. id_token: type: string description: The `id_token` returned by the OAuth provider. ID Tokens are JWTs that contain structured information about a user. The exact content of each ID Token varies from provider to provider. ID Tokens are returned from OAuth providers that conform to the [OpenID Connect](https://openid.net/foundation/) specification, which is based on OAuth. scopes: type: array items: type: string description: The OAuth scopes included for a given provider. See each provider's section above to see which scopes are included by default and how to add custom scopes. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. access_token: type: string description: The `access_token` that you may use to access the User's data in the provider's API. access_token_expires_in: type: integer format: int32 description: The number of seconds until the access token expires. refresh_token: type: string description: The `refresh_token` that you may use to obtain a new `access_token` for the User within the provider's API. required: - request_id - provider_type - provider_subject - id_token - scopes - status_code api_organization_v1_organizations_members_oauth_providers_HubspotResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. provider_type: type: string description: Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc. registrations: type: array items: $ref: '#/components/schemas/api_organization_v1_HubspotProviderInfo' description: A list of tokens the member is registered with. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - provider_type - registrations - status_code api_organization_v1_organizations_members_oauth_providers_MicrosoftResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. provider_type: type: string description: Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc. provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. access_token: type: string description: The `access_token` that you may use to access the User's data in the provider's API. access_token_expires_in: type: integer format: int32 description: The number of seconds until the access token expires. id_token: type: string description: The `id_token` returned by the OAuth provider. ID Tokens are JWTs that contain structured information about a user. The exact content of each ID Token varies from provider to provider. ID Tokens are returned from OAuth providers that conform to the [OpenID Connect](https://openid.net/foundation/) specification, which is based on OAuth. scopes: type: array items: type: string description: The OAuth scopes included for a given provider. See each provider's section above to see which scopes are included by default and how to add custom scopes. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. refresh_token: type: string description: The `refresh_token` that you may use to obtain a new `access_token` for the User within the provider's API. required: - request_id - provider_type - provider_subject - access_token - access_token_expires_in - id_token - scopes - status_code api_organization_v1_organizations_members_oauth_providers_ProviderInformationRequest: type: object properties: include_refresh_token: type: boolean description: Whether to return the refresh token Stytch has stored for the OAuth Provider. Defaults to false. **Important:** If your application exchanges the refresh token, Stytch may not be able to automatically refresh access tokens in the future. description: Request type api_organization_v1_organizations_members_oauth_providers_SlackRequest: type: object properties: {} description: Request type api_organization_v1_organizations_members_oauth_providers_SlackResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. provider_type: type: string description: Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc. registrations: type: array items: $ref: '#/components/schemas/api_organization_v1_SlackProviderInfo' description: A list of tokens the member is registered with. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - provider_type - registrations - status_code api_organization_v1_organizations_members_connected_apps_RevokeRequest: type: object properties: {} description: Request type api_organization_v1_organizations_members_connected_apps_RevokeResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 required: - request_id - status_code api_b2b_idp_v1_ScopeResult: type: object properties: scope: type: string description: The name of the scope. description: type: string description: A human-readable description of the scope, taken from the RBAC Policy. is_grantable: type: boolean description: Indicates whether the scope can be granted. Users can only grant scopes if they have the required permissions. required: - scope - description - is_grantable api_b2b_idp_v1_b2b_idp_oauth_AuthorizeRequest: type: object properties: consent_granted: type: boolean description: Indicates whether the user granted the requested scopes. scopes: type: array items: type: string description: An array of scopes requested by the client. client_id: type: string description: The ID of the Connected App client. redirect_uri: type: string description: The callback URI used to redirect the user after authentication. This is the same URI provided at the start of the OAuth flow. This field is required when using the `authorization_code` grant. response_type: type: string description: The OAuth 2.0 response type. For authorization code flows this value is `code`. organization_id: 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. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. prompt: type: string description: Space separated list that specifies how the Authorization Server should prompt the user for reauthentication and consent. Only `consent` is supported today. state: type: string description: An opaque value used to maintain state between the request and callback. nonce: type: string description: A string used to associate a client session with an ID token to mitigate replay attacks. code_challenge: type: string description: A base64url encoded challenge derived from the code verifier for PKCE flows. resources: type: array items: type: string description: Request type required: - consent_granted - scopes - client_id - redirect_uri - response_type api_b2b_idp_v1_b2b_idp_oauth_AuthorizeResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. redirect_uri: type: string description: The callback URI used to redirect the user after authentication. This is the same URI provided at the start of the OAuth flow. This field is required when using the `authorization_code` grant. status_code: type: integer format: int32 authorization_code: type: string description: A one-time use code that can be exchanged for tokens. required: - request_id - redirect_uri - status_code api_b2b_idp_v1_b2b_idp_oauth_AuthorizeStartRequest: type: object properties: client_id: type: string description: The ID of the Connected App client. redirect_uri: type: string description: The callback URI used to redirect the user after authentication. This is the same URI provided at the start of the OAuth flow. This field is required when using the `authorization_code` grant. response_type: type: string description: The OAuth 2.0 response type. For authorization code flows this value is `code`. scopes: type: array items: type: string description: An array of scopes requested by the client. organization_id: 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. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. prompt: type: string description: Space separated list that specifies how the Authorization Server should prompt the user for reauthentication and consent. Only `consent` is supported today. description: Request type required: - client_id - redirect_uri - response_type - scopes api_b2b_idp_v1_b2b_idp_oauth_AuthorizeStartResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). client: $ref: '#/components/schemas/api_connectedapps_v1_ConnectedAppPublic' consent_required: type: boolean description: Whether the user must provide explicit consent for the authorization request. scope_results: type: array items: $ref: '#/components/schemas/api_b2b_idp_v1_ScopeResult' description: Details about each requested scope. status_code: type: integer format: int32 required: - request_id - member_id - member - organization - client - consent_required - scope_results - status_code api_b2b_mfa_v1_MemberOptions: type: object properties: mfa_phone_number: type: string description: The Member's MFA phone number. totp_registration_id: type: string description: The Member's MFA TOTP registration ID. required: - mfa_phone_number - totp_registration_id api_b2b_mfa_v1_MfaRequired: type: object properties: member_options: $ref: '#/components/schemas/api_b2b_mfa_v1_MemberOptions' description: Information about the Member's options for completing MFA. secondary_auth_initiated: type: string description: If null, indicates that no secondary authentication has been initiated. If equal to "sms_otp", indicates that the Member has a phone number, and a one time passcode has been sent to the Member's phone number. No secondary authentication will be initiated during calls to the discovery authenticate or list organizations endpoints, even if the Member has a phone number. api_device_history_v1_DeviceAttributeDetails: type: object properties: is_new: type: boolean description: Whether this `ip_geo_country` has been seen before for this user. first_seen_at: type: string description: When this `ip_geo_country` was first seen for this user. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. last_seen_at: type: string description: When this `ip_geo_country` was last seen for this user. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. required: - is_new api_device_history_v1_DeviceInfo: type: object properties: visitor_id: type: string description: The `visitor_id` (a unique identifier) of the user's device. See the [Device Fingerprinting documentation](https://stytch.com/docs/fraud/guides/device-fingerprinting/fingerprints) for more details on the `visitor_id`. visitor_id_details: $ref: '#/components/schemas/api_device_history_v1_DeviceAttributeDetails' description: Information about the `visitor_id`. ip_address: type: string description: The IP address of the user's device. ip_address_details: $ref: '#/components/schemas/api_device_history_v1_DeviceAttributeDetails' description: Information about the `ip_address`. ip_geo_city: type: string description: The city where the IP address is located. ip_geo_region: type: string description: The region where the IP address is located. ip_geo_country: type: string description: The country code where the IP address is located. ip_geo_country_details: $ref: '#/components/schemas/api_device_history_v1_DeviceAttributeDetails' description: Information about the `ip_geo_country`. required: - visitor_id api_user_v1_BiometricRegistration: type: object properties: biometric_registration_id: type: string description: The unique ID for a biometric registration. verified: type: boolean description: The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User. required: - biometric_registration_id - verified api_user_v1_CryptoWallet: type: object properties: crypto_wallet_id: type: string description: The unique ID for a crypto wallet crypto_wallet_address: type: string description: The actual blockchain address of the User's crypto wallet. crypto_wallet_type: type: string description: The blockchain that the User's crypto wallet operates on, e.g. Ethereum, Solana, etc. verified: type: boolean description: The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User. required: - crypto_wallet_id - crypto_wallet_address - crypto_wallet_type - verified api_user_v1_Email: type: object properties: email_id: type: string description: The unique ID of a specific email address. email: type: string description: The email address. verified: type: boolean description: The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User. required: - email_id - email - verified api_user_v1_Name: type: object properties: first_name: type: string description: The first name of the user. middle_name: type: string description: The middle name(s) of the user. last_name: type: string description: The last name of the user. api_user_v1_OAuthProvider: type: object properties: provider_type: type: string description: Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Facebook, GitHub etc. provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the "sub" or "Subject field" in OAuth protocols. profile_picture_url: type: string description: If available, the `profile_picture_url` is a url of the User's profile picture set in OAuth identity the provider that the User has authenticated with, e.g. Facebook profile picture. locale: type: string description: If available, the `locale` is the User's locale set in the OAuth identity provider that the user has authenticated with. oauth_user_registration_id: type: string description: The unique ID for an OAuth registration. required: - provider_type - provider_subject - profile_picture_url - locale - oauth_user_registration_id api_user_v1_Password: type: object properties: password_id: type: string description: The unique ID of a specific password requires_reset: type: boolean description: Indicates whether this password requires a password reset required: - password_id - requires_reset api_user_v1_PhoneNumber: type: object properties: phone_id: type: string description: The unique ID for the phone number. phone_number: type: string description: The phone number. verified: type: boolean description: The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User. required: - phone_id - phone_number - verified api_user_v1_ResultsMetadata: type: object properties: total: type: integer format: int32 description: The total number of results returned by your search query. If totals have been disabled for your Stytch Workspace to improve search performance, the value will always be -1. next_cursor: type: string description: The `next_cursor` string is returned when your search result contains more than one page of results. This value is passed into your next search call in the `cursor` field. required: - total api_user_v1_SearchUsersQuery: type: object properties: operator: $ref: '#/components/schemas/api_user_v1_SearchUsersQueryOperator' description: "The action to perform on the operands. The accepted values\ \ are:\n\n `AND` \u2013 all the operand values provided must match.\n\ \n `OR` \u2013 **[DEPRECATED]** the operator will return any matches\ \ to at least one of the operand values you supply. This parameter is\ \ retained for legacy use cases only and is no longer supported. We strongly\ \ recommend breaking down complex queries into multiple search queries\ \ instead." operands: type: array items: type: object additionalProperties: true description: An array of operand objects that contains all of the filters and values to apply to your search search query. required: - operator - operands api_user_v1_TOTP: type: object properties: totp_id: type: string description: The unique ID for a TOTP instance. verified: type: boolean description: The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User. required: - totp_id - verified api_user_v1_User: type: object properties: user_id: type: string description: The unique ID of the affected User. emails: type: array items: $ref: '#/components/schemas/api_user_v1_Email' description: An array of email objects for the User. status: type: string description: The status of the User. The possible values are `pending` and `active`. phone_numbers: type: array items: $ref: '#/components/schemas/api_user_v1_PhoneNumber' description: An array of phone number objects linked to the User. webauthn_registrations: type: array items: $ref: '#/components/schemas/api_user_v1_WebAuthnRegistration' description: An array that contains a list of all Passkey or WebAuthn registrations for a given User in the Stytch API. providers: type: array items: $ref: '#/components/schemas/api_user_v1_OAuthProvider' description: An array of OAuth `provider` objects linked to the User. totps: type: array items: $ref: '#/components/schemas/api_user_v1_TOTP' description: An array containing a list of all TOTP instances for a given User in the Stytch API. crypto_wallets: type: array items: $ref: '#/components/schemas/api_user_v1_CryptoWallet' description: An array contains a list of all crypto wallets for a given User in the Stytch API. biometric_registrations: type: array items: $ref: '#/components/schemas/api_user_v1_BiometricRegistration' description: An array that contains a list of all biometric registrations for a given User in the Stytch API. is_locked: type: boolean description: Whether the User is temporarily locked due to too many failed authentication attempts. See the [User Locking Guide](https://stytch.com/docs/resources/platform/user-locks) for more information. roles: type: array items: type: string description: "Roles assigned to this User.\n See the [RBAC guide](https://stytch.com/docs/guides/rbac/role-assignment)\ \ for more information about role assignment." name: $ref: '#/components/schemas/api_user_v1_Name' description: The name of the User. Each field in the `name` object is optional. created_at: type: string description: The timestamp of the User's creation. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. password: $ref: '#/components/schemas/api_user_v1_Password' description: The password object is returned for users with a password. trusted_metadata: type: object additionalProperties: true description: The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. untrusted_metadata: type: object additionalProperties: true description: The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. external_id: type: string description: An identifier that can be used in most API calls where a `member_id` is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters. External IDs must be unique within the project. lock_created_at: type: string description: When the user lock was created, if there is one. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. lock_expires_at: type: string description: When the user lock expires, if there is one. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. required: - user_id - emails - status - phone_numbers - webauthn_registrations - providers - totps - crypto_wallets - biometric_registrations - is_locked - roles api_user_v1_UserConnectedApp: type: object properties: connected_app_id: type: string description: The ID of the Connected App. name: type: string description: The name of the Connected App. description: type: string description: A description of the Connected App. client_type: type: string description: The type of Connected App. Supported values are `first_party`, `first_party_public`, `third_party`, and `third_party_public`. scopes_granted: type: string description: The scopes granted to the Connected App at the completion of the last authorization flow. logo_url: type: string description: The logo URL of the Connected App, if any. required: - connected_app_id - name - description - client_type - scopes_granted api_user_v1_WebAuthnRegistration: type: object properties: webauthn_registration_id: type: string description: The unique ID for the Passkey or WebAuthn registration. domain: type: string description: The `domain` on which Passkey or WebAuthn registration was started. This will be the domain of your app. user_agent: type: string description: The user agent of the User. verified: type: boolean description: The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User. authenticator_type: type: string description: The `authenticator_type` string displays the requested authenticator type of the Passkey or WebAuthn device. The two valid types are "platform" and "cross-platform". If no value is present, the Passkey or WebAuthn device was created without an authenticator type preference. name: type: string description: The `name` of the Passkey or WebAuthn registration. required: - webauthn_registration_id - domain - user_agent - verified - authenticator_type - name api_user_v1_ConnectedAppsRequest: type: object properties: {} description: Request type api_user_v1_ConnectedAppsResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. connected_apps: type: array items: $ref: '#/components/schemas/api_user_v1_UserConnectedApp' description: An array of Connected Apps with which the User has successfully completed an authorization flow. status_code: type: integer format: int32 required: - request_id - connected_apps - status_code api_user_v1_CreateRequest: type: object properties: email: type: string description: The email address of the end user. name: $ref: '#/components/schemas/api_user_v1_Name' description: The name of the user. Each field in the name object is optional. attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' phone_number: type: string description: The phone number to use for one-time passcodes. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX). You may use +10000000000 to test this endpoint, see [Testing](https://stytch.com/docs/home#resources_testing) for more detail. create_user_as_pending: type: boolean description: "Flag for whether or not to save a user as pending vs active\ \ in Stytch. Defaults to false.\n If true, users will be saved\ \ with status pending in Stytch's backend until authenticated.\n \ \ If false, users will be created as active. An example usage of\n \ \ a true flag would be to require users to verify their phone by\ \ entering the OTP code before creating\n an account for them." trusted_metadata: type: object additionalProperties: true description: The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. untrusted_metadata: type: object additionalProperties: true description: The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. external_id: type: string description: An identifier that can be used in API calls wherever a user_id is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters. roles: type: array items: type: string description: "Roles to explicitly assign to this User.\n See the [RBAC\ \ guide](https://stytch.com/docs/guides/rbac/role-assignment) for more\ \ information about role assignment." description: Request type api_user_v1_CreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. email_id: type: string description: The unique ID of a specific email address. status: type: string description: The status of the User. The possible values are `pending` and `active`. phone_id: type: string description: The unique ID for the phone number. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - email_id - status - phone_id - user - status_code api_user_v1_DeleteBiometricRegistrationResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - user - status_code api_user_v1_DeleteCryptoWalletResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - user - status_code api_user_v1_DeleteEmailResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - user - status_code api_user_v1_DeleteExternalIdResponse: type: object properties: request_id: type: string user_id: type: string user: $ref: '#/components/schemas/api_user_v1_User' status_code: type: integer format: int32 required: - request_id - user_id - user - status_code api_user_v1_DeleteOAuthRegistrationResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - user - status_code api_user_v1_DeletePasswordResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - user - status_code api_user_v1_DeletePhoneNumberResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - user - status_code api_user_v1_DeleteResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the deleted User. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - status_code api_user_v1_DeleteTOTPResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - user - status_code api_user_v1_DeleteWebAuthnRegistrationResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - user - status_code api_user_v1_ExchangePrimaryFactorRequest: type: object properties: email_address: type: string description: The email address to exchange to. phone_number: type: string description: The phone number to exchange to. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX). description: Request type api_user_v1_ExchangePrimaryFactorResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - user - status_code api_user_v1_GetRequest: type: object properties: {} description: Request type api_user_v1_GetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the returned User. emails: type: array items: $ref: '#/components/schemas/api_user_v1_Email' description: An array of email objects for the User. status: type: string description: The status of the User. The possible values are `pending` and `active`. phone_numbers: type: array items: $ref: '#/components/schemas/api_user_v1_PhoneNumber' description: An array of phone number objects linked to the User. webauthn_registrations: type: array items: $ref: '#/components/schemas/api_user_v1_WebAuthnRegistration' description: An array that contains a list of all Passkey or WebAuthn registrations for a given User in the Stytch API. providers: type: array items: $ref: '#/components/schemas/api_user_v1_OAuthProvider' description: An array of OAuth `provider` objects linked to the User. totps: type: array items: $ref: '#/components/schemas/api_user_v1_TOTP' description: An array containing a list of all TOTP instances for a given User in the Stytch API. crypto_wallets: type: array items: $ref: '#/components/schemas/api_user_v1_CryptoWallet' description: An array contains a list of all crypto wallets for a given User in the Stytch API. biometric_registrations: type: array items: $ref: '#/components/schemas/api_user_v1_BiometricRegistration' description: An array that contains a list of all biometric registrations for a given User in the Stytch API. is_locked: type: boolean roles: type: array items: type: string description: "Roles assigned to this User.\n See the [RBAC guide](https://stytch.com/docs/guides/rbac/role-assignment)\ \ for more information about role assignment." status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. name: $ref: '#/components/schemas/api_user_v1_Name' description: The name of the User. Each field in the `name` object is optional. created_at: type: string description: The timestamp of the User's creation. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. password: $ref: '#/components/schemas/api_user_v1_Password' description: The password object is returned for users with a password. trusted_metadata: type: object additionalProperties: true description: The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. untrusted_metadata: type: object additionalProperties: true description: The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. external_id: type: string lock_created_at: type: string lock_expires_at: type: string required: - request_id - user_id - emails - status - phone_numbers - webauthn_registrations - providers - totps - crypto_wallets - biometric_registrations - is_locked - roles - status_code api_user_v1_RevokeRequest: type: object properties: {} description: Request type api_user_v1_RevokeResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 required: - request_id - status_code api_user_v1_SearchRequest: type: object properties: cursor: 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. limit: 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. query: $ref: '#/components/schemas/api_user_v1_SearchUsersQuery' description: The optional query object contains the operator, i.e. `AND` or `OR`, and the operands that will filter your results. Only an operator is required. If you include no operands, no filtering will be applied. If you include no query object, it will return all results with no filtering applied. description: Request type api_user_v1_SearchResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. results: type: array items: $ref: '#/components/schemas/api_user_v1_User' description: An array of results that match your search query. results_metadata: $ref: '#/components/schemas/api_user_v1_ResultsMetadata' description: The search `results_metadata` object contains metadata relevant to your specific query like total and `next_cursor`. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - results - results_metadata - status_code api_user_v1_UpdateRequest: type: object properties: name: $ref: '#/components/schemas/api_user_v1_Name' description: The name of the user. Each field in the name object is optional. attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. trusted_metadata: type: object additionalProperties: true description: The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. untrusted_metadata: type: object additionalProperties: true description: The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. external_id: type: string description: An identifier that can be used in API calls wherever a user_id is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters. roles: type: array items: type: string description: "Roles to explicitly assign to this User.\n See the [RBAC\ \ guide](https://stytch.com/docs/guides/rbac/role-assignment) for more\ \ information about role assignment." description: Request type api_user_v1_UpdateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the updated User. emails: type: array items: $ref: '#/components/schemas/api_user_v1_Email' description: An array of email objects for the User. phone_numbers: type: array items: $ref: '#/components/schemas/api_user_v1_PhoneNumber' description: An array of phone number objects linked to the User. crypto_wallets: type: array items: $ref: '#/components/schemas/api_user_v1_CryptoWallet' description: An array contains a list of all crypto wallets for a given User in the Stytch API. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - emails - phone_numbers - crypto_wallets - user - status_code api_user_v1_SearchUsersQueryOperator: type: string enum: - OR - AND api_session_v1_AmazonOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_AppleOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_AuthenticationFactor: type: object properties: type: $ref: '#/components/schemas/api_session_v1_AuthenticationFactorType' description: "The type of authentication factor. The possible values are:\ \ `email_otp`, `impersonated`, `imported`,\n `magic_link`, `oauth`,\ \ `otp`, `password`, `recovery_codes`, `sso`, `trusted_auth_token`, or\ \ `totp`." delivery_method: $ref: '#/components/schemas/api_session_v1_AuthenticationFactorDeliveryMethod' description: "The method that was used to deliver the authentication factor.\ \ The possible values depend on the `type`:\n \n `email_otp`\ \ \u2013 Only `email`.\n \n `impersonated` \u2013 Only `impersonation`.\n\ \ \n `imported` \u2013 Only `imported_auth0`.\n \n \ \ `magic_link` \u2013 Only `email`.\n \n `oauth` \u2013 The delivery\ \ method is determined by the specific OAuth provider used. The possible\ \ values are `oauth_google`, `oauth_microsoft`, `oauth_hubspot`, `oauth_slack`,\ \ or `oauth_github`.\n \n In addition, you may see an 'exchange'\ \ delivery method when a non-email-verifying OAuth factor originally authenticated\ \ in one organization is exchanged for a factor in another organization.\n\ \ This can happen during authentication flows such as [session\ \ exchange](https://stytch.com/docs/b2b/api/exchange-session).\n \ \ The non-email-verifying OAuth providers are Hubspot, Slack, and Github.\n\ \ Google is also considered non-email-verifying when the HD claim\ \ is empty.\n The possible exchange values are `oauth_exchange_google`,\ \ `oauth_exchange_hubspot`, `oauth_exchange_slack`, or `oauth_exchange_github`.\n\ \ \n The final possible value is `oauth_access_token_exchange`,\ \ if this factor came from an [access token exchange flow](https://stytch.com/docs/b2b/api/connected-app-access-token-exchange).\n\ \ \n `otp` \u2013 Only `sms`.\n \n `password` \u2013\ \ Only `knowledge`.\n \n `recovery_codes` \u2013 Only `recovery_code`.\n\ \ \n `sso` \u2013 Either `sso_saml` or `sso_oidc`.\n \n \ \ `trusted_auth_token` \u2013 Only `trusted_token_exchange`.\n \ \ \n `totp` \u2013 Only `authenticator_app`.\n " last_authenticated_at: type: string description: The timestamp when the factor was last authenticated. created_at: type: string description: The timestamp when the factor was initially authenticated. updated_at: type: string description: The timestamp when the factor was last updated. email_factor: $ref: '#/components/schemas/api_session_v1_EmailFactor' description: Information about the email factor, if one is present. phone_number_factor: $ref: '#/components/schemas/api_session_v1_PhoneNumberFactor' description: Information about the phone number factor, if one is present. google_oauth_factor: $ref: '#/components/schemas/api_session_v1_GoogleOAuthFactor' description: Information about the Google OAuth factor, if one is present. microsoft_oauth_factor: $ref: '#/components/schemas/api_session_v1_MicrosoftOAuthFactor' description: Information about the Microsoft OAuth factor, if one is present. apple_oauth_factor: $ref: '#/components/schemas/api_session_v1_AppleOAuthFactor' webauthn_factor: $ref: '#/components/schemas/api_session_v1_WebAuthnFactor' authenticator_app_factor: $ref: '#/components/schemas/api_session_v1_AuthenticatorAppFactor' description: Information about the TOTP-backed Authenticator App factor, if one is present. github_oauth_factor: $ref: '#/components/schemas/api_session_v1_GithubOAuthFactor' description: Information about the Github OAuth factor, if one is present. recovery_code_factor: $ref: '#/components/schemas/api_session_v1_RecoveryCodeFactor' facebook_oauth_factor: $ref: '#/components/schemas/api_session_v1_FacebookOAuthFactor' crypto_wallet_factor: $ref: '#/components/schemas/api_session_v1_CryptoWalletFactor' amazon_oauth_factor: $ref: '#/components/schemas/api_session_v1_AmazonOAuthFactor' bitbucket_oauth_factor: $ref: '#/components/schemas/api_session_v1_BitbucketOAuthFactor' coinbase_oauth_factor: $ref: '#/components/schemas/api_session_v1_CoinbaseOAuthFactor' discord_oauth_factor: $ref: '#/components/schemas/api_session_v1_DiscordOAuthFactor' figma_oauth_factor: $ref: '#/components/schemas/api_session_v1_FigmaOAuthFactor' git_lab_oauth_factor: $ref: '#/components/schemas/api_session_v1_GitLabOAuthFactor' instagram_oauth_factor: $ref: '#/components/schemas/api_session_v1_InstagramOAuthFactor' linked_in_oauth_factor: $ref: '#/components/schemas/api_session_v1_LinkedInOAuthFactor' shopify_oauth_factor: $ref: '#/components/schemas/api_session_v1_ShopifyOAuthFactor' slack_oauth_factor: $ref: '#/components/schemas/api_session_v1_SlackOAuthFactor' description: Information about the Slack OAuth factor, if one is present. snapchat_oauth_factor: $ref: '#/components/schemas/api_session_v1_SnapchatOAuthFactor' spotify_oauth_factor: $ref: '#/components/schemas/api_session_v1_SpotifyOAuthFactor' steam_oauth_factor: $ref: '#/components/schemas/api_session_v1_SteamOAuthFactor' tik_tok_oauth_factor: $ref: '#/components/schemas/api_session_v1_TikTokOAuthFactor' twitch_oauth_factor: $ref: '#/components/schemas/api_session_v1_TwitchOAuthFactor' twitter_oauth_factor: $ref: '#/components/schemas/api_session_v1_TwitterOAuthFactor' embeddable_magic_link_factor: $ref: '#/components/schemas/api_session_v1_EmbeddableMagicLinkFactor' biometric_factor: $ref: '#/components/schemas/api_session_v1_BiometricFactor' saml_sso_factor: $ref: '#/components/schemas/api_session_v1_SAMLSSOFactor' description: Information about the SAML SSO factor, if one is present. oidc_sso_factor: $ref: '#/components/schemas/api_session_v1_OIDCSSOFactor' description: Information about the OIDC SSO factor, if one is present. salesforce_oauth_factor: $ref: '#/components/schemas/api_session_v1_SalesforceOAuthFactor' yahoo_oauth_factor: $ref: '#/components/schemas/api_session_v1_YahooOAuthFactor' hubspot_oauth_factor: $ref: '#/components/schemas/api_session_v1_HubspotOAuthFactor' description: Information about the Hubspot OAuth factor, if one is present. slack_oauth_exchange_factor: $ref: '#/components/schemas/api_session_v1_SlackOAuthExchangeFactor' description: Information about the Slack OAuth Exchange factor, if one is present. hubspot_oauth_exchange_factor: $ref: '#/components/schemas/api_session_v1_HubspotOAuthExchangeFactor' description: Information about the Hubspot OAuth Exchange factor, if one is present. github_oauth_exchange_factor: $ref: '#/components/schemas/api_session_v1_GithubOAuthExchangeFactor' description: Information about the Github OAuth Exchange factor, if one is present. google_oauth_exchange_factor: $ref: '#/components/schemas/api_session_v1_GoogleOAuthExchangeFactor' description: Information about the Google OAuth Exchange factor, if one is present. impersonated_factor: $ref: '#/components/schemas/api_session_v1_ImpersonatedFactor' description: Information about the impersonated factor, if one is present. oauth_access_token_exchange_factor: $ref: '#/components/schemas/api_session_v1_OAuthAccessTokenExchangeFactor' description: Information about the access token exchange factor, if one is present. trusted_auth_token_factor: $ref: '#/components/schemas/api_session_v1_TrustedAuthTokenFactor' description: Information about the trusted auth token factor, if one is present. required: - type - delivery_method api_session_v1_AuthenticatorAppFactor: type: object properties: totp_id: type: string description: Globally unique UUID that identifies a TOTP instance. required: - totp_id api_session_v1_AuthorizationCheck: type: object properties: resource_id: type: string description: "A unique identifier of the RBAC Resource, provided by the\ \ developer and intended to be human-readable.\n\n A `resource_id` is\ \ not allowed to start with `stytch`, which is a special prefix used for\ \ Stytch default Resources with reserved `resource_id`s.\n " action: type: string description: An action to take on a Resource. required: - resource_id - action api_session_v1_AuthorizationVerdict: type: object properties: authorized: type: boolean description: Whether the User was authorized to perform the specified action on the specified Resource. Always true if the request succeeds. granting_roles: type: array items: type: string description: The complete list of Roles that gave the User permission to perform the specified action on the specified Resource. required: - authorized - granting_roles api_session_v1_BiometricFactor: type: object properties: biometric_registration_id: type: string required: - biometric_registration_id api_session_v1_BitbucketOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_CoinbaseOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_CryptoWalletFactor: type: object properties: crypto_wallet_id: type: string crypto_wallet_address: type: string crypto_wallet_type: type: string required: - crypto_wallet_id - crypto_wallet_address - crypto_wallet_type api_session_v1_DiscordOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_EmailFactor: type: object properties: email_id: type: string description: The globally unique UUID of the Member's email. email_address: type: string description: The email address of the Member. required: - email_id - email_address api_session_v1_EmbeddableMagicLinkFactor: type: object properties: embedded_id: type: string required: - embedded_id api_session_v1_FacebookOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_FigmaOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_GitLabOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_GithubOAuthExchangeFactor: type: object properties: email_id: type: string description: The globally unique UUID of the Member's email. required: - email_id api_session_v1_GithubOAuthFactor: type: object properties: id: type: string description: The unique ID of an OAuth registration. provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. email_id: type: string description: The globally unique UUID of the Member's email. required: - id - provider_subject api_session_v1_GoogleOAuthExchangeFactor: type: object properties: email_id: type: string description: The globally unique UUID of the Member's email. required: - email_id api_session_v1_GoogleOAuthFactor: type: object properties: id: type: string description: The unique ID of an OAuth registration. provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. email_id: type: string description: The globally unique UUID of the Member's email. required: - id - provider_subject api_session_v1_HubspotOAuthExchangeFactor: type: object properties: email_id: type: string description: The globally unique UUID of the Member's email. required: - email_id api_session_v1_HubspotOAuthFactor: type: object properties: id: type: string description: The unique ID of an OAuth registration. provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. email_id: type: string description: The globally unique UUID of the Member's email. required: - id - provider_subject api_session_v1_ImpersonatedFactor: type: object properties: impersonator_id: type: string description: For impersonated sessions initiated via the Stytch Dashboard, the `impersonator_id` will be the impersonator's Stytch Dashboard `member_id`. impersonator_email_address: type: string description: The email address of the impersonator. required: - impersonator_id - impersonator_email_address api_session_v1_InstagramOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_JWK: type: object properties: kty: type: string use: type: string key_ops: type: array items: type: string alg: type: string kid: type: string x5c: type: array items: type: string x5tS256: type: string n: type: string e: type: string required: - kty - use - key_ops - alg - kid - x5c - x5tS256 - n - e api_session_v1_LinkedInOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_MicrosoftOAuthFactor: type: object properties: id: type: string description: The unique ID of an OAuth registration. provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. email_id: type: string description: The globally unique UUID of the Member's email. required: - id - provider_subject api_session_v1_OAuthAccessTokenExchangeFactor: type: object properties: client_id: type: string description: The ID of the Connected App client. required: - client_id api_session_v1_OIDCSSOFactor: type: object properties: id: type: string description: The unique ID of an SSO Registration. provider_id: type: string description: Globally unique UUID that identifies a specific OIDC Connection. external_id: type: string description: The ID of the member given by the identity provider. required: - id - provider_id - external_id api_session_v1_PhoneNumberFactor: type: object properties: phone_id: type: string description: The globally unique UUID of the Member's phone number. phone_number: type: string description: The phone number of the Member. required: - phone_id - phone_number api_session_v1_RecoveryCodeFactor: type: object properties: totp_recovery_code_id: type: string required: - totp_recovery_code_id api_session_v1_SAMLSSOFactor: type: object properties: id: type: string description: The unique ID of an SSO Registration. provider_id: type: string description: Globally unique UUID that identifies a specific SAML Connection. external_id: type: string description: The ID of the member given by the identity provider. required: - id - provider_id - external_id api_session_v1_SalesforceOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_Session: type: object properties: session_id: type: string description: A unique identifier for a specific Session. user_id: type: string description: The unique ID of the affected User. authentication_factors: type: array items: $ref: '#/components/schemas/api_session_v1_AuthenticationFactor' description: An array of different authentication factors that comprise a Session. roles: type: array items: type: string started_at: type: string description: The timestamp when the Session was created. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. last_accessed_at: type: string description: The timestamp when the Session was last accessed. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. expires_at: type: string description: The timestamp when the Session expires. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes help with fraud detection. custom_claims: type: object additionalProperties: true description: The custom claims map for a Session. Claims can be added to a session during a Sessions authenticate call. required: - session_id - user_id - authentication_factors - roles api_session_v1_ShopifyOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_SlackOAuthExchangeFactor: type: object properties: email_id: type: string description: The globally unique UUID of the Member's email. required: - email_id api_session_v1_SlackOAuthFactor: type: object properties: id: type: string description: The unique ID of an OAuth registration. provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. email_id: type: string description: The globally unique UUID of the Member's email. required: - id - provider_subject api_session_v1_SnapchatOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_SpotifyOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_SteamOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_TikTokOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_TrustedAuthTokenFactor: type: object properties: token_id: type: string description: The ID of the trusted auth token. required: - token_id api_session_v1_TwitchOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_TwitterOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_WebAuthnFactor: type: object properties: webauthn_registration_id: type: string domain: type: string user_agent: type: string required: - webauthn_registration_id - domain api_session_v1_YahooOAuthFactor: type: object properties: id: type: string provider_subject: type: string email_id: type: string required: - id - provider_subject api_session_v1_AttestRequest: type: object properties: profile_id: type: string description: The ID of the trusted auth token profile to use for attestation. token: type: string description: The trusted auth token to authenticate. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." session_token: type: string description: The `session_token` for the session that you wish to add the trusted auth token authentication factor to. session_jwt: type: string description: The `session_jwt` for the session that you wish to add the trusted auth token authentication factor to. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - profile_id - token api_session_v1_AttestResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - session_token - session_jwt - user - status_code api_session_v1_AuthenticateRequest: type: object properties: session_token: type: string description: The session token to authenticate. session_duration_minutes: type: integer format: int32 description: Set the session lifetime to be this many minutes from now; minimum of 5 and a maximum of 527040 minutes (366 days). Note that a successful authentication will continue to extend the session this many minutes. session_jwt: type: string description: The JWT to authenticate. You may provide a JWT that has expired according to its `exp` claim and needs to be refreshed. If the signature is valid and the underlying session is still active then Stytch will return a new JWT. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." authorization_check: $ref: '#/components/schemas/api_session_v1_AuthorizationCheck' description: "If an `authorization_check` object is passed in, this endpoint\ \ will also check if the User is\n authorized to perform the given action\ \ on the given Resource. A User is authorized if they are assigned a Role\ \ with adequate permissions.\n\n If the User is not authorized to perform\ \ the specified action on the specified Resource, a 403 error will be\ \ thrown.\n Otherwise, the response will contain a list of Roles that\ \ satisfied the authorization check." description: Request type api_session_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. verdict: $ref: '#/components/schemas/api_session_v1_AuthorizationVerdict' description: "If an `authorization_check` is provided in the request and\ \ the check succeeds, this field will return\n information about why\ \ the User was granted permission." required: - request_id - session - session_token - session_jwt - user - status_code api_session_v1_ExchangeAccessTokenRequest: type: object properties: access_token: type: string description: The access token to exchange for a Stytch Session. Must be granted the `full_access` scope. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - access_token api_session_v1_ExchangeAccessTokenResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - session_token - session_jwt - user - status_code api_session_v1_GetJWKSRequest: type: object properties: {} description: Request type api_session_v1_GetJWKSResponse: type: object properties: keys: type: array items: $ref: '#/components/schemas/api_session_v1_JWK' description: The list of JWKs associated with the project. request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - keys - request_id - status_code api_session_v1_GetRequest: type: object properties: user_id: type: string description: The `user_id` to get active Sessions for. You may use an `external_id` here if one is set for the user. description: Request type required: - user_id api_session_v1_GetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. sessions: type: array items: $ref: '#/components/schemas/api_session_v1_Session' description: An array of [Session objects](https://stytch.com/docs/api/session-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - sessions - status_code api_session_v1_MigrateRequest: type: object properties: session_token: type: string description: The authorization token Stytch will pass in to the external userinfo endpoint. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - session_token api_session_v1_MigrateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - session_token - session_jwt - user - status_code api_session_v1_RevokeRequest: type: object properties: session_id: type: string description: The `session_id` to revoke. session_token: type: string description: The session token to revoke. session_jwt: type: string description: A JWT for the session to revoke. description: Request type api_session_v1_RevokeResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - status_code api_session_v1_AuthenticationFactorDeliveryMethod: type: string enum: - email - sms - whatsapp - embedded - oauth_google - oauth_microsoft - oauth_apple - webauthn_registration - authenticator_app - oauth_github - recovery_code - oauth_facebook - crypto_wallet - oauth_amazon - oauth_bitbucket - oauth_coinbase - oauth_discord - oauth_figma - oauth_gitlab - oauth_instagram - oauth_linkedin - oauth_shopify - oauth_slack - oauth_snapchat - oauth_spotify - oauth_steam - oauth_tiktok - oauth_twitch - oauth_twitter - knowledge - biometric - sso_saml - sso_oidc - oauth_salesforce - oauth_yahoo - oauth_hubspot - imported_auth0 - oauth_exchange_slack - oauth_exchange_hubspot - oauth_exchange_github - oauth_exchange_google - impersonation - oauth_access_token_exchange - trusted_token_exchange api_session_v1_AuthenticationFactorType: type: string enum: - magic_link - otp - oauth - webauthn - totp - crypto - password - signature_challenge - sso - imported - recovery_codes - email_otp - impersonated - trusted_auth_token api_b2b_session_v1_AuthorizationCheck: type: object properties: organization_id: type: string description: Globally unique UUID that identifies a specific Organization. The Organization's ID must match the Member's Organization resource_id: type: string description: "A unique identifier of the RBAC Resource, provided by the\ \ developer and intended to be human-readable.\n\n A `resource_id` is\ \ not allowed to start with `stytch`, which is a special prefix used for\ \ Stytch default Resources with reserved `resource_id`s. These include:\n\ \n * `stytch.organization`\n * `stytch.member`\n * `stytch.sso`\n \ \ * `stytch.self`\n\n Check out the [guide on Stytch default Resources](https://stytch.com/docs/b2b/guides/rbac/stytch-default)\ \ for a more detailed explanation.\n\n " action: type: string description: An action to take on a Resource. required: - organization_id - resource_id - action api_b2b_session_v1_AuthorizationVerdict: type: object properties: authorized: type: boolean description: Whether the Member was authorized to perform the specified action on the specified Resource. Always true if the request succeeds. granting_roles: type: array items: type: string description: The complete list of Roles that gave the Member permission to perform the specified action on the specified Resource. required: - authorized - granting_roles api_b2b_session_v1_MemberSession: type: object properties: member_session_id: type: string description: Globally unique UUID that identifies a specific Session. member_id: type: string description: Globally unique UUID that identifies a specific Member. started_at: type: string description: The timestamp when the Session was created. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. last_accessed_at: type: string description: The timestamp when the Session was last accessed. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. expires_at: type: string description: The timestamp when the Session expires. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. authentication_factors: type: array items: $ref: '#/components/schemas/api_session_v1_AuthenticationFactor' description: An array of different authentication factors that comprise a Session. organization_id: 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. roles: type: array items: type: string organization_slug: type: string description: 'The unique URL slug of the Organization. The slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`. Must be between 2 and 128 characters in length. Wherever an organization_id is expected in a path or request parameter, you may also use the organization_slug as a convenience.' custom_claims: type: object additionalProperties: true description: The custom claims map for a Session. Claims can be added to a session during a Sessions authenticate call. required: - member_session_id - member_id - started_at - last_accessed_at - expires_at - authentication_factors - organization_id - roles - organization_slug api_b2b_session_v1_PrimaryRequired: type: object properties: allowed_auth_methods: type: array items: type: string description: Details the auth method that the member must also complete to fulfill the primary authentication requirements of the Organization. For example, a value of `[magic_link]` indicates that the Member must also complete a magic link authentication step. If you have an intermediate session token, you must pass it into that primary authentication step. required: - allowed_auth_methods api_b2b_session_v1_AttestRequest: type: object properties: profile_id: type: string description: The ID of the trusted auth token profile to use for attestation. token: type: string description: The trusted auth token to authenticate. The token must have an organization ID claim if JIT provisioning is enabled. organization_id: type: string description: The organization ID that the session should be authenticated in. Must be provided if the trusted auth token does not have an organization ID claim. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." session_token: type: string description: The `session_token` for the session that you wish to add the trusted auth token authentication factor to. session_jwt: type: string description: The `session_jwt` for the session that you wish to add the trusted auth token authentication factor to. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - profile_id - token api_b2b_session_v1_AttestResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - member_session - session_token - session_jwt - member - organization - status_code api_b2b_session_v1_AuthenticateRequest: type: object properties: session_token: type: string description: A secret token for a given Stytch Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." authorization_check: $ref: '#/components/schemas/api_b2b_session_v1_AuthorizationCheck' description: "If an `authorization_check` object is passed in, this endpoint\ \ will also check if the Member is\n authorized to perform the given\ \ action on the given Resource in the specified Organization. A Member\ \ is authorized if\n their Member Session contains a Role, assigned\n\ \ [explicitly or implicitly](https://stytch.com/docs/b2b/guides/rbac/role-assignment),\ \ with adequate permissions.\n In addition, the `organization_id` passed\ \ in the authorization check must match the Member's Organization.\n\n\ \ The Roles on the Member Session may differ from the Roles you see on\ \ the Member object - Roles that are implicitly\n assigned by SSO connection\ \ or SSO group will only be valid for a Member Session if there is at\ \ least one authentication\n factor on the Member Session from the specified\ \ SSO connection.\n\n If the Member is not authorized to perform the\ \ specified action on the specified Resource, or if the\n `organization_id`\ \ does not match the Member's Organization, a 403 error will be thrown.\n\ \ Otherwise, the response will contain a list of Roles that satisfied\ \ the authorization check." description: Request type api_b2b_session_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. verdict: $ref: '#/components/schemas/api_b2b_session_v1_AuthorizationVerdict' description: "If an `authorization_check` is provided in the request and\ \ the check succeeds, this field will return\n information about why\ \ the Member was granted permission." required: - request_id - member_session - session_token - session_jwt - member - organization - status_code api_b2b_session_v1_ExchangeAccessTokenRequest: type: object properties: access_token: type: string description: The access token to exchange for a Stytch Session. Must be granted the `full_access` scope. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - access_token api_b2b_session_v1_ExchangeAccessTokenResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - session_token - session_jwt - member - organization - status_code api_b2b_session_v1_ExchangeRequest: type: object properties: organization_id: 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. session_token: type: string description: The `session_token` belonging to the member that you wish to associate the email with. session_jwt: type: string description: The `session_jwt` belonging to the member that you wish to associate the email with. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." locale: $ref: '#/components/schemas/api_b2b_session_v1_ExchangeRequestLocale' description: 'If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will pre-emptively send a one-time passcode (OTP) to the Member''s phone number. The locale argument will be used to determine which language to use when sending the passcode. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - organization_id api_b2b_session_v1_ExchangeResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). member_authenticated: type: boolean description: Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step to log in to the Organization. intermediate_session_token: type: string description: The returned Intermediate Session Token contains any Email Magic Link or OAuth factors from the original member session that are valid for the target Organization. If this value is non-empty, the member must complete an MFA step to finish logging in to the Organization. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. primary_required: $ref: '#/components/schemas/api_b2b_session_v1_PrimaryRequired' description: Information about the primary authentication requirements of the Organization. member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - session_token - session_jwt - member - organization - member_authenticated - intermediate_session_token - status_code api_b2b_session_v1_GetJWKSRequest: type: object properties: {} description: Request type api_b2b_session_v1_GetJWKSResponse: type: object properties: keys: type: array items: $ref: '#/components/schemas/api_session_v1_JWK' description: The list of JWKs associated with the project. request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - keys - request_id - status_code api_b2b_session_v1_GetRequest: type: object properties: organization_id: 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. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Request type required: - organization_id - member_id api_b2b_session_v1_GetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_sessions: type: array items: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: An array of [Session objects](https://stytch.com/docs/b2b/api/session-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_sessions - status_code api_b2b_session_v1_MigrateRequest: type: object properties: session_token: type: string description: The authorization token Stytch will pass in to the external userinfo endpoint. organization_id: 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. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." description: Request type required: - session_token - organization_id api_b2b_session_v1_MigrateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). required: - request_id - member_id - session_token - session_jwt - member - organization - status_code api_b2b_session_v1_RevokeRequest: type: object properties: member_session_id: type: string description: Globally unique UUID that identifies a specific Session in the Stytch API. The `member_session_id` is critical to perform operations on an Session, so be sure to preserve this value. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. description: Request type api_b2b_session_v1_RevokeResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - status_code api_b2b_session_v1_ExchangeRequestLocale: type: string enum: - en - es - pt-br - fr - it - de-DE - zh-Hans - ca-ES api_b2b_impersonation_v1_AuthenticateRequest: type: object properties: impersonation_token: type: string description: The Member Impersonation token to authenticate. Expires in 5 minutes by default. description: Request type required: - impersonation_token api_b2b_impersonation_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. organization_id: 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. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). intermediate_session_token: type: string description: Successfully authenticating an impersonation token will never result in an intermediate session. If the token is valid, a full session will be created. member_authenticated: type: boolean description: The member will always be fully authenticated if an impersonation token is successfully authenticated. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object) for the impersonated Member. mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: MFA will not be required when authenticating impersonation tokens. required: - request_id - member_id - organization_id - member - session_token - session_jwt - organization - intermediate_session_token - member_authenticated - status_code api_b2b_rbac_v1_OrgPolicy: type: object properties: roles: type: array items: $ref: '#/components/schemas/api_b2b_rbac_v1_PolicyRole' description: An array of [Role objects](https://stytch.com/docs/b2b/api/rbac-role-object). required: - roles api_b2b_rbac_v1_Policy: type: object properties: roles: type: array items: $ref: '#/components/schemas/api_b2b_rbac_v1_PolicyRole' description: An array of [Role objects](https://stytch.com/docs/b2b/api/rbac-role-object). resources: type: array items: $ref: '#/components/schemas/api_b2b_rbac_v1_PolicyResource' description: An array of [Resource objects](https://stytch.com/docs/b2b/api/rbac-resource-object). scopes: type: array items: $ref: '#/components/schemas/api_b2b_rbac_v1_PolicyScope' description: An array of [Scope objects](https://stytch.com/docs/b2b/api/rbac-scope-object). required: - roles - resources - scopes api_b2b_rbac_v1_PolicyResource: type: object properties: resource_id: type: string description: "A unique identifier of the RBAC Resource, provided by the\ \ developer and intended to be human-readable.\n\n A `resource_id` is\ \ not allowed to start with `stytch`, which is a special prefix used for\ \ Stytch default Resources with reserved `resource_id`s. These include:\n\ \n * `stytch.organization`\n * `stytch.member`\n * `stytch.sso`\n \ \ * `stytch.self`\n\n Check out the [guide on Stytch default Resources](https://stytch.com/docs/b2b/guides/rbac/stytch-default)\ \ for a more detailed explanation.\n\n " description: type: string description: The description of the RBAC Resource. actions: type: array items: type: string description: "A list of all possible actions for a provided Resource.\n\n\ \ Reserved `actions` that are predefined by Stytch include:\n\n * `*`\n\ \ * For the `stytch.organization` Resource:\n * `update.info.name`\n\ \ * `update.info.slug`\n * `update.info.untrusted_metadata`\n \ \ * `update.info.email_jit_provisioning`\n * `update.info.logo_url`\n\ \ * `update.info.email_invites`\n * `update.info.allowed_domains`\n\ \ * `update.info.default_sso_connection`\n * `update.info.sso_jit_provisioning`\n\ \ * `update.info.mfa_policy`\n * `update.info.implicit_roles`\n\ \ * `delete`\n * For the `stytch.member` Resource:\n * `create`\n\ \ * `update.info.name`\n * `update.info.untrusted_metadata`\n \ \ * `update.info.mfa-phone`\n * `update.info.delete.mfa-phone`\n \ \ * `update.settings.is-breakglass`\n * `update.settings.mfa_enrolled`\n\ \ * `update.settings.roles`\n * `search`\n * `delete`\n * For\ \ the `stytch.sso` Resource:\n * `create`\n * `update`\n * `delete`\n\ \ * For the `stytch.self` Resource:\n * `update.info.name`\n *\ \ `update.info.untrusted_metadata`\n * `update.info.mfa-phone`\n \ \ * `update.info.delete.mfa-phone`\n * `update.info.delete.password`\n\ \ * `update.settings.mfa_enrolled`\n * `delete`\n " required: - resource_id - description - actions api_b2b_rbac_v1_PolicyRole: type: object properties: role_id: type: string description: "The unique identifier of the RBAC Role, provided by the developer\ \ and intended to be human-readable.\n\n Reserved `role_id`s that are\ \ predefined by Stytch include:\n\n * `stytch_member`\n * `stytch_admin`\n\ \n Check out the [guide on Stytch default Roles](https://stytch.com/docs/b2b/guides/rbac/stytch-default)\ \ for a more detailed explanation.\n\n " description: type: string description: The description of the RBAC Role. permissions: type: array items: $ref: '#/components/schemas/api_b2b_rbac_v1_PolicyRolePermission' description: A list of permissions that link a [Resource](https://stytch.com/docs/b2b/api/rbac-resource-object) to a list of actions. required: - role_id - description - permissions api_b2b_rbac_v1_PolicyRolePermission: type: object properties: resource_id: type: string description: "A unique identifier of the RBAC Resource, provided by the\ \ developer and intended to be human-readable.\n\n A `resource_id` is\ \ not allowed to start with `stytch`, which is a special prefix used for\ \ Stytch default Resources with reserved `resource_id`s. These include:\n\ \n * `stytch.organization`\n * `stytch.member`\n * `stytch.sso`\n \ \ * `stytch.self`\n\n Check out the [guide on Stytch default Resources](https://stytch.com/docs/b2b/guides/rbac/stytch-default)\ \ for a more detailed explanation.\n\n " actions: type: array items: type: string description: 'A list of permitted actions the Scope is required to take with the provided Resource. You can use `*` as a wildcard to require a Scope permission to use all possible actions related to the Resource. ' required: - resource_id - actions api_b2b_rbac_v1_PolicyScope: type: object properties: scope: type: string description: The unique identifier of the RBAC Scope, provided by the developer and intended to be human-readable. description: type: string description: The description of the RBAC Scope. permissions: type: array items: $ref: '#/components/schemas/api_b2b_rbac_v1_PolicyScopePermission' description: A list of permissions that link a [Resource](https://stytch.com/docs/b2b/api/rbac-resource-object) to a list of actions. required: - scope - description - permissions api_b2b_rbac_v1_PolicyScopePermission: type: object properties: resource_id: type: string description: "A unique identifier of the RBAC Resource, provided by the\ \ developer and intended to be human-readable.\n\n A `resource_id` is\ \ not allowed to start with `stytch`, which is a special prefix used for\ \ Stytch default Resources with reserved `resource_id`s. These include:\n\ \n * `stytch.organization`\n * `stytch.member`\n * `stytch.sso`\n \ \ * `stytch.self`\n\n Check out the [guide on Stytch default Resources](https://stytch.com/docs/b2b/guides/rbac/stytch-default)\ \ for a more detailed explanation.\n\n " actions: type: array items: type: string description: 'A list of permitted actions the Scope is required to take with the provided Resource. You can use `*` as a wildcard to require a Scope permission to use all possible actions related to the Resource. ' required: - resource_id - actions api_b2b_rbac_v1_PolicyRequest: type: object properties: {} description: Request type api_b2b_rbac_v1_PolicyResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. policy: $ref: '#/components/schemas/api_b2b_rbac_v1_Policy' description: "The RBAC Policy document that contains all defined Roles and\ \ Resources \u2013 which are managed in the [Dashboard](https://stytch.com/dashboard/rbac).\ \ Read more about these entities and how they work in our [RBAC overview](https://stytch.com/docs/b2b/guides/rbac/overview)." required: - request_id - status_code api_b2b_rbac_v1_b2b_rbac_organizations_GetOrgPolicyRequest: type: object properties: {} description: Request type api_b2b_rbac_v1_b2b_rbac_organizations_GetOrgPolicyResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. org_policy: $ref: '#/components/schemas/api_b2b_rbac_v1_OrgPolicy' description: The organization-specific RBAC Policy that contains roles defined for this organization. Organization policies supplement the project-level RBAC policy with additional roles that are specific to the organization. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - org_policy - status_code api_b2b_rbac_v1_b2b_rbac_organizations_SetOrgPolicyRequest: type: object properties: org_policy: $ref: '#/components/schemas/api_b2b_rbac_v1_OrgPolicy' description: The organization-specific RBAC Policy that contains roles defined for this organization. Organization policies supplement the project-level RBAC policy with additional roles that are specific to the organization. description: Request type required: - org_policy api_b2b_rbac_v1_b2b_rbac_organizations_SetOrgPolicyResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. org_policy: $ref: '#/components/schemas/api_b2b_rbac_v1_OrgPolicy' description: The organization-specific RBAC Policy that contains roles defined for this organization. Organization policies supplement the project-level RBAC policy with additional roles that are specific to the organization. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - org_policy - status_code api_b2b_recovery_codes_v1_GetRequest: type: object properties: {} description: Request type api_b2b_recovery_codes_v1_GetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). recovery_codes: type: array items: type: string description: An array of recovery codes that can be used to recover a Member's account. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - recovery_codes - status_code api_b2b_recovery_codes_v1_RecoverRequest: type: object properties: organization_id: 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. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. recovery_code: type: string description: The recovery code generated by a secondary MFA method. This code is used to authenticate in place of the secondary MFA method if that method as a backup. intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - organization_id - member_id - recovery_code api_b2b_recovery_codes_v1_RecoverResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. recovery_codes_remaining: type: integer format: int32 description: The number of recovery codes remaining for a Member. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - member - organization - session_token - session_jwt - recovery_codes_remaining - status_code api_b2b_recovery_codes_v1_RotateRequest: type: object properties: organization_id: 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. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Request type required: - organization_id - member_id api_b2b_recovery_codes_v1_RotateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). recovery_codes: type: array items: type: string description: An array of recovery codes that can be used to recover a Member's account. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - recovery_codes - status_code api_b2b_totp_v1_AuthenticateRequest: type: object properties: organization_id: 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. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. code: type: string description: The code to authenticate. intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." set_mfa_enrollment: type: string description: "Optionally sets the Member\u2019s MFA enrollment status upon\ \ a successful authentication. If the Organization\u2019s MFA policy is\ \ `REQUIRED_FOR_ALL`, this field will be ignored. If this field is not\ \ passed in, the Member\u2019s `mfa_enrolled` boolean will not be affected.\ \ The options are:\n \n `enroll` \u2013 sets the Member's `mfa_enrolled`\ \ boolean to `true`. The Member will be required to complete an MFA step\ \ upon subsequent logins to the Organization.\n \n `unenroll` \u2013\ \ sets the Member's `mfa_enrolled` boolean to `false`. The Member will\ \ no longer be required to complete MFA steps when logging in to the Organization.\n\ \ " set_default_mfa: type: boolean description: If passed will set the authenticated method to the default MFA method. Completing an MFA authentication flow for the first time for a Member will implicitly set the method to the default MFA method. This option can be used to update the default MFA method if multiple are being used. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - organization_id - member_id - code api_b2b_totp_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - member - organization - session_token - session_jwt - status_code api_b2b_totp_v1_CreateRequest: type: object properties: organization_id: 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. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. expiration_minutes: type: integer format: int32 description: The expiration for the TOTP registration. If the newly created TOTP registration is not authenticated within this time frame the member will have to restart the registration flow. Defaults to 60 (1 hour) with a minimum of 5 and a maximum of 1440. intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. description: Request type required: - organization_id - member_id api_b2b_totp_v1_CreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. totp_registration_id: type: string description: The unique ID for a TOTP instance. secret: type: string description: The TOTP secret key shared between the authenticator app and the server used to generate TOTP codes. qr_code: type: string description: The QR code image encoded in base64. recovery_codes: type: array items: type: string description: An array of recovery codes that can be used to recover a Member's account. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - totp_registration_id - secret - qr_code - recovery_codes - member - organization - status_code api_b2b_totp_v1_MigrateRequest: type: object properties: organization_id: 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. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. secret: type: string description: The TOTP secret key shared between the authenticator app and the server used to generate TOTP codes. recovery_codes: type: array items: type: string description: An existing set of recovery codes to be imported into Stytch to be used to authenticate in place of the secondary MFA method. description: Request type required: - organization_id - member_id - secret - recovery_codes api_b2b_totp_v1_MigrateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). totp_registration_id: type: string description: The unique ID for a TOTP instance. recovery_codes: type: array items: type: string description: An array of recovery codes that can be used to recover a Member's account. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - totp_registration_id - recovery_codes - status_code api_consumer_rbac_v1_Policy: type: object properties: roles: type: array items: $ref: '#/components/schemas/api_consumer_rbac_v1_PolicyRole' description: An array of [Role objects](https://stytch.com/docs/api/rbac-role-object). resources: type: array items: $ref: '#/components/schemas/api_consumer_rbac_v1_PolicyResource' description: An array of [Resource objects](https://stytch.com/docs/api/rbac-resource-object). scopes: type: array items: $ref: '#/components/schemas/api_consumer_rbac_v1_PolicyScope' description: An array of [Scope objects](https://stytch.com/docs/api/rbac-scope-object). required: - roles - resources - scopes api_consumer_rbac_v1_PolicyResource: type: object properties: resource_id: type: string description: "A unique identifier of the RBAC Resource, provided by the\ \ developer and intended to be human-readable.\n\n A `resource_id` is\ \ not allowed to start with `stytch`, which is a special prefix used for\ \ Stytch default Resources with reserved `resource_id`s.\n " description: type: string description: The description of the RBAC Resource. actions: type: array items: type: string description: A list of all possible actions for a provided Resource. required: - resource_id - description - actions api_consumer_rbac_v1_PolicyRole: type: object properties: role_id: type: string description: "The unique identifier of the RBAC Role, provided by the developer\ \ and intended to be human-readable.\n\n The `stytch_user` `role_id`\ \ is predefined by Stytch.\n Check out the [RBAC guide](https://stytch.com/docs/guides/rbac/overview)\ \ for a more detailed explanation.\n " description: type: string description: The description of the RBAC Role. permissions: type: array items: $ref: '#/components/schemas/api_consumer_rbac_v1_PolicyRolePermission' description: A list of permissions that link a [Resource](https://stytch.com/docs/api/rbac-resource-object) to a list of actions. required: - role_id - description - permissions api_consumer_rbac_v1_PolicyRolePermission: type: object properties: resource_id: type: string description: "A unique identifier of the RBAC Resource, provided by the\ \ developer and intended to be human-readable.\n\n A `resource_id` is\ \ not allowed to start with `stytch`, which is a special prefix used for\ \ Stytch default Resources with reserved `resource_id`s.\n " actions: type: array items: type: string description: 'A list of permitted actions the Role is authorized to take with the provided Resource. You can use `*` as a wildcard to grant a Role permission to use all possible actions related to the Resource. ' required: - resource_id - actions api_consumer_rbac_v1_PolicyScope: type: object properties: scope: type: string description: The unique identifier of the RBAC Scope, provided by the developer and intended to be human-readable. description: type: string description: The description of the RBAC Scope. permissions: type: array items: $ref: '#/components/schemas/api_consumer_rbac_v1_PolicyScopePermission' description: A list of permissions that link a [Resource](https://stytch.com/docs/api/rbac-resource-object) to a list of actions. required: - scope - description - permissions api_consumer_rbac_v1_PolicyScopePermission: type: object properties: resource_id: type: string description: "A unique identifier of the RBAC Resource, provided by the\ \ developer and intended to be human-readable.\n\n A `resource_id` is\ \ not allowed to start with `stytch`, which is a special prefix used for\ \ Stytch default Resources with reserved `resource_id`s.\n " actions: type: array items: type: string description: 'A list of permitted actions the Scope is required to take with the provided Resource. You can use `*` as a wildcard to require a Scope permission to use all possible actions related to the Resource. ' required: - resource_id - actions api_consumer_rbac_v1_PolicyRequest: type: object properties: {} description: Request type api_consumer_rbac_v1_PolicyResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. policy: $ref: '#/components/schemas/api_consumer_rbac_v1_Policy' description: "The RBAC Policy document that contains all defined Roles and\ \ Resources \u2013 which are managed in the [Dashboard](https://stytch.com/dashboard/rbac).\ \ Read more about these entities and how they work in our [RBAC overview](https://stytch.com/docs/guides/rbac/overview)." required: - request_id - status_code api_crypto_wallet_v1_SIWEParams: type: object properties: domain: type: string description: Only required if `siwe_params` is passed. The domain that is requesting the crypto wallet signature. Must be an RFC 3986 authority. uri: type: string description: Only required if `siwe_params` is passed. An RFC 3986 URI referring to the resource that is the subject of the signing. resources: type: array items: type: string description: ' A list of information or references to information the user wishes to have resolved as part of authentication. Every resource must be an RFC 3986 URI.' chain_id: type: string description: The EIP-155 Chain ID to which the session is bound. Defaults to 1. Must be the string representation of an integer between 1 and 9,223,372,036,854,775,771, inclusive. statement: type: string description: A human-readable ASCII assertion that the user will sign. The statement may only include reserved, unreserved, or space characters according to RFC 3986 definitions, and must not contain other forms of whitespace such as newlines, tabs, and carriage returns. issued_at: type: string description: The time when the message was generated. Defaults to the current time. All timestamps in our API conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. not_before: type: string description: The time when the signed authentication message will become valid. Defaults to the current time. All timestamps in our API conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. message_request_id: type: string description: A system-specific identifier that may be used to uniquely refer to the sign-in request. The `message_request_id` must be a valid pchar according to RFC 3986 definitions. required: - domain - uri - resources api_crypto_wallet_v1_AuthenticateRequest: type: object properties: crypto_wallet_type: type: string description: The type of wallet to authenticate. Currently `ethereum` and `solana` are supported. Wallets for any EVM-compatible chains (such as Polygon or BSC) are also supported and are grouped under the `ethereum` type. crypto_wallet_address: type: string description: The crypto wallet address to authenticate. signature: type: string description: The signature from the message challenge. session_token: type: string description: The `session_token` associated with a User's existing Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - crypto_wallet_type - crypto_wallet_address - signature api_crypto_wallet_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " siwe_params: $ref: '#/components/schemas/api_crypto_wallet_v1_SIWEParamsResponse' description: The parameters of the Sign In With Ethereum (SIWE) message that was signed. user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - session_token - session_jwt - user - status_code api_crypto_wallet_v1_AuthenticateStartRequest: type: object properties: crypto_wallet_type: type: string description: The type of wallet to authenticate. Currently `ethereum` and `solana` are supported. Wallets for any EVM-compatible chains (such as Polygon or BSC) are also supported and are grouped under the `ethereum` type. crypto_wallet_address: type: string description: The crypto wallet address to authenticate. user_id: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. session_token: type: string description: The `session_token` associated with a User's existing Session. session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. siwe_params: $ref: '#/components/schemas/api_crypto_wallet_v1_SIWEParams' description: The parameters for a Sign In With Ethereum (SIWE) message. May only be passed if the `crypto_wallet_type` is `ethereum`. description: Request type required: - crypto_wallet_type - crypto_wallet_address api_crypto_wallet_v1_AuthenticateStartResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. challenge: type: string description: A challenge string to be signed by the wallet in order to prove ownership. user_created: type: boolean description: In `login_or_create` endpoints, this field indicates whether or not a User was just created. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - challenge - user_created - status_code api_crypto_wallet_v1_SIWEParamsResponse: type: object properties: domain: type: string description: The domain that requested the crypto wallet signature. uri: type: string description: An RFC 3986 URI referring to the resource that is the subject of the signing. chain_id: type: string description: The EIP-155 Chain ID to which the session is bound. resources: type: array items: type: string description: ' A list of information or references to information the user wishes to have resolved as part of authentication. Every resource must be an RFC 3986 URI.' status_code: type: integer format: int32 issued_at: type: string description: The time when the message was generated. All timestamps in our API conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. message_request_id: type: string description: A system-specific identifier that may be used to uniquely refer to the sign-in request. required: - domain - uri - chain_id - resources - status_code api_debug_v1_WhoamiRequest: type: object properties: {} api_debug_v1_WhoamiResponse: type: object properties: request_id: type: string project_id: type: string name: type: string status_code: type: integer format: int32 required: - request_id - project_id - name - status_code api_discovery_v1_DiscoveredOrganization: type: object properties: member_authenticated: type: boolean description: Indicates whether the Member has all of the factors needed to fully authenticate to this Organization. If false, the Member may need to complete an MFA step or complete a different primary authentication flow. See the `primary_required` and `mfa_required` fields for more details on each. organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). membership: $ref: '#/components/schemas/api_discovery_v1_Membership' description: Information about the membership. primary_required: $ref: '#/components/schemas/api_b2b_session_v1_PrimaryRequired' description: Information about the primary authentication requirements of the Organization. mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. required: - member_authenticated api_discovery_v1_Membership: type: object properties: type: type: string description: Either `active_member`, `pending_member`, `invited_member`, `eligible_to_join_by_email_domain`, or `eligible_to_join_by_oauth_tenant` details: type: object additionalProperties: true description: An object containing additional metadata about the membership, if available. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) if one already exists, or null if one does not. required: - type api_discovery_v1_discovery_intermediate_sessions_ExchangeRequest: type: object properties: intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. organization_id: 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. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." locale: $ref: '#/components/schemas/api_discovery_v1_ExchangeRequestLocale' description: 'If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will pre-emptively send a one-time passcode (OTP) to the Member''s phone number. The locale argument will be used to determine which language to use when sending the passcode. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - intermediate_session_token - organization_id api_discovery_v1_discovery_intermediate_sessions_ExchangeResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). member_authenticated: type: boolean description: Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step to log in to the Organization. intermediate_session_token: type: string description: The returned Intermediate Session Token is identical to the one that was originally passed in to the request. If this value is non-empty, the member must complete an MFA step to finish logging in to the Organization. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. primary_required: $ref: '#/components/schemas/api_b2b_session_v1_PrimaryRequired' description: Information about the primary authentication requirements of the Organization. member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - session_token - session_jwt - member - organization - member_authenticated - intermediate_session_token - status_code api_discovery_v1_ExchangeRequestLocale: type: string enum: - en - es - pt-br - fr - it - de-DE - zh-Hans - ca-ES api_discovery_v1_discovery_ListRequest: type: object properties: intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. description: Request type api_discovery_v1_discovery_ListResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. email_address: type: string description: The email address. discovered_organizations: type: array items: $ref: '#/components/schemas/api_discovery_v1_DiscoveredOrganization' description: "An array of `discovered_organization` objects tied to the\ \ `intermediate_session_token`, `session_token`, or `session_jwt`. See\ \ the [Discovered Organization Object](https://stytch.com/docs/b2b/api/discovered-organization-object)\ \ for complete details.\n\n Note that Organizations will only appear\ \ here under any of the following conditions:\n 1. The end user is already\ \ a Member of the Organization.\n 2. The end user is invited to the Organization.\n\ \ 3. The end user can join the Organization because:\n\n a) The\ \ Organization allows JIT provisioning.\n\n b) The Organizations'\ \ allowed domains list contains the Member's email domain.\n\n c)\ \ The Organization has at least one other Member with a verified email\ \ address with the same domain as the end user (to prevent phishing attacks)." status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. organization_id_hint: type: string description: If the intermediate session token is associated with a specific Organization, that Organization ID will be returned here. The Organization ID will be null if the intermediate session token was generated by a email magic link discovery or OAuth discovery flow. If a session token or session JWT is provided, the Organization ID hint will be null. required: - request_id - email_address - discovered_organizations - status_code api_discovery_v1_discovery_organizations_CreateRequest: type: object properties: intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." organization_name: type: string description: The name of the Organization. If the name is not specified, a default name will be created based on the email used to initiate the discovery flow. If the email domain is a common email provider such as gmail.com, or if the email is a .edu email, the organization name will be generated based on the name portion of the email. Otherwise, the organization name will be generated based on the email domain. organization_slug: type: string description: 'The unique URL slug of the Organization. A minimum of two characters is required. The slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`. If the slug is not specified, a default slug will be created based on the email used to initiate the discovery flow. If the email domain is a common email provider such as gmail.com, or if the email is a .edu email, the organization slug will be generated based on the name portion of the email. Otherwise, the organization slug will be generated based on the email domain.' organization_external_id: type: string description: An identifier that can be used in API calls wherever a organization_id is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters. External IDs must be unique within a project, but may be reused across different projects in the same workspace. organization_logo_url: type: string description: The image URL of the Organization logo. trusted_metadata: type: object additionalProperties: true description: An arbitrary JSON object for storing application-specific data or identity-provider-specific data. sso_jit_provisioning: type: string description: "The authentication setting that controls the JIT provisioning\ \ of Members when authenticating via SSO. The accepted values are:\n \n\ \ `ALL_ALLOWED` \u2013 the default setting, new Members will be automatically\ \ provisioned upon successful authentication via any of the Organization's\ \ `sso_active_connections`.\n \n `RESTRICTED` \u2013 only new Members\ \ with SSO logins that comply with `sso_jit_provisioning_allowed_connections`\ \ can be provisioned upon authentication.\n \n `NOT_ALLOWED` \u2013 disable\ \ JIT provisioning via SSO.\n " email_allowed_domains: type: array items: type: string description: "An array of email domains that allow invites or JIT provisioning\ \ for new Members. This list is enforced when either `email_invites` or\ \ `email_jit_provisioning` is set to `RESTRICTED`.\n \n \n Common\ \ domains such as `gmail.com` are not allowed. See the [common email domains\ \ resource](https://stytch.com/docs/b2b/api/common-email-domains) for\ \ the full list." email_jit_provisioning: type: string description: "The authentication setting that controls how a new Member\ \ can be provisioned by authenticating via Email Magic Link or OAuth.\ \ The accepted values are:\n \n `RESTRICTED` \u2013 only new Members\ \ with verified emails that comply with `email_allowed_domains` can be\ \ provisioned upon authentication via Email Magic Link or OAuth.\n \n\ \ `NOT_ALLOWED` \u2013 the default setting, disables JIT provisioning\ \ via Email Magic Link and OAuth.\n " email_invites: type: string description: "The authentication setting that controls how a new Member\ \ can be invited to an organization by email. The accepted values are:\n\ \ \n `ALL_ALLOWED` \u2013 any new Member can be invited to join via email.\n\ \ \n `RESTRICTED` \u2013 only new Members with verified emails that comply\ \ with `email_allowed_domains` can be invited via email.\n \n `NOT_ALLOWED`\ \ \u2013 disable email invites.\n " auth_methods: type: string description: "The setting that controls which authentication methods can\ \ be used by Members of an Organization. The accepted values are:\n \n\ \ `ALL_ALLOWED` \u2013 the default setting which allows all authentication\ \ methods to be used.\n \n `RESTRICTED` \u2013 only methods that comply\ \ with `allowed_auth_methods` can be used for authentication. This setting\ \ does not apply to Members with `is_breakglass` set to `true`.\n " allowed_auth_methods: type: array items: type: string description: "An array of allowed authentication methods. This list is enforced\ \ when `auth_methods` is set to `RESTRICTED`.\n The list's accepted values\ \ are: `sso`, `magic_link`, `email_otp`, `password`, `google_oauth`, `microsoft_oauth`,\ \ `slack_oauth`, `github_oauth`, and `hubspot_oauth`.\n " mfa_policy: type: string description: "The setting that controls the MFA policy for all Members in\ \ the Organization. The accepted values are:\n \n `REQUIRED_FOR_ALL`\ \ \u2013 All Members within the Organization will be required to complete\ \ MFA every time they wish to log in. However, any active Session that\ \ existed prior to this setting change will remain valid.\n \n `OPTIONAL`\ \ \u2013 The default value. The Organization does not require MFA by default\ \ for all Members. Members will be required to complete MFA only if their\ \ `mfa_enrolled` status is set to true.\n " rbac_email_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_organization_v1_EmailImplicitRoleAssignment' description: "Implicit role assignments based off of email domains.\n For\ \ each domain-Role pair, all Members whose email addresses have the specified\ \ email domain will be granted the\n associated Role, regardless of their\ \ login method. See the [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\n\ \ for more information about role assignment." mfa_methods: type: string description: "The setting that controls which MFA methods can be used by\ \ Members of an Organization. The accepted values are:\n \n `ALL_ALLOWED`\ \ \u2013 the default setting which allows all authentication methods to\ \ be used.\n \n `RESTRICTED` \u2013 only methods that comply with `allowed_mfa_methods`\ \ can be used for authentication. This setting does not apply to Members\ \ with `is_breakglass` set to `true`.\n " allowed_mfa_methods: type: array items: type: string description: "An array of allowed MFA authentication methods. This list\ \ is enforced when `mfa_methods` is set to `RESTRICTED`.\n The list's\ \ accepted values are: `sms_otp` and `totp`.\n " oauth_tenant_jit_provisioning: type: string description: "The authentication setting that controls how a new Member\ \ can JIT provision into an organization by tenant. The accepted values\ \ are:\n \n `RESTRICTED` \u2013 only new Members with tenants in `allowed_oauth_tenants`\ \ can JIT provision via tenant.\n \n `NOT_ALLOWED` \u2013 the default\ \ setting, disables JIT provisioning by OAuth Tenant.\n " allowed_oauth_tenants: type: object additionalProperties: true description: A map of allowed OAuth tenants. If this field is not passed in, the Organization will not allow JIT provisioning by OAuth Tenant. Allowed keys are "slack", "hubspot", and "github". first_party_connected_apps_allowed_type: $ref: '#/components/schemas/api_discovery_v1_CreateRequestFirstPartyConnectedAppsAllowedType' description: "The authentication setting that sets the Organization's policy\ \ towards first party Connected Apps. The accepted values are:\n \n `ALL_ALLOWED`\ \ \u2013 the default setting, any first party Connected App in the Project\ \ is permitted for use by Members.\n \n `RESTRICTED` \u2013 only first\ \ party Connected Apps with IDs in `allowed_first_party_connected_apps`\ \ can be used by Members.\n \n `NOT_ALLOWED` \u2013 no first party Connected\ \ Apps are permitted.\n " allowed_first_party_connected_apps: type: array items: type: string description: An array of first party Connected App IDs that are allowed for the Organization. Only used when the Organization's `first_party_connected_apps_allowed_type` is `RESTRICTED`. third_party_connected_apps_allowed_type: $ref: '#/components/schemas/api_discovery_v1_CreateRequestThirdPartyConnectedAppsAllowedType' description: "The authentication setting that sets the Organization's policy\ \ towards third party Connected Apps. The accepted values are:\n \n `ALL_ALLOWED`\ \ \u2013 the default setting, any third party Connected App in the Project\ \ is permitted for use by Members.\n \n `RESTRICTED` \u2013 only third\ \ party Connected Apps with IDs in `allowed_first_party_connected_apps`\ \ can be used by Members.\n \n `NOT_ALLOWED` \u2013 no third party Connected\ \ Apps are permitted.\n " allowed_third_party_connected_apps: type: array items: type: string description: An array of third party Connected App IDs that are allowed for the Organization. Only used when the Organization's `third_party_connected_apps_allowed_type` is `RESTRICTED`. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - intermediate_session_token api_discovery_v1_discovery_organizations_CreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). member_authenticated: type: boolean description: Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step to log in to the Organization. intermediate_session_token: type: string description: The returned Intermediate Session Token is identical to the one that was originally passed in to the request. If this value is non-empty, the member must complete an MFA step to finish logging in to the Organization. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. primary_required: $ref: '#/components/schemas/api_b2b_session_v1_PrimaryRequired' description: Information about the primary authentication requirements of the Organization. member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - session_token - session_jwt - member - organization - member_authenticated - intermediate_session_token - status_code api_discovery_v1_CreateRequestFirstPartyConnectedAppsAllowedType: type: string enum: - ALL_ALLOWED - RESTRICTED - NOT_ALLOWED api_discovery_v1_CreateRequestThirdPartyConnectedAppsAllowedType: type: string enum: - ALL_ALLOWED - RESTRICTED - NOT_ALLOWED api_fraud_v1_ASNProperties: type: object properties: asn: type: string description: The Autonomous System Number of the user's network. name: type: string description: Public name associated with the ASN. network: type: string description: The CIDR block associated with the ASN. required: - asn - name - network api_fraud_v1_AddressInformation: type: object properties: has_known_bounces: type: boolean description: Whether email sent to this address is known to have bounced previously. has_valid_syntax: type: boolean description: Whether this email address is valid. is_suspected_role_address: type: boolean description: Whether the local part of the email appears to be a role or group, rather than an individual end user. normalized_email: type: string description: The normalized email address after removing '.' characters and any characters after a '+'. tumbling_character_count: type: integer format: int32 description: The number of '.' and '+' characters in the email address. A higher tumbling count indicates a higher potential for fraud. required: - has_known_bounces - has_valid_syntax - is_suspected_role_address - normalized_email - tumbling_character_count api_fraud_v1_BrowserProperties: type: object properties: user_agent: type: string description: The user agent of the user's browser. required: - user_agent api_fraud_v1_DomainInformation: type: object properties: has_mx_or_a_record: type: boolean description: Whether the email has appropriate DNS records to deliver a message. is_disposable_domain: type: boolean description: Whether the email domain is known to be disposable. required: - has_mx_or_a_record - is_disposable_domain api_fraud_v1_Fingerprints: type: object properties: network_fingerprint: type: string description: 'Combination of signals associated with a specific network commonly known as TLS fingerprinting. ' hardware_fingerprint: type: string description: Combinations of signals to identify an operating system and architecture. browser_fingerprint: type: string description: Combination of signals to identify a browser and its specific version. visitor_fingerprint: type: string description: Cookie-less way of identifying a unique user. visitor_id: type: string description: The cookie stored on the user's device that uniquely identifies them. browser_id: type: string description: Combination of VisitorID and NetworkFingerprint to create a clear identifier of a browser. required: - network_fingerprint - hardware_fingerprint - browser_fingerprint - visitor_fingerprint api_fraud_v1_IPGeoProperties: type: object properties: city: type: string description: The city where the IP is located. region: type: string description: The region where the IP is located. country: type: string description: The country where the IP is located. required: - city - region - country api_fraud_v1_Metadata: type: object properties: external_id: type: string description: An external ID, such as a user ID, that you wish to associate with the telemetry ID. organization_id: type: string description: The organization ID you wish to associate with the telemetry ID. user_action: type: string description: The user action, such as 'login', that you wish to associate with the telemetry ID. api_fraud_v1_NetworkProperties: type: object properties: ip_address: type: string description: The IP address of the client. asn: $ref: '#/components/schemas/api_fraud_v1_ASNProperties' description: Information about the network's ASN (Autonomous System Number). ip_geolocation: $ref: '#/components/schemas/api_fraud_v1_IPGeoProperties' description: Information about the geolocation of the user's IP address. is_proxy: type: boolean description: Whether the user is using a proxy. is_vpn: type: boolean description: Whether the user is using a VPN. required: - ip_address - asn - ip_geolocation - is_proxy - is_vpn api_fraud_v1_Properties: type: object properties: network_properties: $ref: '#/components/schemas/api_fraud_v1_NetworkProperties' browser_properties: $ref: '#/components/schemas/api_fraud_v1_BrowserProperties' required: - network_properties - browser_properties api_fraud_v1_Rule: type: object properties: rule_type: $ref: '#/components/schemas/api_fraud_v1_RuleType' description: The rule type. The possible values are `VISITOR_ID`, `BROWSER_ID`, `VISITOR_FINGERPRINT`, `BROWSER_FINGERPRINT`, `HARDWARE_FINGERPRINT`, `NETWORK_FINGERPRINT`, `CIDR_BLOCK`, `ASN`, or `COUNTRY_CODE`. action: $ref: '#/components/schemas/api_fraud_v1_RuleAction' description: The action (`ALLOW`, `BLOCK`, or `CHALLENGE`) that will be returned for this rule. created_at: type: string description: The time when the rule was created. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. visitor_id: type: string description: The visitor ID that a rule was set for. browser_id: type: string description: The browser ID that a rule was set for. visitor_fingerprint: type: string description: The visitor fingerprint that a rule was set for. browser_fingerprint: type: string description: The browser fingerprint that a rule was set for. hardware_fingerprint: type: string description: The hardware fingerprint that a rule was set for. network_fingerprint: type: string description: The network fingerprint that a rule was set for. cidr_block: type: string description: The CIDR block that a rule was set for. If an end user's IP address is within this CIDR block, this rule will be applied. country_code: type: string description: The country code that a rule was set for. asn: type: string description: The ASN that a rule was set for. description: type: string description: A description for the rule. expires_at: type: string description: The timestamp when the rule expires. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. last_updated_at: type: string description: The time when the rule was last updated. Will be null if the rule has never been updated. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. required: - rule_type - action - created_at api_fraud_v1_Verdict: type: object properties: action: $ref: '#/components/schemas/api_fraud_v1_VerdictAction' description: "The suggested action based on the fingerprint review. The\ \ available actions are:\n * `ALLOW` - This is a known valid device grouping\ \ or device profile that is part of the default ALLOW listed set of known\ \ devices by Stytch. This grouping is made up of verified device profiles\ \ that match the characteristics of known/authentic traffic origins\n\ \ * `BLOCK` - This is a known bad or malicious device profile that is\ \ undesirable and should be blocked from completing the privileged action\ \ in question\n * `CHALLENGE` - This is an unknown or potentially malicious\ \ device that should be put through increased friction such as 2FA or\ \ other forms of extended user verification before allowing the privileged\ \ action to proceed\n " reasons: type: array items: type: string description: A set of contextual clues to inform why a `CHALLENGE` or `BLOCK` action was suggested. For a list of possible Reasons, see [Warning Flags (Verdict Reasons)](https://stytch.com/docs/docs/fraud/guides/device-fingerprinting/reference/warning-flags-verdict-reasons). detected_device_type: type: string description: The operating system and architecture that took the fingerprint. is_authentic_device: type: boolean description: The assessment of whether this is an authentic device. It will be false if hardware or browser deception is detected. verdict_reason_overrides: type: array items: $ref: '#/components/schemas/api_fraud_v1_VerdictReasonOverride' description: A list of verdict reason overrides that were applied, if any. rule_match_type: $ref: '#/components/schemas/api_fraud_v1_RuleType' description: The type of rule match that was applied (e.g. `VISITOR_ID`), if any. This field will only be present if there is a `RULE_MATCH` reason in the list of verdict reasons. rule_match_identifier: type: string description: The rule that was applied (e.g. a specific visitor ID value), if any. This field will only be present if there is a `RULE_MATCH` reason in the list of verdict reasons. required: - action - reasons - detected_device_type - is_authentic_device - verdict_reason_overrides api_fraud_v1_VerdictReasonAction: type: object properties: verdict_reason: type: string description: The verdict reason. default_action: $ref: '#/components/schemas/api_fraud_v1_VerdictReasonActionAction' description: The default action returned for the specified verdict reason in a fingerprint lookup when no overrides are specified. override_action: $ref: '#/components/schemas/api_fraud_v1_VerdictReasonActionAction' description: If not null, this action will be returned for the specified verdict reason in a fingerprint lookup, in place of the default action. override_created_at: type: string description: The time when the override was created, if one exists. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. override_description: type: string description: A description of the override, if one exists. required: - verdict_reason - default_action api_fraud_v1_VerdictReasonOverride: type: object properties: verdict_reason: type: string description: The verdict reason that was overridden. override_action: $ref: '#/components/schemas/api_fraud_v1_VerdictReasonOverrideAction' description: The action that was applied for the given verdict reason. required: - verdict_reason - override_action api_fraud_v1_RuleAction: type: string enum: - ALLOW - CHALLENGE - BLOCK - NONE api_fraud_v1_RuleType: type: string enum: - VISITOR_ID - BROWSER_ID - VISITOR_FINGERPRINT - BROWSER_FINGERPRINT - HARDWARE_FINGERPRINT - NETWORK_FINGERPRINT - CIDR_BLOCK - ASN - COUNTRY_CODE api_fraud_v1_VerdictAction: type: string enum: - ALLOW - CHALLENGE - BLOCK api_fraud_v1_VerdictReasonActionAction: type: string enum: - ALLOW - CHALLENGE - BLOCK api_fraud_v1_VerdictReasonOverrideAction: type: string enum: - ALLOW - CHALLENGE - BLOCK api_fraud_v1_fraud_fingerprint_LookupRequest: type: object properties: telemetry_id: type: string description: The telemetry ID associated with the fingerprint getting looked up. external_metadata: $ref: '#/components/schemas/api_fraud_v1_Metadata' description: External identifiers that you wish to associate with the given telemetry ID. You will be able to search for fingerprint results by these identifiers in the DFP analytics dashboard. External metadata fields may not exceed 65 characters. They may only contain alphanumerics and the characters `_` `-` `+` `.` or `@`. description: Request type required: - telemetry_id api_fraud_v1_fraud_fingerprint_LookupResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. telemetry_id: type: string description: The telemetry ID associated with the fingerprint getting looked up. fingerprints: $ref: '#/components/schemas/api_fraud_v1_Fingerprints' description: 'A Stytch fingerprint consists of the following identifiers:' verdict: $ref: '#/components/schemas/api_fraud_v1_Verdict' description: The metadata associated with each fingerprint external_metadata: $ref: '#/components/schemas/api_fraud_v1_Metadata' description: External identifiers that you wish to associate with the given telemetry ID. You will be able to search for fingerprint results by these identifiers in the DFP analytics dashboard. External metadata fields may not exceed 65 characters. They may only contain alphanumerics and the characters `_` `-` `+` `.` or `@`. created_at: type: string description: The time when the fingerprint was taken. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. expires_at: type: string description: The timestamp when the fingerprint expires. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. properties: $ref: '#/components/schemas/api_fraud_v1_Properties' description: Additional information about the user's browser and network. raw_signals: type: object additionalProperties: true description: The raw device attributes, such as screen size, that were collected by the Device Fingerprinting product to generate the fingerprints and verdict. You must be specifically enabled for the raw signals feature to see this field. You can find documentation for the specific fields in the [guides](https://stytch.com/docs/fraud/guides/device-fingerprinting/reference/raw-signals). required: - request_id - telemetry_id - fingerprints - verdict - external_metadata - created_at - expires_at - status_code api_fraud_v1_fraud_rules_ListRequest: type: object properties: cursor: type: string description: The `cursor` field allows you to paginate through your results. Each result array is limited to 100 results. If your query returns more than 100 results, you will need to paginate the responses using the `cursor`. If you receive a response that includes a non-null `next_cursor`, repeat the request with the `next_cursor` value set to the `cursor` field to retrieve the next page of results. Continue to make requests until the `next_cursor` in the response is null. limit: type: integer format: int32 description: The number of results to return per page. The default limit is 10. A maximum of 100 results can be returned by a single get request. If the total size of your result set is greater than one page size, you must paginate the response. See the `cursor` field. description: Request type api_fraud_v1_fraud_rules_ListResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. next_cursor: type: string description: The `next_cursor` string is returned when your result contains more than one page of results. This value is passed into your next request in the `cursor` field. rules: type: array items: $ref: '#/components/schemas/api_fraud_v1_Rule' description: A list of rules for the project status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - next_cursor - rules - status_code api_fraud_v1_fraud_rules_SetRequest: type: object properties: action: $ref: '#/components/schemas/api_fraud_v1_RuleAction' description: 'The action that should be returned by a fingerprint lookup for that identifier with a `RULE_MATCH` reason. The following values are valid: `ALLOW`, `BLOCK`, `CHALLENGE`, or `NONE`. For country codes, `ALLOW` actions are not allowed. If a `NONE` action is specified, it will clear the stored rule.' visitor_id: type: string description: The visitor ID we want to set a rule for. Only one identifier can be specified in the request. browser_id: type: string description: The browser ID we want to set a rule for. Only one identifier can be specified in the request. visitor_fingerprint: type: string description: The visitor fingerprint we want to set a rule for. Only one identifier can be specified in the request. browser_fingerprint: type: string description: The browser fingerprint we want to set a rule for. Only one identifier can be specified in the request. hardware_fingerprint: type: string description: The hardware fingerprint we want to set a rule for. Only one identifier can be specified in the request. network_fingerprint: type: string description: The network fingerprint we want to set a rule for. Only one identifier can be specified in the request. expires_in_minutes: type: integer format: int32 description: The number of minutes until this rule expires. If no `expires_in_minutes` is specified, then the rule is kept permanently. description: type: string description: An optional description for the rule. cidr_block: type: string description: The CIDR block we want to set a rule for. You may pass either an IP address or a CIDR block. The CIDR block prefix must be between 16 and 32, inclusive. If an end user's IP address is within this CIDR block, this rule will be applied. Only one identifier can be specified in the request. country_code: type: string description: The country code we want to set a rule for. The country code must be a valid ISO 3166-1 alpha-2 code. You may not set `ALLOW` rules for country codes. Only one identifier can be specified in the request. asn: type: string description: The ASN we want to set a rule for. The ASN must be the string representation of an integer between 0 and 4294967295, inclusive. Only one identifier can be specified in the request. description: Request type required: - action api_fraud_v1_fraud_rules_SetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. action: $ref: '#/components/schemas/api_fraud_v1_RuleAction' description: The action that will be returned for the specified identifier. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. visitor_id: type: string description: The visitor ID that a rule was set for. browser_id: type: string description: The browser ID that a rule was set for. visitor_fingerprint: type: string description: The visitor fingerprint that a rule was set for. browser_fingerprint: type: string description: The browser fingerprint that a rule was set for. hardware_fingerprint: type: string description: The hardware fingerprint that a rule was set for. network_fingerprint: type: string description: The network fingerprint that a rule was set for. expires_at: type: string description: The timestamp when the rule expires. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. cidr_block: type: string description: The CIDR block that a rule was set for. If an end user's IP address is within this CIDR block, this rule will be applied. country_code: type: string description: The country code that a rule was set for. asn: type: string description: The ASN that a rule was set for. required: - request_id - action - status_code api_fraud_v1_fraud_verdict_reasons_ListRequest: type: object properties: overrides_only: type: boolean description: Whether to return only verdict reasons that have overrides set. Defaults to false. description: Request type api_fraud_v1_fraud_verdict_reasons_ListResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. verdict_reason_actions: type: array items: $ref: '#/components/schemas/api_fraud_v1_VerdictReasonAction' description: Information about verdict reasons and any overrides that were set on them. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - verdict_reason_actions - status_code api_fraud_v1_fraud_verdict_reasons_OverrideRequest: type: object properties: verdict_reason: type: string description: The verdict reason that you wish to override. For a list of possible reasons to override, see [Warning Flags (Verdict Reasons)](https://stytch.com/docs/docs/fraud/guides/device-fingerprinting/reference/warning-flags-verdict-reasons). You may not override the `RULE_MATCH` reason. override_action: $ref: '#/components/schemas/api_fraud_v1_OverrideRequestAction' description: The action that you want to be returned for the specified verdict reason. The override action must be one of `ALLOW`, `BLOCK`, or `CHALLENGE`. override_description: type: string description: An optional description for the verdict reason override. description: Request type required: - verdict_reason - override_action api_fraud_v1_fraud_verdict_reasons_OverrideResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. verdict_reason_action: $ref: '#/components/schemas/api_fraud_v1_VerdictReasonAction' description: Information about the verdict reason override that was just set. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - verdict_reason_action - status_code api_fraud_v1_OverrideRequestAction: type: string enum: - ALLOW - CHALLENGE - BLOCK - NONE api_fraud_v1_fraud_email_RiskRequest: type: object properties: email_address: type: string description: The email address to check. description: Request type required: - email_address api_fraud_v1_fraud_email_RiskResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. address_information: $ref: '#/components/schemas/api_fraud_v1_AddressInformation' description: Information about the email address. domain_information: $ref: '#/components/schemas/api_fraud_v1_DomainInformation' description: Information about the email domain. action: $ref: '#/components/schemas/api_fraud_v1_RiskResponseAction' description: "The suggested action based on the attributes of the email\ \ address. The available actions are:\n * `ALLOW` - This email is most\ \ likely safe to send to and not fraudulent.\n * `BLOCK` - This email\ \ is invalid or exhibits signs of fraud. We recommend blocking the end\ \ user.\n * `CHALLENGE` - This email has some potentially fraudulent\ \ attributes. We recommend increased friction such as 2FA or other forms\ \ of extended user verification before allowing the privileged action\ \ to proceed.\n " risk_score: type: integer format: int32 description: A score from 0 to 100 indicating how risky the email is. 100 is the most risky. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - address_information - domain_information - action - risk_score - status_code api_fraud_v1_RiskResponseAction: type: string enum: - ALLOW - CHALLENGE - BLOCK api_idp_v1_ScopeResult: type: object properties: scope: type: string description: The name of the scope. description: type: string description: A human-readable description of the scope, taken from the RBAC Policy. is_grantable: type: boolean description: Indicates whether the scope can be granted. Users can only grant scopes if they have the required permissions. required: - scope - description - is_grantable api_idp_v1_idp_oauth_AuthorizeRequest: type: object properties: consent_granted: type: boolean description: Indicates whether the user granted the requested scopes. scopes: type: array items: type: string description: An array of scopes requested by the client. client_id: type: string description: The ID of the Connected App client. redirect_uri: type: string description: The callback URI used to redirect the user after authentication. This is the same URI provided at the start of the OAuth flow. This field is required when using the `authorization_code` grant. response_type: type: string description: The OAuth 2.0 response type. For authorization code flows this value is `code`. user_id: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. session_token: type: string description: The `session_token` associated with a User's existing Session. session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. prompt: type: string description: Space separated list that specifies how the Authorization Server should prompt the user for reauthentication and consent. Only `consent` is supported today. state: type: string description: An opaque value used to maintain state between the request and callback. nonce: type: string description: A string used to associate a client session with an ID token to mitigate replay attacks. code_challenge: type: string description: A base64url encoded challenge derived from the code verifier for PKCE flows. resources: type: array items: type: string description: Request type required: - consent_granted - scopes - client_id - redirect_uri - response_type api_idp_v1_idp_oauth_AuthorizeResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. redirect_uri: type: string description: The callback URI used to redirect the user after authentication. This is the same URI provided at the start of the OAuth flow. This field is required when using the `authorization_code` grant. status_code: type: integer format: int32 authorization_code: type: string description: A one-time use code that can be exchanged for tokens. required: - request_id - redirect_uri - status_code api_idp_v1_idp_oauth_AuthorizeStartRequest: type: object properties: client_id: type: string description: The ID of the Connected App client. redirect_uri: type: string description: The callback URI used to redirect the user after authentication. This is the same URI provided at the start of the OAuth flow. This field is required when using the `authorization_code` grant. response_type: type: string description: The OAuth 2.0 response type. For authorization code flows this value is `code`. scopes: type: array items: type: string description: An array of scopes requested by the client. user_id: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. session_token: type: string description: The `session_token` associated with a User's existing Session. session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. prompt: type: string description: Space separated list that specifies how the Authorization Server should prompt the user for reauthentication and consent. Only `consent` is supported today. description: Request type required: - client_id - redirect_uri - response_type - scopes api_idp_v1_idp_oauth_AuthorizeStartResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. client: $ref: '#/components/schemas/api_connectedapps_v1_ConnectedAppPublic' consent_required: type: boolean description: Whether the user must provide explicit consent for the authorization request. scope_results: type: array items: $ref: '#/components/schemas/api_idp_v1_ScopeResult' description: Details about each requested scope. status_code: type: integer format: int32 required: - request_id - user_id - user - client - consent_required - scope_results - status_code api_impersonation_v1_AuthenticateRequest: type: object properties: impersonation_token: type: string description: The User Impersonation token to authenticate. Expires in 5 minutes by default. description: Request type required: - impersonation_token api_impersonation_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " required: - request_id - user_id - user - session_token - session_jwt - status_code api_m2m_v1_M2MClient: type: object properties: client_id: type: string description: The ID of the client. client_name: type: string description: A human-readable name for the client. client_description: type: string description: A human-readable description for the client. status: type: string description: The status of the client - either `active` or `inactive`. scopes: type: array items: type: string description: An array of scopes assigned to the client. client_secret_last_four: type: string description: The last four characters of the client secret. trusted_metadata: type: object additionalProperties: true description: An arbitrary JSON object for storing application-specific data. next_client_secret_last_four: type: string description: The last four characters of the `next_client_secret`. Null if no `next_client_secret` exists. required: - client_id - client_name - client_description - status - scopes - client_secret_last_four api_m2m_v1_M2MClientWithClientSecret: type: object properties: client_id: type: string description: The ID of the client. client_secret: type: string description: The secret of the client. **Important:** this is the only time you will be able to view the `client_secret`. Be sure to persist the `client_secret` in a secure location. If the `client_secret` is lost, you will need to trigger a secret rotation flow to receive another one. client_name: type: string description: A human-readable name for the client. client_description: type: string description: A human-readable description for the client. status: type: string description: The status of the client - either `active` or `inactive`. scopes: type: array items: type: string description: An array of scopes assigned to the client. client_secret_last_four: type: string description: The last four characters of the client secret. trusted_metadata: type: object additionalProperties: true description: An arbitrary JSON object for storing application-specific data. next_client_secret_last_four: type: string description: The last four characters of the `next_client_secret`. Null if no `next_client_secret` exists. required: - client_id - client_secret - client_name - client_description - status - scopes - client_secret_last_four api_m2m_v1_M2MClientWithNextClientSecret: type: object properties: client_id: type: string description: The ID of the client. next_client_secret: type: string description: The newly created secret that's next in rotation for the client. **Important:** this is the only time you will be able to view the `next_client_secret`. Be sure to persist the `next_client_secret` in a secure location. If the `next_client_secret` is lost, you will need to trigger a secret rotation flow to receive another one. client_name: type: string description: A human-readable name for the client. client_description: type: string description: A human-readable description for the client. status: type: string description: The status of the client - either `active` or `inactive`. scopes: type: array items: type: string description: An array of scopes assigned to the client. client_secret_last_four: type: string description: The last four characters of the client secret. trusted_metadata: type: object additionalProperties: true description: An arbitrary JSON object for storing application-specific data. next_client_secret_last_four: type: string description: The last four characters of the `next_client_secret`. Null if no `next_client_secret` exists. required: - client_id - next_client_secret - client_name - client_description - status - scopes - client_secret_last_four api_m2m_v1_M2MSearchQuery: type: object properties: operator: $ref: '#/components/schemas/api_m2m_v1_M2MSearchQueryOperator' description: "The action to perform on the operands. The accepted value\ \ are:\n\n `AND` \u2013 all the operand values provided must match.\n\ \ \n `OR` \u2013 the operator will return any matches to at least one\ \ of the operand values you supply." operands: type: array items: type: object additionalProperties: true description: An array of operand objects that contains all of the filters and values to apply to your search search query. required: - operator - operands api_m2m_v1_ResultsMetadata: type: object properties: total: type: integer format: int32 description: The total number of results returned by your search query. If totals have been disabled for your Stytch Workspace to improve search performance, the value will always be -1. next_cursor: type: string description: The `next_cursor` string is returned when your search result contains more than one page of results. This value is passed into your next search call in the `cursor` field. required: - total api_m2m_v1_M2MSearchQueryOperator: type: string enum: - OR - AND api_m2m_v1_m2m_clients_CreateRequest: type: object properties: scopes: type: array items: type: string description: An array of scopes assigned to the client. client_id: type: string description: If provided, the ID of the client to create. If not provided, Stytch will generate this value for you. The `client_id` must be unique within your project. client_secret: type: string description: If provided, the stored secret of the client to create. If not provided, Stytch will generate this value for you. If provided, the `client_secret` must be at least 8 characters long and pass entropy requirements. client_name: type: string description: A human-readable name for the client. client_description: type: string description: A human-readable description for the client. trusted_metadata: type: object additionalProperties: true description: The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. description: Request type required: - scopes api_m2m_v1_m2m_clients_CreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. m2m_client: $ref: '#/components/schemas/api_m2m_v1_M2MClientWithClientSecret' description: The M2M Client created by this API call. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - m2m_client - status_code api_m2m_v1_m2m_clients_DeleteResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. client_id: type: string description: The ID of the client. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - client_id - status_code api_m2m_v1_m2m_clients_GetRequest: type: object properties: {} description: Request type api_m2m_v1_m2m_clients_GetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. m2m_client: $ref: '#/components/schemas/api_m2m_v1_M2MClient' description: The M2M Client affected by this operation. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - m2m_client - status_code api_m2m_v1_m2m_clients_SearchRequest: type: object properties: cursor: 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. limit: 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. query: $ref: '#/components/schemas/api_m2m_v1_M2MSearchQuery' description: The optional query object contains the operator, i.e. `AND` or `OR`, and the operands that will filter your results. Only an operator is required. If you include no operands, no filtering will be applied. If you include no query object, it will return all results with no filtering applied. description: Request type api_m2m_v1_m2m_clients_SearchResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. m2m_clients: type: array items: $ref: '#/components/schemas/api_m2m_v1_M2MClient' description: An array of M2M Clients that match your search query. results_metadata: $ref: '#/components/schemas/api_m2m_v1_ResultsMetadata' description: The search `results_metadata` object contains metadata relevant to your specific query like total and `next_cursor`. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - m2m_clients - results_metadata - status_code api_m2m_v1_m2m_clients_UpdateRequest: type: object properties: client_name: type: string description: A human-readable name for the client. client_description: type: string description: A human-readable description for the client. status: $ref: '#/components/schemas/api_m2m_v1_UpdateRequestStatus' description: The status of the client - either `active` or `inactive`. scopes: type: array items: type: string description: An array of scopes assigned to the client. trusted_metadata: type: object additionalProperties: true description: The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. description: Request type api_m2m_v1_m2m_clients_UpdateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. m2m_client: $ref: '#/components/schemas/api_m2m_v1_M2MClient' description: The M2M Client affected by this operation. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - m2m_client - status_code api_m2m_v1_UpdateRequestStatus: type: string enum: - active - inactive api_m2m_v1_m2m_clients_secrets_RotateCancelRequest: type: object properties: {} description: Request type api_m2m_v1_m2m_clients_secrets_RotateCancelResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. m2m_client: $ref: '#/components/schemas/api_m2m_v1_M2MClient' description: The M2M Client affected by this operation. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - m2m_client - status_code api_m2m_v1_m2m_clients_secrets_RotateRequest: type: object properties: {} description: Request type api_m2m_v1_m2m_clients_secrets_RotateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. m2m_client: $ref: '#/components/schemas/api_m2m_v1_M2MClient' description: The M2M Client affected by this operation. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - m2m_client - status_code api_m2m_v1_m2m_clients_secrets_RotateStartRequest: type: object properties: {} description: Request type api_m2m_v1_m2m_clients_secrets_RotateStartResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. m2m_client: $ref: '#/components/schemas/api_m2m_v1_M2MClientWithNextClientSecret' description: The M2M Client affected by this operation. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - m2m_client - status_code api_magic_v1_Options: type: object properties: ip_match_required: type: boolean description: Require that the IP address the Magic Link was requested from matches the IP address it's clicked from. user_agent_match_required: type: boolean description: Require that the user agent the Magic Link was requested from matches the user agent it's clicked from. required: - ip_match_required - user_agent_match_required api_magic_v1_AuthenticateRequest: type: object properties: token: type: string description: "The Magic Link `token` from the `?token=` query parameter\ \ in the URL.\n\n The redirect URL will look like `https://example.com/authenticate?stytch_token_type=magic_links&token=rM_kw42CWBhsHLF62V75jELMbvJ87njMe3tFVj7Qupu7`\n\ \n In the redirect URL, the `stytch_token_type` will be `magic_link`.\ \ See [here](https://stytch.com/docs/workspace-management/redirect-urls)\ \ for more detail." attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. options: $ref: '#/components/schemas/api_magic_v1_Options' description: Specify optional security settings. session_token: type: string description: The `session_token` associated with a User's existing Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." code_verifier: type: string description: A base64url encoded one time secret used to validate that the request starts and ends on the same device. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - token api_magic_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. method_id: type: string description: The `email_id` or `phone_id` involved in the given authentication. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. reset_sessions: type: boolean description: Indicates if all other of the User's Sessions need to be reset. You should check this field if you aren't using Stytch's Session product. If you are using Stytch's Session product, we revoke the User's other sessions for you. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - method_id - session_token - session_jwt - user - reset_sessions - status_code api_magic_v1_CreateRequest: type: object properties: user_id: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. expiration_minutes: type: integer format: int32 description: Set the expiration for the Magic Link `token` in minutes. By default, it expires in 1 hour. The minimum expiration is 5 minutes and the maximum is 7 days (10080 mins). attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. description: Request type required: - user_id api_magic_v1_CreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. token: type: string description: The Magic Link `token` that you'll include in your contact method of choice, e.g. email or SMS. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - token - status_code api_magic_v1_magic_links_email_InviteRequest: type: object properties: email: type: string description: The email address of the User to send the invite Magic Link to. invite_template_id: type: string description: "Use a custom template for invite emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201CMagic\ \ links - Invite\u201D." attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. name: $ref: '#/components/schemas/api_user_v1_Name' description: The name of the user. Each field in the name object is optional. invite_magic_link_url: type: string description: The URL the end user clicks from the Email Magic Link. This should be a URL that your app receives and parses and subsequently sends an API request to authenticate the Magic Link and log in the User. If this value is not passed, the default invite redirect URL that you set in your Dashboard is used. If you have not set a default sign-up redirect URL, an error is returned. invite_expiration_minutes: type: integer format: int32 description: Set the expiration for the email magic link, in minutes. By default, it expires in 1 hour. The minimum expiration is 5 minutes and the maximum is 7 days (10080 mins). locale: $ref: '#/components/schemas/api_magic_v1_InviteRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' trusted_metadata: type: object additionalProperties: true description: The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. untrusted_metadata: type: object additionalProperties: true description: The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. description: Request type required: - email api_magic_v1_magic_links_email_InviteResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. email_id: type: string description: The unique ID of a specific email address. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - email_id - status_code api_magic_v1_magic_links_email_LoginOrCreateRequest: type: object properties: email: type: string description: The email address of the end user. login_magic_link_url: type: string description: The URL the end user clicks from the login Email Magic Link. This should be a URL that your app receives and parses and subsequently send an API request to authenticate the Magic Link and log in the User. If this value is not passed, the default login redirect URL that you set in your Dashboard is used. If you have not set a default login redirect URL, an error is returned. signup_magic_link_url: type: string description: The URL the end user clicks from the sign-up Email Magic Link. This should be a URL that your app receives and parses and subsequently send an API request to authenticate the Magic Link and sign-up the User. If this value is not passed, the default sign-up redirect URL that you set in your Dashboard is used. If you have not set a default sign-up redirect URL, an error is returned. login_expiration_minutes: type: integer format: int32 description: Set the expiration for the login email magic link, in minutes. By default, it expires in 1 hour. The minimum expiration is 5 minutes and the maximum is 7 days (10080 mins). signup_expiration_minutes: type: integer format: int32 description: Set the expiration for the sign-up email magic link, in minutes. By default, it expires in 1 week. The minimum expiration is 5 minutes and the maximum is 7 days (10080 mins). login_template_id: type: string description: "Use a custom template for login emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201CMagic\ \ links - Login\u201D." signup_template_id: type: string description: "Use a custom template for sign-up emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201CMagic\ \ links - Sign-up\u201D." attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. create_user_as_pending: type: boolean description: "Flag for whether or not to save a user as pending vs active\ \ in Stytch. Defaults to false.\n If true, users will be saved\ \ with status pending in Stytch's backend until authenticated.\n \ \ If false, users will be created as active. An example usage of\n \ \ a true flag would be to require users to verify their phone by\ \ entering the OTP code before creating\n an account for them." code_challenge: type: string description: A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device. locale: $ref: '#/components/schemas/api_magic_v1_LoginOrCreateRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' description: Request type required: - email api_magic_v1_magic_links_email_LoginOrCreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. email_id: type: string description: The unique ID of a specific email address. user_created: type: boolean description: In `login_or_create` endpoints, this field indicates whether or not a User was just created. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - email_id - user_created - status_code api_magic_v1_magic_links_email_RevokeInviteRequest: type: object properties: email: type: string description: The email of the user. description: Request type required: - email api_magic_v1_magic_links_email_RevokeInviteResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - status_code api_magic_v1_magic_links_email_SendRequest: type: object properties: email: type: string description: The email address of the User to send the Magic Link to. login_template_id: type: string description: "Use a custom template for login emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201CMagic\ \ links - Login\u201D." attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. login_magic_link_url: type: string description: The URL the end user clicks from the login Email Magic Link. This should be a URL that your app receives and parses and subsequently send an API request to authenticate the Magic Link and log in the User. If this value is not passed, the default login redirect URL that you set in your Dashboard is used. If you have not set a default login redirect URL, an error is returned. signup_magic_link_url: type: string description: The URL the end user clicks from the sign-up Email Magic Link. This should be a URL that your app receives and parses and subsequently send an API request to authenticate the Magic Link and sign-up the User. If this value is not passed, the default sign-up redirect URL that you set in your Dashboard is used. If you have not set a default sign-up redirect URL, an error is returned. login_expiration_minutes: type: integer format: int32 description: Set the expiration for the login email magic link, in minutes. By default, it expires in 1 hour. The minimum expiration is 5 minutes and the maximum is 7 days (10080 mins). signup_expiration_minutes: type: integer format: int32 description: Set the expiration for the sign-up email magic link, in minutes. By default, it expires in 1 week. The minimum expiration is 5 minutes and the maximum is 7 days (10080 mins). code_challenge: type: string description: A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device. user_id: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. session_token: type: string description: The `session_token` of the user to associate the email with. session_jwt: type: string description: The `session_jwt` of the user to associate the email with. locale: $ref: '#/components/schemas/api_magic_v1_SendRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' signup_template_id: type: string description: "Use a custom template for sign-up emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201CMagic\ \ links - Sign-up\u201D." description: Request type required: - email api_magic_v1_magic_links_email_SendResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. email_id: type: string description: The unique ID of a specific email address. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - email_id - status_code api_magic_v1_InviteRequestLocale: type: string enum: - en - es - pt-br - fr api_magic_v1_LoginOrCreateRequestLocale: type: string enum: - en - es - pt-br - fr api_magic_v1_SendRequestLocale: type: string enum: - en - es - pt-br - fr api_b2b_magic_v1_AuthenticateRequest: type: object properties: magic_links_token: type: string description: The Email Magic Link token to authenticate. pkce_code_verifier: type: string description: A base64url encoded one time secret used to validate that the request starts and ends on the same device. session_token: type: string description: "Reuse an existing session instead of creating a new one. If\ \ you provide a `session_token`, Stytch will update the session.\n \ \ If the `session_token` and `magic_links_token` belong to different\ \ Members, the `session_token` will be ignored. This endpoint will error\ \ if\n both `session_token` and `session_jwt` are provided." session_jwt: type: string description: "Reuse an existing session instead of creating a new one. If\ \ you provide a `session_jwt`, Stytch will update the session. If the\ \ `session_jwt`\n and `magic_links_token` belong to different Members,\ \ the `session_jwt` will be ignored. This endpoint will error if both\ \ `session_token` and `session_jwt`\n are provided." session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." locale: $ref: '#/components/schemas/api_b2b_magic_v1_AuthenticateRequestLocale' description: 'If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will pre-emptively send a one-time passcode (OTP) to the Member''s phone number. The locale argument will be used to determine which language to use when sending the passcode. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' intermediate_session_token: type: string description: Adds this primary authentication factor to the intermediate session token. If the resulting set of factors satisfies the organization's primary authentication requirements and MFA requirements, the intermediate session token will be consumed and converted to a member session. If not, the same intermediate session token will be returned. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - magic_links_token api_b2b_magic_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. method_id: type: string description: The email or device involved in the authentication. reset_sessions: type: boolean description: This field is deprecated. organization_id: 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. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). intermediate_session_token: type: string description: The returned Intermediate Session Token contains an Email Magic Link factor associated with the Member's email address. If this value is non-empty, the member must complete an MFA step to finish logging in to the Organization. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. member_authenticated: type: boolean description: Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step to log in to the Organization. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. primary_required: $ref: '#/components/schemas/api_b2b_session_v1_PrimaryRequired' member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - method_id - reset_sessions - organization_id - member - session_token - session_jwt - organization - intermediate_session_token - member_authenticated - status_code api_b2b_magic_v1_AuthenticateRequestLocale: type: string enum: - en - es - pt-br - fr api_b2b_magic_v1_b2b_magic_links_email_InviteRequest: type: object properties: organization_id: 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. email_address: type: string description: The email address of the Member. invite_redirect_url: type: string description: "The URL that the Member clicks from the invite Email Magic\ \ Link. This URL should be an endpoint in the backend server that verifies\n\ \ the request by querying Stytch's authenticate endpoint and finishes\ \ the invite flow. If this value is not passed, the default `invite_redirect_url`\n\ \ that you set in your Dashboard is used. If you have not set a default\ \ `invite_redirect_url`, an error is returned." invited_by_member_id: type: string description: The `member_id` of the Member who sends the invite. name: type: string description: The name of the Member. trusted_metadata: type: object additionalProperties: true description: An arbitrary JSON object for storing application-specific data or identity-provider-specific data. untrusted_metadata: type: object additionalProperties: true description: "An arbitrary JSON object of application-specific data. These\ \ fields can be edited directly by the\n frontend SDK, and should not\ \ be used to store critical information. See the [Metadata resource](https://stytch.com/docs/b2b/api/metadata)\n\ \ for complete field behavior details." invite_template_id: type: string description: "Use a custom template for invite emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201CMagic\ \ Links - Invite\u201D." locale: $ref: '#/components/schemas/api_b2b_magic_v1_InviteRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' roles: type: array items: type: string description: "Roles to explicitly assign to this Member. See the [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\n\ \ for more information about role assignment." invite_expiration_minutes: type: integer format: int32 minimum: 0 description: The expiration time, in minutes, for an invite email. If not accepted within this time frame, the invite will need to be resent. Defaults to 10080 (1 week) with a minimum of 5 and a maximum of 10080. description: Request type required: - organization_id - email_address api_b2b_magic_v1_b2b_magic_links_email_InviteResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - status_code api_b2b_magic_v1_b2b_magic_links_email_LoginOrSignupRequest: type: object properties: organization_id: 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. email_address: type: string description: The email address of the Member. login_redirect_url: type: string description: "The URL that the Member clicks from the login Email Magic\ \ Link. This URL should be an endpoint in the backend server that\n verifies\ \ the request by querying Stytch's authenticate endpoint and finishes\ \ the login. If this value is not passed, the default login\n redirect\ \ URL that you set in your Dashboard is used. If you have not set a default\ \ login redirect URL, an error is returned." signup_redirect_url: type: string description: "The URL the Member clicks from the signup Email Magic Link.\ \ This URL should be an endpoint in the backend server that verifies\n\ \ the request by querying Stytch's authenticate endpoint and finishes\ \ the login. If this value is not passed, the default sign-up redirect\ \ URL\n that you set in your Dashboard is used. If you have not set a\ \ default sign-up redirect URL, an error is returned." pkce_code_challenge: type: string description: A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device. login_template_id: type: string description: "Use a custom template for login emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201CMagic\ \ Links - Login\u201D." signup_template_id: type: string description: "Use a custom template for signup emails. By default, it will\ \ use your default email template. The template must be from Stytch's\n\ built-in customizations or a custom HTML email for \u201CMagic Links -\ \ Signup\u201D." locale: $ref: '#/components/schemas/api_b2b_magic_v1_LoginOrSignupRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' login_expiration_minutes: type: integer format: int32 minimum: 0 description: The expiration time, in minutes, for a login Email Magic Link. If not authenticated within this time frame, the email will need to be resent. Defaults to 60 (1 hour) with a minimum of 5 and a maximum of 10080 (1 week). signup_expiration_minutes: type: integer format: int32 minimum: 0 description: The expiration time, in minutes, for a signup Email Magic Link. If not authenticated within this time frame, the email will need to be resent. Defaults to 60 (1 hour) with a minimum of 5 and a maximum of 10080 (1 week). description: Request type required: - organization_id - email_address api_b2b_magic_v1_b2b_magic_links_email_LoginOrSignupResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member_created: type: boolean description: A flag indicating `true` if a new Member object was created and `false` if the Member object already existed. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member_created - member - organization - status_code api_b2b_magic_v1_InviteRequestLocale: type: string enum: - en - es - pt-br - fr api_b2b_magic_v1_LoginOrSignupRequestLocale: type: string enum: - en - es - pt-br - fr api_b2b_magic_v1_b2b_magic_links_email_discovery_SendRequest: type: object properties: email_address: type: string description: The email address of the Member. discovery_redirect_url: type: string description: "The URL that the end user clicks from the discovery Magic\ \ Link. This URL should be an endpoint in the backend server that\n verifies\ \ the request by querying Stytch's discovery authenticate endpoint and\ \ continues the flow. If this value is not passed, the default\n discovery\ \ redirect URL that you set in your Dashboard is used. If you have not\ \ set a default discovery redirect URL, an error is returned." pkce_code_challenge: type: string description: A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device. login_template_id: type: string description: "Use a custom template for discovery emails. By default, it\ \ will use your default email template. Templates can be added in the\ \ [Stytch dashboard](https://stytch.com/dashboard/templates) using our\ \ built-in customization options or custom HTML templates with type \u201C\ Magic Links - Login\u201D." locale: $ref: '#/components/schemas/api_b2b_magic_v1_SendRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' discovery_expiration_minutes: type: integer format: int32 minimum: 0 description: The expiration time, in minutes, for an discovery magic link email. If not accepted within this time frame, the email will need to be resent. Defaults to 60 (1 hour) with a minimum of 5 and a maximum of 10080 (1 week). description: Request type required: - email_address api_b2b_magic_v1_b2b_magic_links_email_discovery_SendResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - status_code api_b2b_magic_v1_SendRequestLocale: type: string enum: - en - es - pt-br - fr api_b2b_magic_v1_b2b_magic_links_discovery_AuthenticateRequest: type: object properties: discovery_magic_links_token: type: string description: The Discovery Email Magic Link token to authenticate. pkce_code_verifier: type: string description: A base64url encoded one time secret used to validate that the request starts and ends on the same device. description: Request type required: - discovery_magic_links_token api_b2b_magic_v1_b2b_magic_links_discovery_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. email_address: type: string description: The email address. discovered_organizations: type: array items: $ref: '#/components/schemas/api_discovery_v1_DiscoveredOrganization' description: "An array of `discovered_organization` objects tied to the\ \ `intermediate_session_token`, `session_token`, or `session_jwt`. See\ \ the [Discovered Organization Object](https://stytch.com/docs/b2b/api/discovered-organization-object)\ \ for complete details.\n\n Note that Organizations will only appear\ \ here under any of the following conditions:\n 1. The end user is already\ \ a Member of the Organization.\n 2. The end user is invited to the Organization.\n\ \ 3. The end user can join the Organization because:\n\n a) The\ \ Organization allows JIT provisioning.\n\n b) The Organizations'\ \ allowed domains list contains the Member's email domain.\n\n c)\ \ The Organization has at least one other Member with a verified email\ \ address with the same domain as the end user (to prevent phishing attacks)." status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - intermediate_session_token - email_address - discovered_organizations - status_code api_b2b_oauth_v1_ProviderValues: type: object properties: scopes: type: array items: type: string description: The OAuth scopes included for a given provider. See each provider's section above to see which scopes are included by default and how to add custom scopes. access_token: type: string description: The `access_token` that you may use to access the User's data in the provider's API. refresh_token: type: string description: The `refresh_token` that you may use to obtain a new `access_token` for the User within the provider's API. expires_at: type: string id_token: type: string description: The `id_token` returned by the OAuth provider. ID Tokens are JWTs that contain structured information about a user. The exact content of each ID Token varies from provider to provider. ID Tokens are returned from OAuth providers that conform to the [OpenID Connect](https://openid.net/foundation/) specification, which is based on OAuth. required: - scopes api_b2b_oauth_v1_AuthenticateRequest: type: object properties: oauth_token: type: string description: The token to authenticate. session_token: type: string description: A secret token for a given Stytch Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." pkce_code_verifier: type: string description: A base64url encoded one time secret used to validate that the request starts and ends on the same device. locale: $ref: '#/components/schemas/api_b2b_oauth_v1_AuthenticateRequestLocale' description: 'If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will pre-emptively send a one-time passcode (OTP) to the Member''s phone number. The locale argument will be used to determine which language to use when sending the passcode. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' intermediate_session_token: type: string description: Adds this primary authentication factor to the intermediate session token. If the resulting set of factors satisfies the organization's primary authentication requirements and MFA requirements, the intermediate session token will be consumed and converted to a member session. If not, the same intermediate session token will be returned. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - oauth_token api_b2b_oauth_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols. provider_type: type: string description: Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization_id: 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. organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). reset_sessions: type: boolean description: This field is deprecated. member_authenticated: type: boolean description: Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step to log in to the Organization. intermediate_session_token: type: string description: The returned Intermediate Session Token contains an OAuth factor associated with the Member's email address. If this value is non-empty, the member must complete an MFA step to finish logging in to the Organization. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). provider_values: $ref: '#/components/schemas/api_b2b_oauth_v1_ProviderValues' description: "The `provider_values` object lists relevant identifiers, values,\ \ and scopes for a given OAuth provider. For example this object will\ \ include a provider's `access_token` that you can use to access the provider's\ \ API for a given user.\n\n Note that these values will vary based on\ \ the OAuth provider in question, e.g. `id_token` is only returned by\ \ Microsoft. Google One Tap does not return access tokens or refresh tokens." mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. primary_required: $ref: '#/components/schemas/api_b2b_session_v1_PrimaryRequired' description: Information about the primary authentication requirements of the Organization. member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - provider_subject - provider_type - session_token - session_jwt - member - organization_id - organization - reset_sessions - member_authenticated - intermediate_session_token - status_code api_b2b_oauth_v1_AuthenticateRequestLocale: type: string enum: - en - es - pt-br - fr - it - de-DE - zh-Hans - ca-ES api_b2b_oauth_v1_b2b_oauth_discovery_AuthenticateRequest: type: object properties: discovery_oauth_token: type: string description: The Discovery OAuth token to authenticate. session_token: type: string session_duration_minutes: type: integer format: int32 session_jwt: type: string session_custom_claims: type: object additionalProperties: true pkce_code_verifier: type: string description: A base64url encoded one time secret used to validate that the request starts and ends on the same device. description: Request type required: - discovery_oauth_token api_b2b_oauth_v1_b2b_oauth_discovery_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. email_address: type: string description: The email address. discovered_organizations: type: array items: $ref: '#/components/schemas/api_discovery_v1_DiscoveredOrganization' description: "An array of `discovered_organization` objects tied to the\ \ `intermediate_session_token`, `session_token`, or `session_jwt`. See\ \ the [Discovered Organization Object](https://stytch.com/docs/b2b/api/discovered-organization-object)\ \ for complete details.\n\n Note that Organizations will only appear\ \ here under any of the following conditions:\n 1. The end user is already\ \ a Member of the Organization.\n 2. The end user is invited to the Organization.\n\ \ 3. The end user can join the Organization because:\n\n a) The\ \ Organization allows JIT provisioning.\n\n b) The Organizations'\ \ allowed domains list contains the Member's email domain.\n\n c)\ \ The Organization has at least one other Member with a verified email\ \ address with the same domain as the end user (to prevent phishing attacks)." provider_type: type: string description: Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc. provider_tenant_id: type: string description: The tenant ID returned by the OAuth provider. This is typically used to identify an organization or group within the provider's domain. For example, in HubSpot this is a Hub ID, in Slack this is the Workspace ID, and in GitHub this is an organization ID. This field will only be populated if exactly one tenant ID is returned from a successful OAuth authentication and developers should prefer `provider_tenant_ids` over this since it accounts for the possibility of an OAuth provider yielding multiple tenant IDs. provider_tenant_ids: type: array items: type: string description: All tenant IDs returned by the OAuth provider. These is typically used to identify organizations or groups within the provider's domain. For example, in HubSpot this is a Hub ID, in Slack this is the Workspace ID, and in GitHub this is an organization ID. Some OAuth providers do not return tenant IDs, some providers are guaranteed to return one, and some may return multiple. This field will always be populated if at least one tenant ID was returned from the OAuth provider and developers should prefer this field over `provider_tenant_id`. full_name: type: string description: The full name of the authenticated end user, if available. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - intermediate_session_token - email_address - discovered_organizations - provider_type - provider_tenant_id - provider_tenant_ids - full_name - status_code api_b2b_otp_v1_b2b_otp_sms_AuthenticateRequest: type: object properties: organization_id: 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. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. code: type: string description: The code to authenticate. intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." set_mfa_enrollment: type: string description: "Optionally sets the Member\u2019s MFA enrollment status upon\ \ a successful authentication. If the Organization\u2019s MFA policy is\ \ `REQUIRED_FOR_ALL`, this field will be ignored. If this field is not\ \ passed in, the Member\u2019s `mfa_enrolled` boolean will not be affected.\ \ The options are:\n \n `enroll` \u2013 sets the Member's `mfa_enrolled`\ \ boolean to `true`. The Member will be required to complete an MFA step\ \ upon subsequent logins to the Organization.\n \n `unenroll` \u2013\ \ sets the Member's `mfa_enrolled` boolean to `false`. The Member will\ \ no longer be required to complete MFA steps when logging in to the Organization.\n\ \ " set_default_mfa: type: boolean telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - organization_id - member_id - code api_b2b_otp_v1_b2b_otp_sms_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - member - organization - session_token - session_jwt - status_code api_b2b_otp_v1_b2b_otp_sms_SendRequest: type: object properties: organization_id: 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. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. mfa_phone_number: type: string description: The phone number to send the OTP to. If the Member already has a phone number, this argument is not needed. locale: $ref: '#/components/schemas/api_b2b_otp_v1_SendRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. description: Request type required: - organization_id - member_id api_b2b_otp_v1_b2b_otp_sms_SendResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member - organization - status_code api_b2b_otp_v1_SendRequestLocale: type: string enum: - en - es - pt-br - fr api_b2b_otp_v1_b2b_otp_email_AuthenticateRequest: type: object properties: organization_id: 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. email_address: type: string description: The email address of the Member. code: type: string description: The code to authenticate. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." locale: $ref: '#/components/schemas/api_b2b_otp_v1_AuthenticateRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - organization_id - email_address - code api_b2b_otp_v1_b2b_otp_email_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. method_id: type: string description: The email or device involved in the authentication. organization_id: 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. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. member_authenticated: type: boolean description: Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step to log in to the Organization. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. primary_required: $ref: '#/components/schemas/api_b2b_session_v1_PrimaryRequired' member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - method_id - organization_id - member - session_token - session_jwt - organization - intermediate_session_token - member_authenticated - status_code api_b2b_otp_v1_b2b_otp_email_LoginOrSignupRequest: type: object properties: organization_id: 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. email_address: type: string description: The email address of the Member. login_template_id: type: string description: "Use a custom template for login emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201COTP -\ \ Login\u201D." signup_template_id: type: string description: "Use a custom template for signup emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201COTP -\ \ Signup\u201D." locale: $ref: '#/components/schemas/api_b2b_otp_v1_LoginOrSignupRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' login_expiration_minutes: type: integer format: int32 minimum: 0 description: The expiration time, in minutes, for a login OTP email to a Member. If not authenticated within this time frame, the OTP will need to be resent. Defaults to 10 with a minimum of 2 and a maximum of 15. signup_expiration_minutes: type: integer format: int32 minimum: 0 description: The expiration time, in minutes, for a signup OTP email to a Member. If not authenticated within this time frame, the OTP will need to be resent. Defaults to 10 with a minimum of 2 and a maximum of 15. description: Request type required: - organization_id - email_address api_b2b_otp_v1_b2b_otp_email_LoginOrSignupResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member_created: type: boolean description: A flag indicating `true` if a new Member object was created and `false` if the Member object already existed. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member_created - member - organization - status_code api_b2b_otp_v1_AuthenticateRequestLocale: type: string enum: - en - es - pt-br - fr api_b2b_otp_v1_LoginOrSignupRequestLocale: type: string enum: - en - es - pt-br - fr api_b2b_otp_v1_b2b_otp_email_discovery_AuthenticateRequest: type: object properties: email_address: type: string description: The email address of the Member. code: type: string description: The code to authenticate. description: Request type required: - email_address - code api_b2b_otp_v1_b2b_otp_email_discovery_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. email_address: type: string description: The email address. discovered_organizations: type: array items: $ref: '#/components/schemas/api_discovery_v1_DiscoveredOrganization' description: "An array of `discovered_organization` objects tied to the\ \ `intermediate_session_token`, `session_token`, or `session_jwt`. See\ \ the [Discovered Organization Object](https://stytch.com/docs/b2b/api/discovered-organization-object)\ \ for complete details.\n\n Note that Organizations will only appear\ \ here under any of the following conditions:\n 1. The end user is already\ \ a Member of the Organization.\n 2. The end user is invited to the Organization.\n\ \ 3. The end user can join the Organization because:\n\n a) The\ \ Organization allows JIT provisioning.\n\n b) The Organizations'\ \ allowed domains list contains the Member's email domain.\n\n c)\ \ The Organization has at least one other Member with a verified email\ \ address with the same domain as the end user (to prevent phishing attacks)." status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - intermediate_session_token - email_address - discovered_organizations - status_code api_b2b_otp_v1_b2b_otp_email_discovery_SendRequest: type: object properties: email_address: type: string description: The email address to start the discovery flow for. login_template_id: type: string description: "Use a custom template for login emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201COTP -\ \ Login\u201D." locale: $ref: '#/components/schemas/api_b2b_otp_v1_SendRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' discovery_expiration_minutes: type: integer format: int32 minimum: 0 description: The expiration time, in minutes, for a discovery OTP email. If not accepted within this time frame, the OTP will need to be resent. Defaults to 10 with a minimum of 2 and a maximum of 15. description: Request type required: - email_address api_b2b_otp_v1_b2b_otp_email_discovery_SendResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - status_code api_password_v1_Argon2Config: type: object properties: salt: type: string description: The salt value. iteration_amount: type: integer format: int32 description: The iteration amount. memory: type: integer format: int32 description: The memory in kibibytes. threads: type: integer format: int32 description: The thread value, also known as the parallelism factor. key_length: type: integer format: int32 description: The key length, also known as the hash length. required: - salt - iteration_amount - memory - threads - key_length api_password_v1_Feedback: type: object properties: warning: type: string description: For `zxcvbn` validation, contains an end user consumable warning if the password is valid but not strong enough. suggestions: type: array items: type: string description: For `zxcvbn` validation, contains end user consumable suggestions on how to improve the strength of the password. luds_requirements: $ref: '#/components/schemas/api_password_v1_LUDSRequirements' description: Contains which LUDS properties are fulfilled by the password and which are missing to convert an invalid password into a valid one. You'll use these fields to provide feedback to the user on how to improve the password. required: - warning - suggestions api_password_v1_LUDSRequirements: type: object properties: has_lower_case: type: boolean description: For LUDS validation, whether the password contains at least one lowercase letter. has_upper_case: type: boolean description: For LUDS validation, whether the password contains at least one uppercase letter. has_digit: type: boolean description: For LUDS validation, whether the password contains at least one digit. has_symbol: type: boolean description: For LUDS validation, whether the password contains at least one symbol. Any UTF8 character outside of a-z or A-Z may count as a valid symbol. missing_complexity: type: integer format: int32 description: For LUDS validation, the number of complexity requirements that are missing from the password. Check the complexity fields to see which requirements are missing. missing_characters: type: integer format: int32 description: For LUDS validation, this is the required length of the password that you've set minus the length of the password being checked. The user will need to add this many characters to the password to make it valid. required: - has_lower_case - has_upper_case - has_digit - has_symbol - missing_complexity - missing_characters api_password_v1_MD5Config: type: object properties: prepend_salt: type: string description: The salt that should be prepended to the migrated password. append_salt: type: string description: The salt that should be appended to the migrated password. required: - prepend_salt - append_salt api_password_v1_PBKDF2Config: type: object properties: salt: type: string description: The salt value, which should be in a base64 encoded string form. iteration_amount: type: integer format: int32 description: The iteration amount. key_length: type: integer format: int32 description: The key length, also known as the hash length. algorithm: type: string description: The algorithm that was used to generate the HMAC hash. Accepted values are "sha512" and sha256". Defaults to sha256. required: - salt - iteration_amount - key_length - algorithm api_password_v1_SHA1Config: type: object properties: prepend_salt: type: string description: The salt that should be prepended to the migrated password. append_salt: type: string description: The salt that should be appended to the migrated password. required: - prepend_salt - append_salt api_password_v1_SHA512Config: type: object properties: prepend_salt: type: string description: The salt that should be prepended to the migrated password. append_salt: type: string description: The salt that should be appended to the migrated password. required: - prepend_salt - append_salt api_password_v1_ScryptConfig: type: object properties: salt: type: string description: The salt value, which should be in a base64 encoded string form. n_parameter: type: integer format: int32 description: "The N value, also known as the iterations count. It must be\ \ a power of two greater than 1 and less than 262,145.\n If your\ \ application's N parameter is larger than 262,144, please reach out to\ \ [support@stytch.com](mailto:support@stytch.com)" r_parameter: type: integer format: int32 description: The r parameter, also known as the block size. p_parameter: type: integer format: int32 description: The p parameter, also known as the parallelism factor. key_length: type: integer format: int32 description: The key length, also known as the hash length. required: - salt - n_parameter - r_parameter - p_parameter - key_length api_password_v1_AuthenticateRequest: type: object properties: email: type: string description: The email address of the end user. password: type: string description: The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc. session_token: type: string description: The `session_token` associated with a User's existing Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - email - password api_password_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - session_token - session_jwt - user - status_code api_password_v1_CreateRequest: type: object properties: email: type: string description: The email address of the end user. password: type: string description: The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." trusted_metadata: type: object additionalProperties: true description: The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. untrusted_metadata: type: object additionalProperties: true description: The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. name: $ref: '#/components/schemas/api_user_v1_Name' description: The name of the user. Each field in the name object is optional. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - email - password api_password_v1_CreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. email_id: type: string description: The unique ID of a specific email address. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - email_id - session_token - session_jwt - user - status_code api_password_v1_MigrateRequest: type: object properties: email: type: string description: The email address of the end user. hash: type: string description: The password hash. For a Scrypt or PBKDF2 hash, the hash needs to be a base64 encoded string. hash_type: $ref: '#/components/schemas/api_password_v1_MigrateRequestHashType' description: The password hash used. Currently `bcrypt`, `scrypt`, `argon_2i`, `argon_2id`, `md_5`, `sha_1`, `sha_512`, and `pbkdf_2` are supported. md_5_config: $ref: '#/components/schemas/api_password_v1_MD5Config' description: Optional parameters for MD-5 hash types. argon_2_config: $ref: '#/components/schemas/api_password_v1_Argon2Config' description: Required parameters if the argon2 hex form, as opposed to the encoded form, is supplied. sha_1_config: $ref: '#/components/schemas/api_password_v1_SHA1Config' description: Optional parameters for SHA-1 hash types. sha_512_config: $ref: '#/components/schemas/api_password_v1_SHA512Config' description: Optional parameters for SHA-512 hash types. scrypt_config: $ref: '#/components/schemas/api_password_v1_ScryptConfig' description: Required parameters if the scrypt is not provided in a [PHC encoded form](https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md#phc-string-format). pbkdf_2_config: $ref: '#/components/schemas/api_password_v1_PBKDF2Config' description: Required additional parameters for PBKDF2 hash keys. trusted_metadata: type: object additionalProperties: true description: The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. untrusted_metadata: type: object additionalProperties: true description: The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details. set_email_verified: type: boolean description: "Whether to set the user's email as verified. This is a dangerous\ \ field, incorrect use may lead to users getting erroneously\n \ \ deduplicated into one User object. This flag should only be\ \ set if you can attest that the user owns the email address in question.\n\ \ " name: $ref: '#/components/schemas/api_user_v1_Name' description: The name of the user. Each field in the name object is optional. phone_number: type: string description: The phone number of the user. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX). set_phone_number_verified: type: boolean description: "Whether to set the user's phone number as verified. This is\ \ a dangerous field, this flag should only be set if you can attest that\n\ \ the user owns the phone number in question." external_id: type: string description: If a new user is created, this will set an identifier that can be used in API calls wherever a user_id is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters. roles: type: array items: type: string description: "Roles to explicitly assign to this User.\n See the [RBAC\ \ guide](https://stytch.com/docs/guides/rbac/role-assignment) for more\ \ information about role assignment." description: Request type required: - email - hash - hash_type api_password_v1_MigrateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. email_id: type: string description: The unique ID of a specific email address. user_created: type: boolean description: In `login_or_create` endpoints, this field indicates whether or not a User was just created. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - email_id - user_created - user - status_code api_password_v1_StrengthCheckRequest: type: object properties: password: type: string description: The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc. email: type: string description: The email address of the end user. description: Request type required: - password api_password_v1_StrengthCheckResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. valid_password: type: boolean description: Returns `true` if the password passes our password validation. We offer two validation options, [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy) is the default option which offers a high level of sophistication. We also offer [LUDS](https://stytch.com/docs/guides/passwords/strength-policy) which is less sophisticated but easier to understand. If an email address is included in the call we also require that the password hasn't been compromised using built-in breach detection powered by [HaveIBeenPwned](https://haveibeenpwned.com/). score: type: integer format: int32 description: The score of the password determined by [zxcvbn](https://github.com/dropbox/zxcvbn). Values will be between 1 and 4, a 3 or greater is required to pass validation. breached_password: type: boolean description: Returns `true` if the password has been breached. Powered by [HaveIBeenPwned](https://haveibeenpwned.com/). strength_policy: type: string description: The strength policy type enforced, either `zxcvbn` or `luds`. breach_detection_on_create: type: boolean description: Will return `true` if breach detection will be evaluated. By default this option is enabled. This option can be disabled in the [dashboard](https://stytch.com/dashboard/password-strength-config#breach-detection). If this value is `false` then `breached_password` will always be `false` as well. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. feedback: $ref: '#/components/schemas/api_password_v1_Feedback' description: Feedback for how to improve the password's strength [HaveIBeenPwned](https://haveibeenpwned.com/). required: - request_id - valid_password - score - breached_password - strength_policy - breach_detection_on_create - status_code api_password_v1_MigrateRequestHashType: type: string enum: - bcrypt - md_5 - argon_2i - argon_2id - sha_1 - sha_512 - scrypt - phpass - pbkdf_2 api_password_v1_passwords_email_ResetRequest: type: object properties: token: type: string description: "The Passwords `token` from the `?token=` query parameter in\ \ the URL.\n\n In the redirect URL, the `stytch_token_type` will\ \ be `login` or `reset_password`.\n\n See examples and read more\ \ about redirect URLs [here](https://stytch.com/docs/workspace-management/redirect-urls)." password: type: string description: The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc. session_token: type: string description: The `session_token` associated with a User's existing Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. code_verifier: type: string description: A base64url encoded one time secret used to validate that the request starts and ends on the same device. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. options: $ref: '#/components/schemas/api_magic_v1_Options' description: Specify optional security settings. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - token - password api_password_v1_passwords_email_ResetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - session_token - session_jwt - user - status_code api_password_v1_passwords_email_ResetStartRequest: type: object properties: email: type: string description: The email of the User that requested the password reset. reset_password_redirect_url: type: string description: "The URL that the User is redirected to from the reset password\ \ magic link. This URL should display your application's reset password\ \ page.\n Before rendering the reset page, extract the `token` from the\ \ query parameters. On the reset page, collect the new password and complete\ \ the flow by calling the corresponding Password Reset by Email endpoint.\n\ \ If this parameter is not specified, the default Reset Password redirect\ \ URL configured in the Dashboard will be used. If you have not set a\ \ default Reset Password redirect URL, an error is returned." reset_password_expiration_minutes: type: integer format: int32 description: "Set the expiration for the password reset, in minutes. By\ \ default, it expires in 30 minutes.\n The minimum expiration is 5 minutes\ \ and the maximum is 7 days (10080 mins)." code_challenge: type: string description: A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device. attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. login_redirect_url: type: string description: "The URL that Users are redirected to upon clicking the \"\ Log in without password\" button in password reset emails.\n\n After\ \ Users are redirected to the login redirect URL, your application should\ \ retrieve the `token` value from the URL parameters and call the [Magic\ \ Link Authenticate endpoint](https://stytch.com/docs/api/authenticate-magic-link)\ \ to log the User in without requiring a password reset. If this value\ \ is not provided, your project's default login redirect URL will be used.\ \ If you have not set a default login redirect URL, an error will be returned." locale: $ref: '#/components/schemas/api_password_v1_ResetStartRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' reset_password_template_id: type: string description: "Use a custom template for password reset emails. By default,\ \ it will use your default email template.\n Templates can be added in\ \ the [Stytch dashboard](https://stytch.com/dashboard/templates) using\ \ our built-in customization options or custom HTML templates with type\ \ \u201CPasswords - Password reset\u201D." description: Request type required: - email api_password_v1_passwords_email_ResetStartResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. email_id: type: string description: The unique ID of a specific email address. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - email_id - status_code api_password_v1_ResetStartRequestLocale: type: string enum: - en - es - pt-br - fr api_password_v1_passwords_existing_password_ResetRequest: type: object properties: email: type: string description: The email address of the end user. existing_password: type: string description: The user's existing password. new_password: type: string description: The new password for the user. session_token: type: string description: The `session_token` associated with a User's existing Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - email - existing_password - new_password api_password_v1_passwords_existing_password_ResetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - session_token - session_jwt - user - status_code api_password_v1_passwords_session_ResetRequest: type: object properties: password: type: string description: The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc. session_token: type: string description: The `session_token` associated with a User's existing Session. session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - password api_password_v1_passwords_session_ResetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - user - session_token - session_jwt - status_code api_b2b_password_v1_LudsFeedback: type: object properties: has_lower_case: type: boolean description: For LUDS validation, whether the password contains at least one lowercase letter. has_upper_case: type: boolean description: For LUDS validation, whether the password contains at least one uppercase letter. has_digit: type: boolean description: For LUDS validation, whether the password contains at least one digit. has_symbol: type: boolean description: For LUDS validation, whether the password contains at least one symbol. Any UTF8 character outside of a-z or A-Z may count as a valid symbol. missing_complexity: type: integer format: int32 description: "For LUDS validation, the number of complexity requirements\ \ that are missing from the password.\n Check the complexity fields\ \ to see which requirements are missing." missing_characters: type: integer format: int32 description: "For LUDS validation, this is the required length of the password\ \ that you've set minus the length of the password being checked.\n \ \ The user will need to add this many characters to the password to\ \ make it valid." required: - has_lower_case - has_upper_case - has_digit - has_symbol - missing_complexity - missing_characters api_b2b_password_v1_ZxcvbnFeedback: type: object properties: warning: type: string description: For zxcvbn validation, contains an end user consumable warning if the password is valid but not strong enough. suggestions: type: array items: type: string description: For zxcvbn validation, contains end user consumable suggestions on how to improve the strength of the password. required: - warning - suggestions api_b2b_password_v1_AuthenticateRequest: type: object properties: organization_id: 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. email_address: type: string description: The email address of the Member. password: type: string description: The password to authenticate, reset, or set for the first time. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc. session_token: type: string description: A secret token for a given Stytch Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." locale: $ref: '#/components/schemas/api_b2b_password_v1_AuthenticateRequestLocale' description: 'If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will pre-emptively send a one-time passcode (OTP) to the Member''s phone number. The locale argument will be used to determine which language to use when sending the passcode. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' intermediate_session_token: type: string description: Adds this primary authentication factor to the intermediate session token. If the resulting set of factors satisfies the organization's primary authentication requirements and MFA requirements, the intermediate session token will be consumed and converted to a member session. If not, the same intermediate session token will be returned. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - organization_id - email_address - password api_b2b_password_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. organization_id: 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. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). intermediate_session_token: type: string description: The returned Intermediate Session Token contains a password factor associated with the Member. If this value is non-empty, the member must complete an MFA step to finish logging in to the Organization. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. Password factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints. member_authenticated: type: boolean description: Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step to log in to the Organization. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. primary_required: $ref: '#/components/schemas/api_b2b_session_v1_PrimaryRequired' description: Information about the primary authentication requirements of the Organization. member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - organization_id - member - session_token - session_jwt - organization - intermediate_session_token - member_authenticated - status_code api_b2b_password_v1_MigrateRequest: type: object properties: email_address: type: string description: The email address of the Member. hash: type: string description: The password hash. For a Scrypt or PBKDF2 hash, the hash needs to be a base64 encoded string. hash_type: $ref: '#/components/schemas/api_b2b_password_v1_MigrateRequestHashType' description: The password hash used. Currently `bcrypt`, `scrypt`, `argon_2i`, `argon_2id`, `md_5`, `sha_1`, `sha_512`, and `pbkdf_2` are supported. organization_id: 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. md_5_config: $ref: '#/components/schemas/api_password_v1_MD5Config' description: Optional parameters for MD-5 hash types. argon_2_config: $ref: '#/components/schemas/api_password_v1_Argon2Config' description: Required parameters if the argon2 hex form, as opposed to the encoded form, is supplied. sha_1_config: $ref: '#/components/schemas/api_password_v1_SHA1Config' description: Optional parameters for SHA-1 hash types. sha_512_config: $ref: '#/components/schemas/api_password_v1_SHA512Config' description: Optional parameters for SHA-512 hash types. scrypt_config: $ref: '#/components/schemas/api_password_v1_ScryptConfig' description: Required parameters if the scrypt is not provided in a **PHC encoded form**. pbkdf_2_config: $ref: '#/components/schemas/api_password_v1_PBKDF2Config' description: Required additional parameters for PBKDF2 hash keys. Note that we use the SHA-256 by default, please contact [support@stytch.com](mailto:support@stytch.com) if you use another hashing function. name: type: string description: The name of the Member. Each field in the name object is optional. trusted_metadata: type: object additionalProperties: true description: An arbitrary JSON object for storing application-specific data or identity-provider-specific data. untrusted_metadata: type: object additionalProperties: true description: "An arbitrary JSON object of application-specific data. These\ \ fields can be edited directly by the\n frontend SDK, and should not\ \ be used to store critical information. See the [Metadata resource](https://stytch.com/docs/b2b/api/metadata)\n\ \ for complete field behavior details." roles: type: array items: type: string description: "Roles to explicitly assign to this Member.\n Will completely\ \ replace any existing explicitly assigned roles. See the\n [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\ \ for more information about role assignment.\n\n If a Role is removed\ \ from a Member, and the Member is also implicitly assigned this Role\ \ from an SSO connection\n or an SSO group, we will by default revoke\ \ any existing sessions for the Member that contain any SSO\n authentication\ \ factors with the affected connection ID. You can preserve these sessions\ \ by passing in the\n `preserve_existing_sessions` parameter with a\ \ value of `true`." preserve_existing_sessions: type: boolean description: "Whether to preserve existing sessions when explicit Roles\ \ that are revoked are also implicitly assigned\n by SSO connection or\ \ SSO group. Defaults to `false` - that is, existing Member Sessions that\ \ contain SSO\n authentication factors with the affected SSO connection\ \ IDs will be revoked." mfa_phone_number: type: string description: The Member's phone number. A Member may only have one phone number. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX). set_phone_number_verified: type: boolean description: "Whether to set the user's phone number as verified. This is\ \ a dangerous field. This flag should only be set if you can attest that\n\ \ the user owns the phone number in question." external_id: type: string description: If a new member is created, this will set an identifier that can be used in most API calls where a `member_id` is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters. External IDs must be unique within an organization, but may be reused across different organizations in the same project. Note that if a member already exists, this field will be ignored. description: Request type required: - email_address - hash - hash_type - organization_id api_b2b_password_v1_MigrateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member_created: type: boolean description: A flag indicating `true` if a new Member object was created and `false` if the Member object already existed. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member_created - member - organization - status_code api_b2b_password_v1_StrengthCheckRequest: type: object properties: password: type: string description: The password to authenticate, reset, or set for the first time. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc. email_address: type: string description: The email address of the Member. description: Request type required: - password api_b2b_password_v1_StrengthCheckResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. valid_password: type: boolean description: "Returns `true` if the password passes our password validation.\ \ We offer two validation options,\n [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy)\ \ is the default option which offers a high level of sophistication.\n\ \ We also offer [LUDS](https://stytch.com/docs/b2b/guides/passwords/strength-policy)\ \ which is less sophisticated \n but easier to understand. If an email\ \ address is included in the call we also\n require that the password\ \ hasn't been compromised using built-in breach detection powered by [HaveIBeenPwned](https://haveibeenpwned.com/)" score: type: integer format: int32 description: The score of the password determined by [zxcvbn](https://github.com/dropbox/zxcvbn). Values will be between 1 and 4, a 3 or greater is required to pass validation. breached_password: type: boolean description: Returns `true` if the password has been breached. Powered by [HaveIBeenPwned](https://haveibeenpwned.com/). strength_policy: type: string description: The strength policy type enforced, either `zxcvbn` or `luds`. breach_detection_on_create: type: boolean description: "Will return `true` if breach detection will be evaluated.\ \ By default this option is enabled.\n This option can be disabled in\ \ the [dashboard](https://stytch.com/dashboard/password-strength-config#breach-detection).\n\ \ If this value is false then `breached_password` will always be `false`\ \ as well." status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. luds_feedback: $ref: '#/components/schemas/api_b2b_password_v1_LudsFeedback' description: Feedback for how to improve the password's strength using [luds](https://stytch.com/docs/guides/passwords/strength-policy). zxcvbn_feedback: $ref: '#/components/schemas/api_b2b_password_v1_ZxcvbnFeedback' description: Feedback for how to improve the password's strength using [zxcvbn](https://stytch.com/docs/b2b/guides/passwords/strength-policy). required: - request_id - valid_password - score - breached_password - strength_policy - breach_detection_on_create - status_code api_b2b_password_v1_AuthenticateRequestLocale: type: string enum: - en - es - pt-br - fr api_b2b_password_v1_MigrateRequestHashType: type: string enum: - bcrypt - md_5 - argon_2i - argon_2id - sha_1 - sha_512 - scrypt - phpass - pbkdf_2 api_b2b_password_v1_b2b_passwords_email_RequireResetRequest: type: object properties: email_address: type: string description: The email address of the Member to start the email reset process for. organization_id: 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. member_id: type: string description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member. description: Request type required: - email_address api_b2b_password_v1_b2b_passwords_email_RequireResetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). required: - request_id - status_code api_b2b_password_v1_b2b_passwords_email_ResetRequest: type: object properties: password_reset_token: type: string description: The password reset token to authenticate. password: type: string description: The password to authenticate, reset, or set for the first time. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc. session_token: type: string description: "Reuse an existing session instead of creating a new one. If\ \ you provide a `session_token`, Stytch will update the session.\n \ \ If the `session_token` and `magic_links_token` belong to different\ \ Members, the `session_token` will be ignored. This endpoint will error\ \ if\n both `session_token` and `session_jwt` are provided." session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_jwt: type: string description: "Reuse an existing session instead of creating a new one. If\ \ you provide a `session_jwt`, Stytch will update the session. If the\ \ `session_jwt`\n and `magic_links_token` belong to different Members,\ \ the `session_jwt` will be ignored. This endpoint will error if both\ \ `session_token` and `session_jwt`\n are provided." code_verifier: type: string description: A base64url encoded one time secret used to validate that the request starts and ends on the same device. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." locale: $ref: '#/components/schemas/api_b2b_password_v1_ResetRequestLocale' description: 'If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will pre-emptively send a one-time passcode (OTP) to the Member''s phone number. The locale argument will be used to determine which language to use when sending the passcode. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' intermediate_session_token: type: string description: Adds this primary authentication factor to the intermediate session token. If the resulting set of factors satisfies the organization's primary authentication requirements and MFA requirements, the intermediate session token will be consumed and converted to a member session. If not, the same intermediate session token will be returned. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - password_reset_token - password api_b2b_password_v1_b2b_passwords_email_ResetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member_email_id: type: string description: Globally unique UUID that identifies a member's email organization_id: 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. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). intermediate_session_token: type: string description: The returned Intermediate Session Token contains a password factor associated with the Member. If this value is non-empty, the member must complete an MFA step to finish logging in to the Organization. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. Password factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints. member_authenticated: type: boolean description: Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step to log in to the Organization. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. primary_required: $ref: '#/components/schemas/api_b2b_session_v1_PrimaryRequired' description: Information about the primary authentication requirements of the Organization. member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - member_email_id - organization_id - member - session_token - session_jwt - organization - intermediate_session_token - member_authenticated - status_code api_b2b_password_v1_b2b_passwords_email_ResetStartRequest: type: object properties: organization_id: 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. email_address: type: string description: The email address of the Member to start the email reset process for. reset_password_redirect_url: type: string description: "The URL that the Member is redirected to from the reset password\ \ magic link. This URL should display your application's reset password\ \ page.\n Before rendering the reset page, extract the `token` from the\ \ query parameters. On the reset page, collect the new password and complete\ \ the flow by calling the corresponding Password Reset by Email endpoint.\n\ \ If this parameter is not specified, the default Reset Password redirect\ \ URL configured in the Dashboard will be used. If you have not set a\ \ default Reset Password redirect URL, an error is returned." reset_password_expiration_minutes: type: integer format: int32 description: Sets a time limit after which the email link to reset the member's password will no longer be valid. The minimum allowed expiration is 5 minutes and the maximum is 10080 minutes (7 days). By default, the expiration is 30 minutes. code_challenge: type: string description: A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device. login_redirect_url: type: string description: "The URL that Members are redirected to upon clicking the \"\ Log in without password\" button in password reset emails.\n\n After\ \ Members are redirected to the login redirect URL, your application should\ \ retrieve the `token` value from the URL parameters and call the [Magic\ \ Link Authenticate endpoint](https://stytch.com/docs/api/authenticate-magic-link)\ \ to log the Member in without requiring a password reset. If this value\ \ is not provided, your project's default login redirect URL will be used.\ \ If you have not set a default login redirect URL, an error will be returned." locale: $ref: '#/components/schemas/api_b2b_password_v1_ResetStartRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' reset_password_template_id: type: string description: "Use a custom template for reset password emails. By default,\ \ it will use your default email template. Templates can be added in the\ \ [Stytch dashboard](https://stytch.com/dashboard/templates) using our\ \ built-in customization options or custom HTML templates with type \u201C\ Passwords - Reset Password\u201D." verify_email_template_id: type: string description: "Use a custom template for verification emails sent during\ \ password reset flows. When cross-organization passwords are enabled\ \ for your Project, this template will be used the first time a user sets\ \ a password via a\n password reset flow. By default, it will use your\ \ default email template. Templates can be added in the [Stytch dashboard](https://stytch.com/dashboard/templates)\ \ using our built-in customization options or custom HTML templates with\ \ type \u201CPasswords - Email Verification\u201D." description: Request type required: - organization_id - email_address api_b2b_password_v1_b2b_passwords_email_ResetStartResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member_email_id: type: string description: Globally unique UUID that identifies a member's email member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - member_id - member_email_id - member - status_code api_b2b_password_v1_ResetRequestLocale: type: string enum: - en - es - pt-br - fr api_b2b_password_v1_ResetStartRequestLocale: type: string enum: - en - es - pt-br - fr api_b2b_password_v1_b2b_passwords_session_ResetRequest: type: object properties: organization_id: 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. password: type: string description: The password to authenticate, reset, or set for the first time. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." locale: $ref: '#/components/schemas/api_b2b_password_v1_ResetRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - organization_id - password api_b2b_password_v1_b2b_passwords_session_ResetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. intermediate_session_token: type: string description: The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member. Intermediate Session Tokens have a default expiry of 10 minutes. member_authenticated: type: boolean description: Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step to log in to the Organization. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - member - organization - session_token - session_jwt - intermediate_session_token - member_authenticated - status_code api_b2b_password_v1_b2b_passwords_existing_password_ResetRequest: type: object properties: email_address: type: string description: The email address of the Member. existing_password: type: string description: The Member's current password that they supplied. new_password: type: string description: The Member's elected new password. organization_id: 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. session_token: type: string description: A secret token for a given Stytch Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." locale: $ref: '#/components/schemas/api_b2b_password_v1_ResetRequestLocale' description: 'If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will pre-emptively send a one-time passcode (OTP) to the Member''s phone number. The locale argument will be used to determine which language to use when sending the passcode. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - email_address - existing_password - new_password - organization_id api_b2b_password_v1_b2b_passwords_existing_password_ResetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). intermediate_session_token: type: string description: The returned Intermediate Session Token contains a password factor associated with the Member. If this value is non-empty, the member must complete an MFA step to finish logging in to the Organization. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. Password factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints. member_authenticated: type: boolean description: Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step to log in to the Organization. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. primary_required: $ref: '#/components/schemas/api_b2b_session_v1_PrimaryRequired' description: Information about the primary authentication requirements of the Organization. member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - member - session_token - session_jwt - organization - intermediate_session_token - member_authenticated - status_code api_b2b_password_v1_b2b_passwords_discovery_AuthenticateRequest: type: object properties: email_address: type: string description: The email address of the Member. password: type: string description: The password to authenticate, reset, or set for the first time. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc. description: Request type required: - email_address - password api_b2b_password_v1_b2b_passwords_discovery_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. email_address: type: string description: The email address. intermediate_session_token: type: string description: The returned Intermediate Session Token contains a password factor associated with the Member. If this value is non-empty, the member must complete an MFA step to finish logging in to the Organization. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. Password factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints. discovered_organizations: type: array items: $ref: '#/components/schemas/api_discovery_v1_DiscoveredOrganization' description: "An array of `discovered_organization` objects tied to the\ \ `intermediate_session_token`, `session_token`, or `session_jwt`. See\ \ the [Discovered Organization Object](https://stytch.com/docs/b2b/api/discovered-organization-object)\ \ for complete details.\n\n Note that Organizations will only appear\ \ here under any of the following conditions:\n 1. The end user is already\ \ a Member of the Organization.\n 2. The end user is invited to the Organization.\n\ \ 3. The end user can join the Organization because:\n\n a) The\ \ Organization allows JIT provisioning.\n\n b) The Organizations'\ \ allowed domains list contains the Member's email domain.\n\n c)\ \ The Organization has at least one other Member with a verified email\ \ address with the same domain as the end user (to prevent phishing attacks)." status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - email_address - intermediate_session_token - discovered_organizations - status_code api_b2b_password_v1_b2b_passwords_discovery_email_ResetRequest: type: object properties: password_reset_token: type: string description: The password reset token to authenticate. password: type: string description: The password to authenticate, reset, or set for the first time. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc. pkce_code_verifier: type: string description: Request type required: - password_reset_token - password api_b2b_password_v1_b2b_passwords_discovery_email_ResetResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. intermediate_session_token: type: string description: The returned Intermediate Session Token contains a password factor associated with the Member. If this value is non-empty, the member must complete an MFA step to finish logging in to the Organization. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. Password factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints. email_address: type: string description: The email address. discovered_organizations: type: array items: $ref: '#/components/schemas/api_discovery_v1_DiscoveredOrganization' description: "An array of `discovered_organization` objects tied to the\ \ `intermediate_session_token`, `session_token`, or `session_jwt`. See\ \ the [Discovered Organization Object](https://stytch.com/docs/b2b/api/discovered-organization-object)\ \ for complete details.\n\n Note that Organizations will only appear\ \ here under any of the following conditions:\n 1. The end user is already\ \ a Member of the Organization.\n 2. The end user is invited to the Organization.\n\ \ 3. The end user can join the Organization because:\n\n a) The\ \ Organization allows JIT provisioning.\n\n b) The Organizations'\ \ allowed domains list contains the Member's email domain.\n\n c)\ \ The Organization has at least one other Member with a verified email\ \ address with the same domain as the end user (to prevent phishing attacks)." status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - intermediate_session_token - email_address - discovered_organizations - status_code api_b2b_password_v1_b2b_passwords_discovery_email_ResetStartRequest: type: object properties: email_address: type: string description: The email address of the Member to start the email reset process for. reset_password_redirect_url: type: string description: "The URL that the Member is redirected to from the reset password\ \ magic link. This URL should display your application's reset password\ \ page.\n Before rendering the reset page, extract the `token` from the\ \ query parameters. On the reset page, collect the new password and complete\ \ the flow by calling the corresponding Password Reset by Email endpoint.\n\ \ If this parameter is not specified, the default Reset Password redirect\ \ URL configured in the Dashboard will be used. If you have not set a\ \ default Reset Password redirect URL, an error is returned." discovery_redirect_url: type: string description: "The URL that the end user clicks from the discovery Magic\ \ Link. This URL should be an endpoint in the backend server that\n verifies\ \ the request by querying Stytch's discovery authenticate endpoint and\ \ continues the flow. If this value is not passed, the default\n discovery\ \ redirect URL that you set in your Dashboard is used. If you have not\ \ set a default discovery redirect URL, an error is returned." reset_password_template_id: type: string description: "Use a custom template for reset password emails. By default,\ \ it will use your default email template. Templates can be added in the\ \ [Stytch dashboard](https://stytch.com/dashboard/templates) using our\ \ built-in customization options or custom HTML templates with type \u201C\ Passwords - Reset Password\u201D." reset_password_expiration_minutes: type: integer format: int32 description: Sets a time limit after which the email link to reset the member's password will no longer be valid. The minimum allowed expiration is 5 minutes and the maximum is 10080 minutes (7 days). By default, the expiration is 30 minutes. pkce_code_challenge: type: string locale: type: string description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' verify_email_template_id: type: string description: "Use a custom template for verification emails sent during\ \ password reset flows. When cross-organization passwords are enabled\ \ for your Project, this template will be used the first time a user sets\ \ a password via a\n password reset flow. By default, it will use your\ \ default email template. Templates can be added in the [Stytch dashboard](https://stytch.com/dashboard/templates)\ \ using our built-in customization options or custom HTML templates with\ \ type \u201CPasswords - Email Verification\u201D." description: Request type required: - email_address api_b2b_password_v1_b2b_passwords_discovery_email_ResetStartResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - status_code api_oauth_v1_ProviderValues: type: object properties: access_token: type: string description: The `access_token` that you may use to access the User's data in the provider's API. refresh_token: type: string description: The `refresh_token` that you may use to obtain a new `access_token` for the User within the provider's API. id_token: type: string description: The `id_token` returned by the OAuth provider. ID Tokens are JWTs that contain structured information about a user. The exact content of each ID Token varies from provider to provider. ID Tokens are returned from OAuth providers that conform to the [OpenID Connect](https://openid.net/foundation/) specification, which is based on OAuth. scopes: type: array items: type: string description: The OAuth scopes included for a given provider. See each provider's section above to see which scopes are included by default and how to add custom scopes. expires_at: type: string description: The timestamp when the Session expires. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`. required: - access_token - refresh_token - id_token - scopes api_oauth_v1_AttachRequest: type: object properties: provider: type: string description: The OAuth provider's name. user_id: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. session_token: type: string description: The `session_token` associated with a User's existing Session. session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. description: Request type required: - provider api_oauth_v1_AttachResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. oauth_attach_token: type: string description: A single-use token for connecting the Stytch User selection from an OAuth Attach request to the corresponding OAuth Start request. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - oauth_attach_token - status_code api_oauth_v1_AuthenticateRequest: type: object properties: token: type: string description: "The OAuth `token` from the `?token=` query parameter in the\ \ URL.\n\n The redirect URL will look like `https://example.com/authenticate?stytch_token_type=oauth&token=rM_kw42CWBhsHLF62V75jELMbvJ87njMe3tFVj7Qupu7`\n\ \n In the redirect URL, the `stytch_token_type` will be `oauth`.\ \ See [here](https://stytch.com/docs/workspace-management/redirect-urls)\ \ for more detail." session_token: type: string description: Reuse an existing session instead of creating a new one. If you provide us with a `session_token`, then we'll update the session represented by this session token with this OAuth factor. If this `session_token` belongs to a different user than the OAuth token, the session_jwt will be ignored. This endpoint will error if both `session_token` and `session_jwt` are provided. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_jwt: type: string description: Reuse an existing session instead of creating a new one. If you provide us with a `session_jwt`, then we'll update the session represented by this JWT with this OAuth factor. If this `session_jwt` belongs to a different user than the OAuth token, the session_jwt will be ignored. This endpoint will error if both `session_token` and `session_jwt` are provided. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." code_verifier: type: string description: A base64url encoded one time secret used to validate that the request starts and ends on the same device. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - token api_oauth_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. provider_subject: type: string description: The unique identifier for the User within a given OAuth provider. Also commonly called the "sub" or "Subject field" in OAuth protocols. provider_type: type: string description: Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Facebook, GitHub etc. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. provider_values: $ref: '#/components/schemas/api_oauth_v1_ProviderValues' description: "The `provider_values` object lists relevant identifiers, values,\ \ and scopes for a given OAuth provider. For example this object will\ \ include a provider's `access_token` that you can use to access the provider's\ \ API for a given user.\n\n Note that these values will vary based on\ \ the OAuth provider in question, e.g. `id_token` is only returned by\ \ OIDC compliant identity providers." user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. reset_sessions: type: boolean description: Indicates if all other of the User's Sessions need to be reset. You should check this field if you aren't using Stytch's Session product. If you are using Stytch's Session product, we revoke the User's other sessions for you. oauth_user_registration_id: type: string description: The unique ID for an OAuth registration. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. user_session: $ref: '#/components/schemas/api_session_v1_Session' description: "A `Session` object. For backwards compatibility reasons, the\ \ session from an OAuth authenticate call is labeled as `user_session`,\ \ but is otherwise just a standard stytch `Session` object.\n\n See [Session\ \ object](https://stytch.com/docs/api/session-object) for complete response\ \ fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - provider_subject - provider_type - session_token - session_jwt - provider_values - user - reset_sessions - oauth_user_registration_id - status_code api_otp_v1_AuthenticateRequest: type: object properties: method_id: type: string description: The `email_id` or `phone_id` involved in the given authentication. code: type: string description: The code to authenticate. attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. options: $ref: '#/components/schemas/api_magic_v1_Options' description: Specify optional security settings. session_token: type: string description: The `session_token` associated with a User's existing Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - method_id - code api_otp_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. method_id: type: string description: The `email_id` or `phone_id` involved in the given authentication. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. reset_sessions: type: boolean description: Indicates if all other of the User's Sessions need to be reset. You should check this field if you aren't using Stytch's Session product. If you are using Stytch's Session product, we revoke the User's other sessions for you. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - method_id - session_token - session_jwt - user - reset_sessions - status_code api_otp_v1_otp_sms_LoginOrCreateRequest: type: object properties: phone_number: type: string description: The phone number to use for one-time passcodes. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX). You may use +10000000000 to test this endpoint, see [Testing](https://stytch.com/docs/home#resources_testing) for more detail. expiration_minutes: type: integer format: int32 description: Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1 minute and the maximum is 10 minutes. The default expiration is 2 minutes. attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. create_user_as_pending: type: boolean description: "Flag for whether or not to save a user as pending vs active\ \ in Stytch. Defaults to false.\n If true, users will be saved\ \ with status pending in Stytch's backend until authenticated.\n \ \ If false, users will be created as active. An example usage of\n \ \ a true flag would be to require users to verify their phone by\ \ entering the OTP code before creating\n an account for them." locale: $ref: '#/components/schemas/api_otp_v1_LoginOrCreateRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' description: Request type required: - phone_number api_otp_v1_otp_sms_LoginOrCreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. phone_id: type: string description: The unique ID for the phone number. user_created: type: boolean description: In `login_or_create` endpoints, this field indicates whether or not a User was just created. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - phone_id - user_created - status_code api_otp_v1_otp_sms_SendRequest: type: object properties: phone_number: type: string description: The phone number to use for one-time passcodes. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX). You may use +10000000000 to test this endpoint, see [Testing](https://stytch.com/docs/home#resources_testing) for more detail. expiration_minutes: type: integer format: int32 description: Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1 minute and the maximum is 10 minutes. The default expiration is 2 minutes. attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. locale: $ref: '#/components/schemas/api_otp_v1_SendRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' user_id: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. session_token: type: string description: The `session_token` associated with a User's existing Session. session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. description: Request type required: - phone_number api_otp_v1_otp_sms_SendResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. phone_id: type: string description: The unique ID for the phone number. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - phone_id - status_code api_otp_v1_LoginOrCreateRequestLocale: type: string enum: - en - es - pt-br - fr api_otp_v1_SendRequestLocale: type: string enum: - en - es - pt-br - fr api_otp_v1_otp_whatsapp_LoginOrCreateRequest: type: object properties: phone_number: type: string description: The phone number to use for one-time passcodes. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX). You may use +10000000000 to test this endpoint, see [Testing](https://stytch.com/docs/home#resources_testing) for more detail. expiration_minutes: type: integer format: int32 description: Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1 minute and the maximum is 10 minutes. The default expiration is 2 minutes. attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. create_user_as_pending: type: boolean description: "Flag for whether or not to save a user as pending vs active\ \ in Stytch. Defaults to false.\n If true, users will be saved\ \ with status pending in Stytch's backend until authenticated.\n \ \ If false, users will be created as active. An example usage of\n \ \ a true flag would be to require users to verify their phone by\ \ entering the OTP code before creating\n an account for them." locale: $ref: '#/components/schemas/api_otp_v1_LoginOrCreateRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' description: Request type required: - phone_number api_otp_v1_otp_whatsapp_LoginOrCreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. phone_id: type: string description: The unique ID for the phone number. user_created: type: boolean description: In `login_or_create` endpoints, this field indicates whether or not a User was just created. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - phone_id - user_created - status_code api_otp_v1_otp_whatsapp_SendRequest: type: object properties: phone_number: type: string description: The phone number to use for one-time passcodes. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX). You may use +10000000000 to test this endpoint, see [Testing](https://stytch.com/docs/home#resources_testing) for more detail. expiration_minutes: type: integer format: int32 description: Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1 minute and the maximum is 10 minutes. The default expiration is 2 minutes. attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. locale: $ref: '#/components/schemas/api_otp_v1_SendRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' user_id: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. session_token: type: string description: The `session_token` associated with a User's existing Session. session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. description: Request type required: - phone_number api_otp_v1_otp_whatsapp_SendResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. phone_id: type: string description: The unique ID for the phone number. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - phone_id - status_code api_otp_v1_otp_email_LoginOrCreateRequest: type: object properties: email: type: string description: The email address of the user to send the one-time passcode to. You may use sandbox@stytch.com to test this endpoint, see [Testing](https://stytch.com/docs/home#resources_testing) for more detail. expiration_minutes: type: integer format: int32 description: Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1 minute and the maximum is 10 minutes. The default expiration is 2 minutes. attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. create_user_as_pending: type: boolean description: "Flag for whether or not to save a user as pending vs active\ \ in Stytch. Defaults to false.\n If true, users will be saved\ \ with status pending in Stytch's backend until authenticated.\n \ \ If false, users will be created as active. An example usage of\n \ \ a true flag would be to require users to verify their phone by\ \ entering the OTP code before creating\n an account for them." locale: $ref: '#/components/schemas/api_otp_v1_LoginOrCreateRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' login_template_id: type: string description: "Use a custom template for login emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201CMagic\ \ links - Login\u201D." signup_template_id: type: string description: "Use a custom template for sign-up emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201CMagic\ \ links - Sign-up\u201D." description: Request type required: - email api_otp_v1_otp_email_LoginOrCreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. email_id: type: string description: The unique ID of a specific email address. user_created: type: boolean description: In `login_or_create` endpoints, this field indicates whether or not a User was just created. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - email_id - user_created - status_code api_otp_v1_otp_email_SendRequest: type: object properties: email: type: string description: The email address of the user to send the one-time passcode to. You may use sandbox@stytch.com to test this endpoint, see [Testing](https://stytch.com/docs/home#resources_testing) for more detail. expiration_minutes: type: integer format: int32 description: Set the expiration for the one-time passcode, in minutes. The minimum expiration is 1 minute and the maximum is 10 minutes. The default expiration is 2 minutes. attributes: $ref: '#/components/schemas/api_attribute_v1_Attributes' description: Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application. locale: $ref: '#/components/schemas/api_otp_v1_SendRequestLocale' description: 'Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), French (`"fr"`) and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' user_id: type: string description: The unique ID of a specific User. You may use an `external_id` here if one is set for the user. session_token: type: string description: The `session_token` associated with a User's existing Session. session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. login_template_id: type: string description: "Use a custom template for login emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201COTP -\ \ Login\u201D." signup_template_id: type: string description: "Use a custom template for sign-up emails. By default, it will\ \ use your default email template. Templates can be added in the [Stytch\ \ dashboard](https://stytch.com/dashboard/templates) using our built-in\ \ customization options or custom HTML templates with type \u201COTP -\ \ Sign-up\u201D." description: Request type required: - email api_otp_v1_otp_email_SendResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. email_id: type: string description: The unique ID of a specific email address. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - email_id - status_code api_project_v1_ProjectMetric: type: object properties: metric_type: $ref: '#/components/schemas/api_project_v1_ProjectMetricMetricType' count: type: integer format: int32 minimum: 0 required: - metric_type - count api_project_v1_MetricsRequest: type: object properties: {} api_project_v1_MetricsResponse: type: object properties: request_id: type: string project_id: type: string metrics: type: array items: $ref: '#/components/schemas/api_project_v1_ProjectMetric' status_code: type: integer format: int32 required: - request_id - project_id - metrics - status_code api_project_v1_ProjectMetricMetricType: type: string enum: - UNKNOWN - USER_COUNT - ORGANIZATION_COUNT - MEMBER_COUNT - M2M_CLIENT_COUNT api_sso_v1_Connection: type: object properties: organization_id: 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. connection_id: type: string description: Globally unique UUID that identifies a specific External SSO Connection. external_organization_id: type: string description: Globally unique UUID that identifies a different Organization within your Project. external_connection_id: type: string description: Globally unique UUID that identifies a specific SSO connection configured for a different Organization in your Project. display_name: type: string description: A human-readable display name for the connection. status: type: string description: The status of the connection. External connections are always active. external_connection_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_sso_v1_ConnectionImplicitRoleAssignment' description: 'All Members who log in with this External connection will implicitly receive the specified Roles. See the [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment) for more information about role assignment. Implicit role assignments are not supported for External connections if the underlying SSO connection is an OIDC connection. ' external_group_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_sso_v1_GroupImplicitRoleAssignment' description: "Defines the names of the groups\n that grant specific role\ \ assignments. For each group-Role pair, if a Member logs in with this\ \ external connection and\n belongs to the specified group, they will\ \ be granted the associated Role. See the\n [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\ \ for more information about role assignment." required: - organization_id - connection_id - external_organization_id - external_connection_id - display_name - status - external_connection_implicit_role_assignments - external_group_implicit_role_assignments api_sso_v1_ConnectionImplicitRoleAssignment: type: object properties: role_id: type: string description: "The unique identifier of the RBAC Role, provided by the developer\ \ and intended to be human-readable.\n\n Reserved `role_id`s that are\ \ predefined by Stytch include:\n\n * `stytch_member`\n * `stytch_admin`\n\ \n Check out the [guide on Stytch default Roles](https://stytch.com/docs/b2b/guides/rbac/stytch-default)\ \ for a more detailed explanation.\n\n " required: - role_id api_sso_v1_EncryptionPrivateKey: type: object properties: private_key_id: type: string private_key: type: string created_at: type: string required: - private_key_id - private_key api_sso_v1_GroupImplicitRoleAssignment: type: object properties: role_id: type: string group: type: string required: - role_id - group api_sso_v1_OIDCConnection: type: object properties: organization_id: 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. connection_id: type: string description: Globally unique UUID that identifies a specific OIDC Connection. status: type: string description: The status of the connection. The possible values are pending or active. See the [Update OIDC Connection endpoint](https://stytch.com/docs/b2b/api/update-oidc-connection) for more details. display_name: type: string description: A human-readable display name for the connection. redirect_url: type: string description: The callback URL for this OIDC connection. This value will be passed to the IdP to redirect the Member back to Stytch after a sign-in attempt. client_id: type: string description: The OAuth2.0 client ID used to authenticate login attempts. This will be provided by the IdP. client_secret: type: string description: The secret belonging to the OAuth2.0 client used to authenticate login attempts. This will be provided by the IdP. issuer: type: string description: A case-sensitive `https://` URL that uniquely identifies the IdP. This will be provided by the IdP. authorization_url: type: string description: The location of the URL that starts an OAuth login at the IdP. This will be provided by the IdP. token_url: type: string description: The location of the URL that issues OAuth2.0 access tokens and OIDC ID tokens. This will be provided by the IdP. userinfo_url: type: string description: The location of the IDP's [UserInfo Endpoint](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo). This will be provided by the IdP. jwks_url: type: string description: The location of the IdP's JSON Web Key Set, used to verify credentials issued by the IdP. This will be provided by the IdP. identity_provider: type: string description: 'Name of the IdP. Enum with possible values: `classlink`, `cyberark`, `duo`, `google-workspace`, `jumpcloud`, `keycloak`, `miniorange`, `microsoft-entra`, `okta`, `onelogin`, `pingfederate`, `rippling`, `salesforce`, `shibboleth`, or `generic`. Specifying a known provider allows Stytch to handle any provider-specific logic.' custom_scopes: type: string description: 'A space-separated list of custom scopes that will be requested on every SSOStart call. If set, this value will replace the default set of OIDC scopes requested: `openid email profile`. Additional scopes can be requested using the `custom_scopes` query parameter on individual SSOStart calls.' attribute_mapping: type: object additionalProperties: true description: An object that represents the attributes used to identify a Member. This object will map the IdP-defined User attributes to Stytch-specific values, which will appear on the member's Trusted Metadata. required: - organization_id - connection_id - status - display_name - redirect_url - client_id - client_secret - issuer - authorization_url - token_url - userinfo_url - jwks_url - identity_provider - custom_scopes api_sso_v1_SAMLConnection: type: object properties: organization_id: 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. connection_id: type: string description: Globally unique UUID that identifies a specific SAML Connection. status: type: string description: The status of the connection. The possible values are pending or active. See the [Update SAML Connection endpoint](https://stytch.com/docs/b2b/api/update-saml-connection) for more details. idp_entity_id: type: string description: A globally unique name for the IdP. This will be provided by the IdP. display_name: type: string description: A human-readable display name for the connection. idp_sso_url: type: string description: The URL for which assertions for login requests will be sent. This will be provided by the IdP. acs_url: type: string description: The URL of the Assertion Consumer Service. This value will be passed to the IdP to redirect the Member back to Stytch after a sign-in attempt. Read our [SAML Overview](https://stytch.com/docs/b2b/api/saml-overview) for more info. audience_uri: type: string description: The URL of the Audience Restriction. This value will indicate that Stytch is the intended audience of an assertion. Read our [SAML Overview](https://stytch.com/docs/b2b/api/saml-overview) for more info. signing_certificates: type: array items: $ref: '#/components/schemas/api_sso_v1_X509Certificate' description: A list of X.509 certificates Stytch will use to sign its assertion requests. Certificates should be uploaded to the IdP. verification_certificates: type: array items: $ref: '#/components/schemas/api_sso_v1_X509Certificate' description: A list of X.509 certificates Stytch will use to validate an assertion callback. Certificates should be populated from the IdP. encryption_private_keys: type: array items: $ref: '#/components/schemas/api_sso_v1_EncryptionPrivateKey' saml_connection_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_sso_v1_SAMLConnectionImplicitRoleAssignment' description: All Members who log in with this SAML connection will implicitly receive the specified Roles. See the [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment) for more information about role assignment. saml_group_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_sso_v1_SAMLGroupImplicitRoleAssignment' description: "Defines the names of the SAML groups\n that grant specific\ \ role assignments. For each group-Role pair, if a Member logs in with\ \ this SAML connection and\n belongs to the specified SAML group, they\ \ will be granted the associated Role. See the\n [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\ \ for more information about role assignment." alternative_audience_uri: type: string description: An alternative URL to use for the Audience Restriction. This value can be used when you wish to migrate an existing SAML integration to Stytch with zero downtime. Read our [SSO migration guide](https://stytch.com/docs/b2b/guides/migrations/additional-migration-considerations) for more info. identity_provider: type: string description: 'Name of the IdP. Enum with possible values: `classlink`, `cyberark`, `duo`, `google-workspace`, `jumpcloud`, `keycloak`, `miniorange`, `microsoft-entra`, `okta`, `onelogin`, `pingfederate`, `rippling`, `salesforce`, `shibboleth`, or `generic`. Specifying a known provider allows Stytch to handle any provider-specific logic.' nameid_format: type: string description: The NameID format the SAML Connection expects to use. Defaults to `urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress`. alternative_acs_url: type: string description: An alternative URL to use for the `AssertionConsumerServiceURL` in SP initiated SAML AuthNRequests. This value can be used when you wish to migrate an existing SAML integration to Stytch with zero downtime. Note that you will be responsible for proxying requests sent to the Alternative ACS URL to Stytch. Read our [SSO migration guide](https://stytch.com/docs/b2b/guides/migrations/additional-migration-considerations) for more info. idp_initiated_auth_disabled: type: boolean description: Determines whether IDP initiated auth is allowed for a given SAML connection. Defaults to false (IDP Initiated Auth is enabled). allow_gateway_callback: type: boolean attribute_mapping: type: object additionalProperties: true description: 'An object that represents the attributes used to identify a Member. This object will map the IdP-defined User attributes to Stytch-specific values. Required attributes: `email` and one of `full_name` or `first_name` and `last_name`.' required: - organization_id - connection_id - status - idp_entity_id - display_name - idp_sso_url - acs_url - audience_uri - signing_certificates - verification_certificates - encryption_private_keys - saml_connection_implicit_role_assignments - saml_group_implicit_role_assignments - alternative_audience_uri - identity_provider - nameid_format - alternative_acs_url - idp_initiated_auth_disabled - allow_gateway_callback api_sso_v1_SAMLConnectionImplicitRoleAssignment: type: object properties: role_id: type: string description: "The unique identifier of the RBAC Role, provided by the developer\ \ and intended to be human-readable.\n\n Reserved `role_id`s that are\ \ predefined by Stytch include:\n\n * `stytch_member`\n * `stytch_admin`\n\ \n Check out the [guide on Stytch default Roles](https://stytch.com/docs/b2b/guides/rbac/stytch-default)\ \ for a more detailed explanation.\n\n " required: - role_id api_sso_v1_SAMLGroupImplicitRoleAssignment: type: object properties: role_id: type: string group: type: string required: - role_id - group api_sso_v1_X509Certificate: type: object properties: certificate_id: type: string description: The ID of the certificate. certificate: type: string description: The certificate, in [PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format. issuer: type: string description: The issuer of the certificate. For signing certificates, this value will be "Stytch". created_at: type: string description: A timestamp that indicates when the certificate was created. expires_at: type: string description: A timestamp that indicates when the certificate will expire. updated_at: type: string description: A timestamp that indicates when the certificate was updated. required: - certificate_id - certificate - issuer api_sso_v1_AuthenticateRequest: type: object properties: sso_token: type: string description: The token to authenticate. pkce_code_verifier: type: string description: A base64url encoded one time secret used to validate that the request starts and ends on the same device. session_token: type: string description: The `session_token` belonging to the member that you wish to associate the email with. session_jwt: type: string description: The `session_jwt` belonging to the member that you wish to associate the email with. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will be created with a 60 minute\ \ duration. If you don't want\n to use the Stytch session product, you\ \ can ignore the session fields in the response." session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in\n `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To\n delete a key, supply a null value. Custom claims\ \ made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`,\ \ `jti`) will be ignored.\n Total custom claims size cannot exceed four\ \ kilobytes." locale: $ref: '#/components/schemas/api_sso_v1_AuthenticateRequestLocale' description: 'If the Member needs to complete an MFA step, and the Member has a phone number, this endpoint will pre-emptively send a one-time passcode (OTP) to the Member''s phone number. The locale argument will be used to determine which language to use when sending the passcode. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. Currently supported languages are English (`"en"`), Spanish (`"es"`), and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English. Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")! ' intermediate_session_token: type: string description: Adds this primary authentication factor to the intermediate session token. If the resulting set of factors satisfies the organization's primary authentication requirements and MFA requirements, the intermediate session token will be consumed and converted to a member session. If not, the same intermediate session token will be returned. telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - sso_token api_sso_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. member_id: type: string description: Globally unique UUID that identifies a specific Member. organization_id: 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. member: $ref: '#/components/schemas/api_organization_v1_Member' description: The [Member object](https://stytch.com/docs/b2b/api/member-object) session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. reset_session: type: boolean description: This field is deprecated. organization: $ref: '#/components/schemas/api_organization_v1_Organization' description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object). intermediate_session_token: type: string description: The returned Intermediate Session Token contains an SSO factor associated with the Member. If this value is non-empty, the member must complete an MFA step to finish logging in to the Organization. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. The token has a default expiry of 10 minutes. SSO factors are not transferable between Organizations, so the intermediate session token is not valid for use with discovery endpoints. member_authenticated: type: boolean description: Indicates whether the Member is fully authenticated. If false, the Member needs to complete an MFA step to log in to the Organization. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. member_session: $ref: '#/components/schemas/api_b2b_session_v1_MemberSession' description: The [Session object](https://stytch.com/docs/b2b/api/session-object). mfa_required: $ref: '#/components/schemas/api_b2b_mfa_v1_MfaRequired' description: Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA. primary_required: $ref: '#/components/schemas/api_b2b_session_v1_PrimaryRequired' member_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes. required: - request_id - member_id - organization_id - member - session_token - session_jwt - reset_session - organization - intermediate_session_token - member_authenticated - status_code api_sso_v1_DeleteConnectionResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. connection_id: type: string description: The `connection_id` that was deleted as part of the delete request. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - connection_id - status_code api_sso_v1_GetConnectionsRequest: type: object properties: {} description: Request type api_sso_v1_GetConnectionsResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. saml_connections: type: array items: $ref: '#/components/schemas/api_sso_v1_SAMLConnection' description: The list of [SAML Connections](https://stytch.com/docs/b2b/api/saml-connection-object) owned by this organization. oidc_connections: type: array items: $ref: '#/components/schemas/api_sso_v1_OIDCConnection' description: The list of [OIDC Connections](https://stytch.com/docs/b2b/api/oidc-connection-object) owned by this organization. external_connections: type: array items: $ref: '#/components/schemas/api_sso_v1_Connection' description: The list of [External Connections](https://stytch.com/docs/b2b/api/external-connection-object) owned by this organization. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - saml_connections - oidc_connections - external_connections - status_code api_sso_v1_AuthenticateRequestLocale: type: string enum: - en - es - pt-br - fr - it - de-DE - zh-Hans - ca-ES api_sso_v1_sso_oidc_CreateConnectionRequest: type: object properties: display_name: type: string description: A human-readable display name for the connection. identity_provider: $ref: '#/components/schemas/api_sso_v1_CreateConnectionRequestIdentityProvider' description: 'Name of the IdP. Enum with possible values: `classlink`, `cyberark`, `duo`, `google-workspace`, `jumpcloud`, `keycloak`, `miniorange`, `microsoft-entra`, `okta`, `onelogin`, `pingfederate`, `rippling`, `salesforce`, `shibboleth`, or `generic`. Specifying a known provider allows Stytch to handle any provider-specific logic.' description: Request type api_sso_v1_sso_oidc_CreateConnectionResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_sso_v1_OIDCConnection' description: The [OIDC Connection Object](https://stytch.com/docs/b2b/api/oidc-connection-object). required: - request_id - status_code api_sso_v1_sso_oidc_UpdateConnectionRequest: type: object properties: display_name: type: string description: A human-readable display name for the connection. client_id: type: string description: The OAuth2.0 client ID used to authenticate login attempts. This will be provided by the IdP. client_secret: type: string description: The secret belonging to the OAuth2.0 client used to authenticate login attempts. This will be provided by the IdP. issuer: type: string description: A case-sensitive `https://` URL that uniquely identifies the IdP. This will be provided by the IdP. authorization_url: type: string description: The location of the URL that starts an OAuth login at the IdP. This will be provided by the IdP. token_url: type: string description: The location of the URL that issues OAuth2.0 access tokens and OIDC ID tokens. This will be provided by the IdP. userinfo_url: type: string description: The location of the IDP's [UserInfo Endpoint](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo). This will be provided by the IdP. jwks_url: type: string description: The location of the IdP's JSON Web Key Set, used to verify credentials issued by the IdP. This will be provided by the IdP. identity_provider: $ref: '#/components/schemas/api_sso_v1_UpdateConnectionRequestIdentityProvider' description: 'Name of the IdP. Enum with possible values: `classlink`, `cyberark`, `duo`, `google-workspace`, `jumpcloud`, `keycloak`, `miniorange`, `microsoft-entra`, `okta`, `onelogin`, `pingfederate`, `rippling`, `salesforce`, `shibboleth`, or `generic`. Specifying a known provider allows Stytch to handle any provider-specific logic.' custom_scopes: type: string description: Include a space-separated list of custom scopes that you'd like to include. Note that this list must be URL encoded, e.g. the spaces must be expressed as %20. attribute_mapping: type: object additionalProperties: true description: An object that represents the attributes used to identify a Member. This object will map the IdP-defined User attributes to Stytch-specific values, which will appear on the member's Trusted Metadata. description: Request type api_sso_v1_sso_oidc_UpdateConnectionResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_sso_v1_OIDCConnection' description: The [OIDC Connection Object](https://stytch.com/docs/b2b/api/oidc-connection-object). warning: type: string description: If it is not possible to resolve the well-known metadata document from the OIDC issuer, this field will explain what went wrong if the request is successful otherwise. In other words, even if the overall request succeeds, there could be relevant warnings related to the connection update. required: - request_id - status_code api_sso_v1_CreateConnectionRequestIdentityProvider: type: string enum: - classlink - cyberark - duo - generic - google-workspace - jumpcloud - keycloak - miniorange - microsoft-entra - okta - onelogin - pingfederate - rippling - salesforce - shibboleth api_sso_v1_UpdateConnectionRequestIdentityProvider: type: string enum: - classlink - cyberark - duo - generic - google-workspace - jumpcloud - keycloak - miniorange - microsoft-entra - okta - onelogin - pingfederate - rippling - salesforce - shibboleth api_sso_v1_sso_saml_CreateConnectionRequest: type: object properties: display_name: type: string description: A human-readable display name for the connection. identity_provider: $ref: '#/components/schemas/api_sso_v1_CreateConnectionRequestIdentityProvider' description: 'Name of the IdP. Enum with possible values: `classlink`, `cyberark`, `duo`, `google-workspace`, `jumpcloud`, `keycloak`, `miniorange`, `microsoft-entra`, `okta`, `onelogin`, `pingfederate`, `rippling`, `salesforce`, `shibboleth`, or `generic`. Specifying a known provider allows Stytch to handle any provider-specific logic.' description: Request type api_sso_v1_sso_saml_CreateConnectionResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_sso_v1_SAMLConnection' description: The [SAML Connection Object](https://stytch.com/docs/b2b/api/saml-connection-object) required: - request_id - status_code api_sso_v1_sso_saml_DeleteEncryptionPrivateKeyResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. private_key_id: type: string description: The ID of the encryption private key. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - private_key_id - status_code api_sso_v1_sso_saml_DeleteVerificationCertificateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. certificate_id: type: string description: The ID of the certificate that was deleted. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - certificate_id - status_code api_sso_v1_sso_saml_UpdateByURLRequest: type: object properties: metadata_url: type: string description: A URL that points to the IdP metadata. This will be provided by the IdP. description: Request type required: - metadata_url api_sso_v1_sso_saml_UpdateByURLResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_sso_v1_SAMLConnection' description: The [SAML Connection Object](https://stytch.com/docs/b2b/api/saml-connection-object) required: - request_id - status_code api_sso_v1_sso_saml_UpdateConnectionRequest: type: object properties: idp_entity_id: type: string description: A globally unique name for the IdP. This will be provided by the IdP. display_name: type: string description: A human-readable display name for the connection. attribute_mapping: type: object additionalProperties: true description: 'An object that represents the attributes used to identify a Member. This object will map the IdP-defined User attributes to Stytch-specific values. Required attributes: `email` and one of `full_name` or `first_name` and `last_name`.' x509_certificate: type: string description: A certificate that Stytch will use to verify the sign-in assertion sent by the IdP, in [PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format. See our [X509 guide](https://stytch.com/docs/b2b/api/saml-certificates) for more info. idp_sso_url: type: string description: The URL for which assertions for login requests will be sent. This will be provided by the IdP. saml_connection_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_sso_v1_SAMLConnectionImplicitRoleAssignment' description: All Members who log in with this SAML connection will implicitly receive the specified Roles. See the [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment) for more information about role assignment. saml_group_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_sso_v1_SAMLGroupImplicitRoleAssignment' description: "Defines the names of the SAML groups\n that grant specific\ \ role assignments. For each group-Role pair, if a Member logs in with\ \ this SAML connection and\n belongs to the specified SAML group, they\ \ will be granted the associated Role. See the\n [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\ \ for more information about role assignment. Before adding any group\ \ implicit role assignments, you must add a \"groups\" key to your SAML\ \ connection's\n `attribute_mapping`. Make sure that your IdP\ \ is configured to correctly send the group information." alternative_audience_uri: type: string description: An alternative URL to use for the Audience Restriction. This value can be used when you wish to migrate an existing SAML integration to Stytch with zero downtime. Read our [SSO migration guide](https://stytch.com/docs/b2b/guides/migrations/additional-migration-considerations) for more info. identity_provider: $ref: '#/components/schemas/api_sso_v1_UpdateConnectionRequestIdentityProvider' description: 'Name of the IdP. Enum with possible values: `classlink`, `cyberark`, `duo`, `google-workspace`, `jumpcloud`, `keycloak`, `miniorange`, `microsoft-entra`, `okta`, `onelogin`, `pingfederate`, `rippling`, `salesforce`, `shibboleth`, or `generic`. Specifying a known provider allows Stytch to handle any provider-specific logic.' signing_private_key: type: string description: A PKCS1 format RSA private key used for signing SAML requests. Only PKCS1 format (starting with "-----BEGIN RSA PRIVATE KEY-----") is supported. When provided, Stytch will generate a new x509 certificate from this key and return it in the signing_certificates array. nameid_format: type: string description: The NameID format the SAML Connection expects to use. Defaults to `urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress`. alternative_acs_url: type: string description: An alternative URL to use for the `AssertionConsumerServiceURL` in SP initiated SAML AuthNRequests. This value can be used when you wish to migrate an existing SAML integration to Stytch with zero downtime. Note that you will be responsible for proxying requests sent to the Alternative ACS URL to Stytch. Read our [SSO migration guide](https://stytch.com/docs/b2b/guides/migrations/additional-migration-considerations) for more info. idp_initiated_auth_disabled: type: boolean description: Determines whether IDP initiated auth is allowed for a given SAML connection. Defaults to false (IDP Initiated Auth is enabled). saml_encryption_private_key: type: string description: A PKCS1 format RSA private key used to decrypt encrypted SAML assertions. Only PKCS1 format (starting with "-----BEGIN RSA PRIVATE KEY-----") is supported. allow_gateway_callback: type: boolean description: Request type api_sso_v1_sso_saml_UpdateConnectionResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_sso_v1_SAMLConnection' description: The [SAML Connection Object](https://stytch.com/docs/b2b/api/saml-connection-object) required: - request_id - status_code api_sso_v1_sso_external_CreateConnectionRequest: type: object properties: external_organization_id: type: string description: Globally unique UUID that identifies a different Organization within your Project. external_connection_id: type: string description: Globally unique UUID that identifies a specific SSO connection configured for a different Organization in your Project. display_name: type: string description: A human-readable display name for the connection. connection_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_sso_v1_SAMLConnectionImplicitRoleAssignment' group_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_sso_v1_SAMLGroupImplicitRoleAssignment' description: Request type required: - external_organization_id - external_connection_id api_sso_v1_sso_external_CreateConnectionResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_sso_v1_Connection' description: The [External Connection Object](https://stytch.com/docs/b2b/api/external-connection-object). required: - request_id - status_code api_sso_v1_sso_external_UpdateConnectionRequest: type: object properties: display_name: type: string description: A human-readable display name for the connection. external_connection_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_sso_v1_ConnectionImplicitRoleAssignment' description: 'All Members who log in with this External connection will implicitly receive the specified Roles. See the [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment) for more information about role assignment. Implicit role assignments are not supported for External connections if the underlying SSO connection is an OIDC connection. ' external_group_implicit_role_assignments: type: array items: $ref: '#/components/schemas/api_sso_v1_GroupImplicitRoleAssignment' description: "Defines the names of the groups\n that grant specific role\ \ assignments. For each group-Role pair, if a Member logs in with this\ \ external connection and\n belongs to the specified group, they will\ \ be granted the associated Role. See the\n [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/role-assignment)\ \ for more information about role assignment. Before adding any group\ \ implicit role assignments to an external connection, you must add a\ \ \"groups\" key to the underlying SAML connection's\n `attribute_mapping`.\ \ Make sure that the SAML connection IdP is configured to correctly send\ \ the group information. Implicit role assignments are not supported\n\ \ for External connections if the underlying SSO connection is\ \ an OIDC connection." description: Request type api_sso_v1_sso_external_UpdateConnectionResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. connection: $ref: '#/components/schemas/api_sso_v1_Connection' description: The [External Connection Object](https://stytch.com/docs/b2b/api/external-connection-object). required: - request_id - status_code api_totp_v1_TOTP: type: object properties: totp_id: type: string description: The unique ID for a TOTP instance. verified: type: boolean description: The verified boolean denotes whether or not this send method, e.g. phone number, email address, etc., has been successfully authenticated by the User. recovery_codes: type: array items: type: string description: The recovery codes used to authenticate the user without an authenticator app. required: - totp_id - verified - recovery_codes api_totp_v1_AuthenticateRequest: type: object properties: user_id: type: string description: The `user_id` of an active user the TOTP registration should be tied to. You may use an `external_id` here if one is set for the user. totp_code: type: string description: The TOTP code to authenticate. The TOTP code should consist of 6 digits. session_token: type: string description: The `session_token` associated with a User's existing Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - user_id - totp_code api_totp_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. session_token: type: string description: A secret token for a given Stytch Session. totp_id: type: string description: The unique ID for a TOTP instance. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - session_token - totp_id - session_jwt - user - status_code api_totp_v1_CreateRequest: type: object properties: user_id: type: string description: The `user_id` of an active user the TOTP registration should be tied to. You may use an `external_id` here if one is set for the user. expiration_minutes: type: integer format: int32 description: The expiration for the TOTP instance. If the newly created TOTP is not authenticated within this time frame the TOTP will be unusable. Defaults to 1440 (1 day) with a minimum of 5 and a maximum of 1440. description: Request type required: - user_id api_totp_v1_CreateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. totp_id: type: string description: The unique ID for a TOTP instance. secret: type: string description: The TOTP secret key shared between the authenticator app and the server used to generate TOTP codes. qr_code: type: string description: The QR code image encoded in base64. recovery_codes: type: array items: type: string description: The recovery codes used to authenticate the user without an authenticator app. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. user_id: type: string description: The unique ID of the affected User. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - totp_id - secret - qr_code - recovery_codes - user - user_id - status_code api_totp_v1_RecoverRequest: type: object properties: user_id: type: string description: The `user_id` of an active user the TOTP registration should be tied to. You may use an `external_id` here if one is set for the user. recovery_code: type: string description: The recovery code to authenticate. session_token: type: string description: The `session_token` associated with a User's existing Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - user_id - recovery_code api_totp_v1_RecoverResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. totp_id: type: string description: The unique ID for a TOTP instance. user_id: type: string description: The unique ID of the affected User. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - totp_id - user_id - session_token - session_jwt - user - status_code api_totp_v1_RecoveryCodesRequest: type: object properties: user_id: type: string description: The `user_id` of an active user the TOTP registration should be tied to. You may use an `external_id` here if one is set for the user. description: Request type required: - user_id api_totp_v1_RecoveryCodesResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. totps: type: array items: $ref: '#/components/schemas/api_totp_v1_TOTP' description: An array containing a list of all TOTP instances (along with their recovery codes) for a given User in the Stytch API. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - totps - status_code api_webauthn_v1_WebAuthnCredential: type: object properties: credential_id: type: string description: The unique, public ID of the WebAuthn credential. webauthn_registration_id: type: string description: The unique ID for the Passkey or WebAuthn registration. type: type: string description: The type of the WebAuthn credential. Examples include `public-key`. public_key: type: string description: The public key for the WebAuthn credential in base64 format. required: - credential_id - webauthn_registration_id - type - public_key api_webauthn_v1_AuthenticateRequest: type: object properties: public_key_credential: type: string description: The response of the [navigator.credentials.create()](https://www.w3.org/TR/webauthn-2/#sctn-createCredential). session_token: type: string description: The `session_token` associated with a User's existing Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - public_key_credential api_webauthn_v1_AuthenticateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. webauthn_registration_id: type: string description: The unique ID for the Passkey or WebAuthn registration. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' description: The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - webauthn_registration_id - session_token - session_jwt - user - status_code api_webauthn_v1_AuthenticateStartRequest: type: object properties: domain: type: string description: The domain for Passkeys or WebAuthn. Defaults to `window.location.hostname`. user_id: type: string description: The `user_id` of an active user the Passkey or WebAuthn registration should be tied to. You may use an `external_id` here if one is set for the user. return_passkey_credential_options: type: boolean description: "If true, the `public_key_credential_creation_options` returned\ \ will be optimized for Passkeys with `userVerification` set to `\"preferred\"\ `.\n " use_base64_url_encoding: type: boolean description: If true, values in the `public_key_credential_creation_options` will be base64 URL encoded. Set this option to true when using built-in browser methods like `navigator.credentials.create` and `navigator.credentials.get`. description: Request type required: - domain api_webauthn_v1_AuthenticateStartResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. public_key_credential_request_options: type: string description: Options used for Passkey or WebAuthn authentication. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - public_key_credential_request_options - status_code api_webauthn_v1_ListCredentialsRequest: type: object properties: {} description: Request type api_webauthn_v1_ListCredentialsResponse: type: object properties: credentials: type: array items: $ref: '#/components/schemas/api_webauthn_v1_WebAuthnCredential' description: A list of WebAuthn credential objects. request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - credentials - request_id - status_code api_webauthn_v1_RegisterRequest: type: object properties: user_id: type: string description: The `user_id` of an active user the Passkey or WebAuthn registration should be tied to. You may use an `external_id` here if one is set for the user. public_key_credential: type: string description: The response of the [navigator.credentials.create()](https://www.w3.org/TR/webauthn-2/#sctn-createCredential). session_token: type: string description: The `session_token` associated with a User's existing Session. session_duration_minutes: type: integer format: int32 description: "Set the session lifetime to be this many minutes from now.\ \ This will start a new session if one doesn't already exist,\n returning\ \ both an opaque `session_token` and `session_jwt` for this session. Remember\ \ that the `session_jwt` will have a fixed lifetime of\n five minutes\ \ regardless of the underlying session duration, and will need to be refreshed\ \ over time.\n\n This value must be a minimum of 5 and a maximum of 527040\ \ minutes (366 days).\n\n If a `session_token` or `session_jwt` is provided\ \ then a successful authentication will continue to extend the session\ \ this many minutes.\n\n If the `session_duration_minutes` parameter\ \ is not specified, a Stytch session will not be created." session_jwt: type: string description: The `session_jwt` associated with a User's existing Session. session_custom_claims: type: object additionalProperties: true description: "Add a custom claims map to the Session being authenticated.\ \ Claims are only created if a Session is initialized by providing a value\ \ in `session_duration_minutes`. Claims will be included on the Session\ \ object and in the JWT. To update a key in an existing Session, supply\ \ a new value. To delete a key, supply a null value.\n\n Custom claims\ \ made with reserved claims (\"iss\", \"sub\", \"aud\", \"exp\", \"nbf\"\ , \"iat\", \"jti\") will be ignored. Total custom claims size cannot exceed\ \ four kilobytes." telemetry_id: type: string description: If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature. description: Request type required: - user_id - public_key_credential api_webauthn_v1_RegisterResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. webauthn_registration_id: type: string description: The unique ID for the Passkey or WebAuthn registration. session_token: type: string description: A secret token for a given Stytch Session. session_jwt: type: string description: The JSON Web Token (JWT) for a given Stytch Session. user: $ref: '#/components/schemas/api_user_v1_User' status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. session: $ref: '#/components/schemas/api_session_v1_Session' description: "If you initiate a Session, by including `session_duration_minutes`\ \ in your authenticate call, you'll receive a full Session object in the\ \ response.\n\n See [Session object](https://stytch.com/docs/api/session-object)\ \ for complete response fields.\n " user_device: $ref: '#/components/schemas/api_device_history_v1_DeviceInfo' description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes. required: - request_id - user_id - webauthn_registration_id - session_token - session_jwt - user - status_code api_webauthn_v1_RegisterStartRequest: type: object properties: user_id: type: string description: The `user_id` of an active user the Passkey or WebAuthn registration should be tied to. You may use an `external_id` here if one is set for the user. domain: type: string description: The domain for Passkeys or WebAuthn. Defaults to `window.location.hostname`. user_agent: type: string description: The user agent of the client. authenticator_type: type: string description: The requested authenticator type of the Passkey or WebAuthn device. The two valid values are platform and cross-platform. If no value passed, we assume both values are allowed. return_passkey_credential_options: type: boolean description: "If true, the `public_key_credential_creation_options` returned\ \ will be optimized for Passkeys with `residentKey` set to `\"required\"\ ` and `userVerification` set to `\"preferred\"`.\n " override_id: type: string override_name: type: string override_display_name: type: string use_base64_url_encoding: type: boolean description: If true, values in the `public_key_credential_creation_options` will be base64 URL encoded. Set this option to true when using built-in browser methods like `navigator.credentials.create` and `navigator.credentials.get`. description: Request type required: - user_id - domain api_webauthn_v1_RegisterStartResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. user_id: type: string description: The unique ID of the affected User. public_key_credential_creation_options: type: string description: Options used for Passkey or WebAuthn registration. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. required: - request_id - user_id - public_key_credential_creation_options - status_code api_webauthn_v1_UpdateRequest: type: object properties: name: type: string description: The `name` of the WebAuthn registration or Passkey. description: Request type required: - name api_webauthn_v1_UpdateResponse: type: object properties: request_id: type: string description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue. status_code: type: integer format: int32 description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors. webauthn_registration: $ref: '#/components/schemas/api_user_v1_WebAuthnRegistration' description: A Passkey or WebAuthn registration. required: - request_id - status_code