Get an Astra DB admin (Python)

The Data API clients use the Astra DB Admin class to perform administrative operations like creating and dropping databases.

To perform administrative actions within a specific database, see Get a database admin (Python) instead.

The Astra DB Admin class name varies by client. The Python client uses AstraDBAdmin.

You need an application token with permission to create and configure databases, such as the Organization Administrator role.

For more information, see Get endpoint and token.

Result

Returns an AstraDBAdmin object that can perform administrative actions.

Parameters

Use the get_admin method from the DataAPIClient class.

Method signature
get_admin(
  *,
  token: str | TokenProvider,
  spawn_api_options: APIOptions,
) -> AstraDBAdmin
Name Type Summary

token

str | TokenProvider

Optional. The token used by the resulting admin object. The token should have sufficient permissions to perform the desired downstream operations.

Default: The token used by the object that called this method.

spawn_api_options

APIOptions

Optional. A complete or partial specification of the APIOptions to override the inherited defaults. Use this to customize the interaction of the client with the admin object. For example, you can change the default timeouts.

If APIOptions is passed together with a named parameter such as a timeout, the latter takes precedence over the corresponding spawn_api_options setting.

Examples

The following examples demonstrate how to get an Astra DB admin.

from astrapy import DataAPIClient

# Get an admin object
client = DataAPIClient("APPLICATION_TOKEN")
admin = client.get_admin()

Client reference

For more information, see the client reference.

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2026 | Privacy policy | Terms of use Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: Contact IBM