{ "opencollection": "1.0.0", "info": { "name": "Stytch B2B Authentication Application Session API", "version": "2.0.0" }, "items": [ { "info": { "name": "Session", "type": "folder" }, "items": [ { "info": { "name": "Get", "type": "http" }, "http": { "method": "GET", "url": "https://api.stytch.com/v1/b2b/sessions", "params": [ { "name": "organization_id", "value": "", "type": "query" }, { "name": "member_id", "value": "", "type": "query" } ] }, "docs": "Retrieves all active Sessions for a Member." }, { "info": { "name": "Authenticate", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/b2b/sessions/authenticate", "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nYou 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 val" }, { "info": { "name": "Revoke", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/b2b/sessions/revoke", "headers": [ { "name": "X-Stytch-Member-Session", "value": "" }, { "name": "X-Stytch-Member-SessionJWT", "value": "" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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`." }, { "info": { "name": "Exchange", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/b2b/sessions/exchange", "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nTo 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.\n\nIf the user **has** already satisfied the authentication requirements of the Organization they are trying to switch into, this" }, { "info": { "name": "Exchangeaccesstoken", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/b2b/sessions/exchange_access_token", "body": { "type": "json", "data": "{}" } }, "docs": "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 Tok" }, { "info": { "name": "Attest", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/b2b/sessions/attest", "body": { "type": "json", "data": "{}" } }, "docs": "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." }, { "info": { "name": "Migrate", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/b2b/sessions/migrate", "body": { "type": "json", "data": "{}" } }, "docs": "Migrate a session from an external OIDC compliant endpoint.\nStytch 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`.\nIf 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.\nYou will need to create the member before using this endpoint." }, { "info": { "name": "Getjwks", "type": "http" }, "http": { "method": "GET", "url": "https://api.stytch.com/v1/b2b/sessions/jwks/:project_id", "params": [ { "name": "project_id", "value": "", "type": "path", "description": "The `project_id` to get the JWKS for." } ] }, "docs": "Get the JSON Web Key Set (JWKS) for a project.\n\nWithin 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.\n\nJWTs 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 J" }, { "info": { "name": "Get", "type": "http" }, "http": { "method": "GET", "url": "https://api.stytch.com/v1/sessions", "params": [ { "name": "user_id", "value": "", "type": "query" } ] }, "docs": "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`." }, { "info": { "name": "Authenticate", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/sessions/authenticate", "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nYou may provide a" }, { "info": { "name": "Revoke", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/sessions/revoke", "body": { "type": "json", "data": "{}" } }, "docs": "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." }, { "info": { "name": "Migrate", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/sessions/migrate", "body": { "type": "json", "data": "{}" } }, "docs": "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." }, { "info": { "name": "Exchangeaccesstoken", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/sessions/exchange_access_token", "body": { "type": "json", "data": "{}" } }, "docs": "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." }, { "info": { "name": "Getjwks", "type": "http" }, "http": { "method": "GET", "url": "https://api.stytch.com/v1/sessions/jwks/:project_id", "params": [ { "name": "project_id", "value": "", "type": "path", "description": "The `project_id` to get the JWKS for." } ] }, "docs": "Get the JSON Web Key Set (JWKS) for a project.\n\nWithin 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.\n\nJWTs 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 J" }, { "info": { "name": "Attest", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/sessions/attest", "body": { "type": "json", "data": "{}" } }, "docs": "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." } ] } ], "bundled": true }