(sign_in_tokens)
- 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.
from clerk_backend_api import Clerk
with Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as s:
res = s.sign_in_tokens.create(request={
"user_id": "user_12345",
"expires_in_seconds": 2592000,
})
if res is not None:
# handle response
pass
models.SignInToken
Error Type |
Status Code |
Content Type |
models.ClerkErrors |
404, 422 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
Revokes a pending sign-in token
from clerk_backend_api import Clerk
with Clerk(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as s:
res = s.sign_in_tokens.revoke(sign_in_token_id="tok_test_1234567890")
if res is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
Example |
sign_in_token_id |
str |
✔️ |
The ID of the sign-in token to be revoked |
tok_test_1234567890 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.SignInToken
Error Type |
Status Code |
Content Type |
models.ClerkErrors |
400, 404 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |