(SignInTokens)
- Create - Create sign-in token
- Revoke - Revoke the given sign-in token
Creates a new sign-in token and associates it with the given user.
By default, sign-in tokens expire in 30 days.
You can optionally supply a different duration in seconds using the expires_in_seconds
property.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
CreateSignInTokenRequestBody req = new CreateSignInTokenRequestBody() {
UserId = "user_12345",
ExpiresInSeconds = 2592000,
};
var res = await sdk.SignInTokens.CreateAsync(req);
// handle response
CreateSignInTokenResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
404, 422 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Revokes a pending sign-in token
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.SignInTokens.RevokeAsync(signInTokenId: "tok_test_1234567890");
// handle response
Parameter |
Type |
Required |
Description |
Example |
SignInTokenId |
string |
✔️ |
The ID of the sign-in token to be revoked |
tok_test_1234567890 |
RevokeSignInTokenResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
400, 404 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |