Skip to main content

Authentication

Manage API keys and authentication info.

Access it as client.auth on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.

Methods

All methods

create_key

create_key(*, name: str, scopes: List[str], expires_in_days: Optional[int] = None) -> ApiKeyCreateResponse

Create a new API key.

Args: name: Human-readable name for the key. scopes: List of permission scopes (e.g. ["apps:read", "workflows:write"]). expires_in_days: Optional expiry in days from now.

Returns: The created key including the raw secret (only shown once).

list_keys

list_keys(*, status: Optional[str] = None, limit: Optional[int] = None) -> SyncPaginator[ApiKey]

List API keys for the authenticated user.

Args: status: Optional filter by key status (e.g. "active", "revoked"). limit: Maximum number of items to return (default: all matching items).

retrieve_key

retrieve_key(key_id: str) -> ApiKey

Get details of a single API key.

Args: key_id: The API key ID.

revoke_key

revoke_key(key_id: str) -> Dict[str, Any]

Revoke (delete) an API key.

Args: key_id: The API key ID to revoke.

rotate_key

rotate_key(key_id: str) -> ApiKeyRotateResponse

Rotate an API key, generating a new secret.

Args: key_id: The API key ID to rotate.

Returns: The rotated key including the new raw secret (only shown once).

whoami

whoami() -> WhoamiResponse

Get current user and organization info for the authenticated key/session.