Skip to content

Latest commit

 

History

History
96 lines (62 loc) · 4.36 KB

README.md

File metadata and controls

96 lines (62 loc) · 4.36 KB

ActorTokens

(actor_tokens)

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

from clerk_backend_api import Clerk

s = Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)


res = s.actor_tokens.create(request={
    "user_id": "user_1a2b3c",
    "actor": {},
    "expires_in_seconds": 3600,
    "session_max_duration_in_seconds": 1800,
})

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request models.CreateActorTokenRequestBody ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ActorToken

Errors

Error Object Status Code Content Type
models.ClerkErrors 400,402,422 application/json
models.SDKError 4xx-5xx /

revoke

Revokes a pending actor token.

Example Usage

from clerk_backend_api import Clerk

s = Clerk(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)


res = s.actor_tokens.revoke(actor_token_id="act_tok_abcdefghijk")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
actor_token_id str ✔️ The ID of the actor token to be revoked. act_tok_abcdefghijk
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ActorToken

Errors

Error Object Status Code Content Type
models.ClerkErrors 400,404 application/json
models.SDKError 4xx-5xx /