(ActorTokens)
Create an actor token that can be used to impersonate the given user.
The actor
parameter needs to include at least a "sub" key whose value is the ID of the actor (impersonating) user.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
CreateActorTokenRequestBody req = new CreateActorTokenRequestBody() {
UserId = "user_1a2b3c",
Actor = new Models.Operations.Actor() {},
ExpiresInSeconds = 3600,
SessionMaxDurationInSeconds = 1800,
};
var res = await sdk.ActorTokens.CreateAsync(req);
// handle response
CreateActorTokenResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
400, 402, 422 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |
Revokes a pending actor 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.ActorTokens.RevokeAsync(actorTokenId: "act_tok_abcdefghijk");
// handle response
Parameter |
Type |
Required |
Description |
Example |
ActorTokenId |
string |
✔️ |
The ID of the actor token to be revoked. |
act_tok_abcdefghijk |
RevokeActorTokenResponse
Error Type |
Status Code |
Content Type |
Clerk.BackendAPI.Models.Errors.ClerkErrors |
400, 404 |
application/json |
Clerk.BackendAPI.Models.Errors.SDKError |
4XX, 5XX |
*/* |