Learn R Programming

motherduck (version 0.2.0)

delete_md_access_token: Delete a MotherDuck user's access token

Description

Deletes a specific access token for a given MotherDuck user using the REST API. This operation requires administrative privileges and a valid API token.

Usage

delete_md_access_token(
  user_name,
  token_name,
  motherduck_token = "MOTHERDUCK_TOKEN"
)

Value

A tibble summarizing the API response, typically including the username and deletion status of the token.

Arguments

user_name

A character string specifying the MotherDuck user name whose tokens should be listed.

token_name

Character. The name of the access token to delete.

motherduck_token

Character. Either the name of an environment variable containing your MotherDuck access token (default "MOTHERDUCK_TOKEN") or the token itself.

Details

This function calls the MotherDuck REST API endpoint https://api.motherduck.com/v1/users/{user_name}/tokens/{token_name} using a DELETE request to remove the specified token. The authenticated user must have sufficient permissions to perform token management.

See Also

Other db-api: configure_md_user_settings(), create_md_access_token(), create_md_user(), delete_md_user(), list_md_active_accounts(), list_md_user_instance(), list_md_user_tokens(), show_current_user()

Examples

Run this code
if (FALSE) {
# Delete a token named "temp_token" for user "alejandro_hagan"
delete_md_access_token(
  user_name = "alejandro_hagan",
  token_name = "temp_token",
  motherduck_token = "MOTHERDUCK_TOKEN"
)
}

Run the code above in your browser using DataLab