Skip to content

Latest commit

 

History

History
87 lines (57 loc) · 4.18 KB

README.md

File metadata and controls

87 lines (57 loc) · 4.18 KB

ActorTokens

(ActorTokens)

Overview

Available Operations

Create

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.

Example Usage

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

Parameters

Parameter Type Required Description
request CreateActorTokenRequestBody ✔️ The request object to use for the request.

Response

CreateActorTokenResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 400, 402, 422 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*

Revoke

Revokes a pending actor token.

Example Usage

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

Parameters

Parameter Type Required Description Example
ActorTokenId string ✔️ The ID of the actor token to be revoked. act_tok_abcdefghijk

Response

RevokeActorTokenResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 400, 404 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*