Skip to main content

AdminApiClient

Struct AdminApiClient 

Source
pub struct AdminApiClient { /* private fields */ }
Expand description

Client for the Quicknode Admin API. Manage endpoints, tags, teams, billing, usage/metrics, security, and rate limits on the account.

Implementations§

Source§

impl AdminApiClient

Source

pub fn new(config: SdkConfig) -> Self

Source

pub async fn get_endpoints( &self, params: &GetEndpointsRequest, ) -> Result<GetEndpointsResponse, SdkError>

Returns a paginated list of endpoints on the account. Supports searching by subdomain or label, filtering by networks, statuses, labels, and tags, and sorting. The response includes endpoint metadata (id, label, status, chain/network, HTTP and WebSocket URLs, tags) plus total/limit/offset pagination info.

Source

pub async fn create_endpoint( &self, params: &CreateEndpointRequest, ) -> Result<CreateEndpointResponse, SdkError>

Creates a new endpoint for a given blockchain and network. Requires chain and network; returns the new endpoint with its HTTP and WebSocket URLs, default security configuration (tokens, JWTs, IPs, domain masks, CORS), and rate limits.

Source

pub async fn show_endpoint( &self, id: &str, ) -> Result<ShowEndpointResponse, SdkError>

Returns details for a specific endpoint by ID.

Source

pub async fn update_endpoint( &self, id: &str, params: &UpdateEndpointRequest, ) -> Result<(), SdkError>

Updates editable fields on an endpoint (e.g. its label). Returns a boolean indicating whether the update succeeded.

Source

pub async fn archive_endpoint(&self, id: &str) -> Result<(), SdkError>

Archives an endpoint. The API uses DELETE but the effect is archival rather than permanent deletion.

Source

pub async fn update_endpoint_status( &self, id: &str, params: &UpdateEndpointStatusRequest, ) -> Result<UpdateEndpointStatusResponse, SdkError>

Pauses or unpauses an endpoint by setting its status to active or paused.

Source

pub async fn create_tag( &self, id: &str, params: &CreateTagRequest, ) -> Result<(), SdkError>

Creates a new tag on a specific endpoint from a label. Returns the new tag with its id, account info, and timestamps.

Source

pub async fn delete_tag(&self, id: &str, tag_id: &str) -> Result<(), SdkError>

Removes a tag from a specific endpoint by tag id.

Source

pub async fn list_teams(&self) -> Result<ListTeamsResponse, SdkError>

Returns all teams on the account. Each team includes its id, name, member count, and member details (roles, contact info, account status).

Source

pub async fn create_team( &self, params: &CreateTeamRequest, ) -> Result<CreateTeamResponse, SdkError>

Creates a new team. Requires a name; returns the new team with its id, name, default role, and member count.

Source

pub async fn get_team(&self, id: i64) -> Result<GetTeamResponse, SdkError>

Returns a specific team by id, including active members with their roles and contact info plus any pending invites.

Source

pub async fn delete_team(&self, id: i64) -> Result<DeleteTeamResponse, SdkError>

Deletes a team by id. The team must have no members before it can be deleted.

Source

pub async fn list_team_endpoints( &self, id: i64, ) -> Result<ListTeamEndpointsResponse, SdkError>

Returns the endpoints accessible to a given team. Each entry includes the endpoint id, subdomain, chain, and network.

Source

pub async fn update_team_endpoints( &self, id: i64, params: &UpdateTeamEndpointsRequest, ) -> Result<UpdateTeamEndpointsResponse, SdkError>

Assigns or unassigns endpoints for a team. Pass an array of endpoint ids to set the team’s accessible endpoints; pass an empty array to remove all associations.

Source

pub async fn invite_team_member( &self, id: i64, params: &InviteTeamMemberRequest, ) -> Result<InviteTeamMemberResponse, SdkError>

Invites a user to a team by email. For new users, full_name and role (admin, viewer, or billing) are also required. Returns the invited user’s profile and invitation status.

Source

pub async fn remove_team_member( &self, id: i64, user_id: i64, params: &RemoveTeamMemberRequest, ) -> Result<RemoveTeamMemberResponse, SdkError>

Removes a user from a team by team id and user id.

Source

pub async fn resend_team_invite( &self, id: i64, user_id: i64, ) -> Result<ResendTeamInviteResponse, SdkError>

Resends the invitation email to a pending team member, identified by team id and user id.

Source

pub async fn get_usage( &self, params: &GetUsageRequest, ) -> Result<GetUsageResponse, SdkError>

Returns account RPC usage totals for an optional time range. The response includes credits_used, credits_remaining, the account limit, any overages, and the queried time window.

Source

pub async fn get_usage_by_endpoint( &self, params: &GetUsageRequest, ) -> Result<GetUsageByEndpointResponse, SdkError>

Returns RPC usage broken down per endpoint over an optional time range. Each entry includes endpoint metadata, aggregate credits_used and requests, and a per-method credit breakdown.

Source

pub async fn get_usage_by_method( &self, params: &GetUsageRequest, ) -> Result<GetUsageByMethodResponse, SdkError>

Returns RPC usage grouped by method over an optional time range. Each entry includes the method name, credits consumed, and archival status. Ranges longer than one week are rounded to midnight UTC.

Source

pub async fn get_usage_by_chain( &self, params: &GetUsageRequest, ) -> Result<GetUsageByChainResponse, SdkError>

Returns RPC usage grouped by chain over an optional time range. Each entry includes the chain and its credit consumption.

Source

pub async fn get_endpoint_logs( &self, id: &str, params: &GetEndpointLogsRequest, ) -> Result<GetEndpointLogsResponse, SdkError>

Returns activity logs for a specific endpoint. Supports filtering by timestamp range and pagination. Each log entry includes timestamp, HTTP method, network, status code, and error data; full request/response bodies can be included when requested.

Source

pub async fn get_log_details( &self, id: &str, request_id: &str, ) -> Result<GetLogDetailsResponse, SdkError>

Returns the raw request and response payloads for a specific log entry on an endpoint, identified by request UUID. Both payloads are JSON-encoded strings and are truncated at 2KB.

Source

pub async fn get_security_options( &self, id: &str, ) -> Result<GetSecurityOptionsResponse, SdkError>

Returns the security options for an endpoint — an object of security feature toggles with their current enabled/disabled status.

Source

pub async fn update_security_options( &self, id: &str, params: &UpdateSecurityOptionsRequest, ) -> Result<UpdateSecurityOptionsResponse, SdkError>

Updates which security features are enabled on an endpoint. Each option in the submitted object can be toggled enabled or disabled — examples include token auth, JWT validation, IP restrictions, CORS, HSTS, referrer validation, and domain masking.

Source

pub async fn create_token(&self, id: &str) -> Result<(), SdkError>

Generates a new authentication token for an endpoint.

Source

pub async fn delete_token( &self, id: &str, token_id: &str, ) -> Result<DeleteBoolResponse, SdkError>

Revokes a token on an endpoint by token id.

Source

pub async fn create_referrer( &self, id: &str, params: &CreateReferrerRequest, ) -> Result<(), SdkError>

Adds a referrer to an endpoint’s security settings, specifying which external URL or domain is permitted to call the endpoint.

Source

pub async fn delete_referrer( &self, id: &str, referrer_id: &str, ) -> Result<DeleteBoolResponse, SdkError>

Removes a referrer from an endpoint’s security settings by referrer id.

Source

pub async fn create_ip( &self, id: &str, params: &CreateIpRequest, ) -> Result<(), SdkError>

Adds an IP address to an endpoint’s security whitelist.

Source

pub async fn delete_ip( &self, id: &str, ip_id: &str, ) -> Result<DeleteBoolResponse, SdkError>

Removes an IP address from an endpoint’s security whitelist by ip id.

Source

pub async fn create_domain_mask( &self, id: &str, params: &CreateDomainMaskRequest, ) -> Result<(), SdkError>

Adds a domain mask to an endpoint — a custom domain used to hide the endpoint’s Quicknode URL so requests can be routed through your own domain.

Source

pub async fn delete_domain_mask( &self, id: &str, domain_mask_id: &str, ) -> Result<DeleteBoolResponse, SdkError>

Removes a domain mask from an endpoint by domain mask id.

Source

pub async fn create_jwt( &self, id: &str, params: &CreateJwtRequest, ) -> Result<(), SdkError>

Creates a new JWT for endpoint authentication. Accepts a public key, key id (kid), and token name.

Source

pub async fn delete_jwt(&self, id: &str, jwt_id: &str) -> Result<(), SdkError>

Removes a JWT from an endpoint’s security configuration by jwt id, revoking its access.

Source

pub async fn create_request_filter( &self, id: &str, params: &CreateRequestFilterRequest, ) -> Result<CreateRequestFilterResponse, SdkError>

Creates a request filter on an endpoint — a method whitelist that restricts which RPC methods may be called. Accepts an array of method names; other methods are blocked.

Source

pub async fn update_request_filter( &self, id: &str, request_filter_id: &str, params: &UpdateRequestFilterRequest, ) -> Result<(), SdkError>

Updates an existing request filter on an endpoint, replacing the whitelisted method list.

Source

pub async fn delete_request_filter( &self, id: &str, request_filter_id: &str, ) -> Result<(), SdkError>

Removes a request filter from an endpoint’s security configuration by request filter id.

Source

pub async fn enable_multichain(&self, id: &str) -> Result<(), SdkError>

Enables multichain functionality on an endpoint, allowing a single endpoint to serve multiple chains.

Source

pub async fn disable_multichain(&self, id: &str) -> Result<(), SdkError>

Disables multichain functionality on an endpoint.

Source

pub async fn create_or_update_ip_custom_header( &self, id: &str, params: &CreateOrUpdateIpCustomHeaderRequest, ) -> Result<CreateOrUpdateIpCustomHeaderResponse, SdkError>

Sets the custom HTTP header used to identify the client IP for an endpoint (for example, X-Forwarded-For). This header is used by IP-based security features to resolve the real client address when requests are proxied.

Source

pub async fn delete_ip_custom_header( &self, id: &str, ) -> Result<DeleteBoolResponse, SdkError>

Removes the custom IP header configuration from an endpoint.

Source

pub async fn get_method_rate_limits( &self, id: &str, ) -> Result<GetMethodRateLimitsResponse, SdkError>

Returns the method rate limits configured on an endpoint, including each limiter’s interval, methods, rate, and status.

Source

pub async fn create_method_rate_limit( &self, id: &str, params: &CreateMethodRateLimitRequest, ) -> Result<CreateMethodRateLimitResponse, SdkError>

Creates a per-method rate limit on an endpoint. A method rate limit caps specific RPC methods rather than the endpoint as a whole, defined by an interval (e.g. second), the target methods, and a rate.

Source

pub async fn update_method_rate_limit( &self, id: &str, method_rate_limit_id: &str, params: &UpdateMethodRateLimitRequest, ) -> Result<UpdateMethodRateLimitResponse, SdkError>

Updates an existing method rate limit on an endpoint. Accepts the methods to apply the limit to, the desired status, and the rate.

Source

pub async fn delete_method_rate_limit( &self, id: &str, method_rate_limit_id: &str, ) -> Result<(), SdkError>

Removes a method rate limit from an endpoint by method rate limit id.

Source

pub async fn update_rate_limits( &self, id: &str, params: &UpdateRateLimitsRequest, ) -> Result<(), SdkError>

Partial update of the endpoint-level rate-limit overrides. Accepts rps (requests per second), rpm (requests per minute), and rpd (requests per day). Only buckets included in the request body are modified — omitted buckets are left unchanged. Values are capped by the account’s plan tier.

Source

pub async fn get_rate_limits( &self, id: &str, ) -> Result<GetRateLimitsResponse, SdkError>

Returns the endpoint-level rate limits currently enforced, with each row identifying its bucket (rps/rpm/rpd), value, and source (plan_default or user_override). User-set overrides expose an override_id that can be passed to delete_rate_limit_override.

Source

pub async fn delete_rate_limit_override( &self, id: &str, override_id: &str, ) -> Result<(), SdkError>

Deletes a user-set rate-limit override by its UUID. Plan defaults are not deletable — passing a UUID that does not match a user-set override on the endpoint returns 404.

Source

pub async fn get_endpoint_urls( &self, id: &str, ) -> Result<GetEndpointUrlsResponse, SdkError>

Returns the HTTP and WebSocket URLs for the endpoint without fetching the full endpoint record. For multichain endpoints, multichain_urls is a per-network map of additional URLs; for single-chain endpoints it is None.

Source

pub async fn get_endpoint_metrics( &self, id: &str, params: &GetEndpointMetricsRequest, ) -> Result<GetEndpointMetricsResponse, SdkError>

Returns time-series metrics for a specific endpoint. Requires a period (hour, day, week, or month) and a metric type such as method_calls_over_time or response_status_breakdown.

Source

pub async fn get_account_metrics( &self, params: &GetAccountMetricsRequest, ) -> Result<GetAccountMetricsResponse, SdkError>

Returns aggregated metrics across all endpoints on the account. Accepts a period (hour, day, week, or month) and a metric type such as method_calls_over_time or credits_over_time.

Source

pub async fn list_chains(&self) -> Result<ListChainsResponse, SdkError>

Returns all chains supported by Quicknode along with their networks. Each entry includes the chain slug and its network slugs and names.

Source

pub async fn list_invoices(&self) -> Result<ListInvoicesResponse, SdkError>

Returns the account’s invoices, including id, status, billing reason, amounts due and paid, line items with descriptions and billing periods, and creation timestamps.

Source

pub async fn list_payments(&self) -> Result<ListPaymentsResponse, SdkError>

Returns all payments on the account, including amount, status, card last-four, timestamp, currency, and marketplace spending.

Source

pub async fn bulk_update_endpoint_status( &self, params: &BulkUpdateEndpointStatusRequest, ) -> Result<BulkUpdateEndpointStatusResponse, SdkError>

Pauses or unpauses multiple endpoints in a single call. Accepts an array of endpoint ids and a target status (active or paused); returns per-endpoint success/failure results plus totals.

Source

pub async fn bulk_add_tag( &self, params: &BulkAddTagRequest, ) -> Result<BulkAddTagResponse, SdkError>

Applies a single tag label to multiple endpoints in one call. Returns totals for affected endpoints, successes, and failures, plus the tag that was applied.

Source

pub async fn bulk_remove_tag( &self, params: &BulkRemoveTagRequest, ) -> Result<BulkRemoveTagResponse, SdkError>

Removes a tag from multiple endpoints in one call, identified by an array of endpoint ids and a tag id.

Source

pub async fn list_tags(&self) -> Result<ListTagsResponse, SdkError>

Returns all account-level tags, including tags with zero associated endpoints. Each tag includes its id, label, and endpoint usage count.

Source

pub async fn rename_tag( &self, id: i32, params: &RenameTagRequest, ) -> Result<RenameTagResponse, SdkError>

Updates the label of an account tag. Because the tag is shared across endpoints, all associated endpoints reflect the new label immediately.

Source

pub async fn delete_account_tag( &self, id: i32, ) -> Result<DeleteAccountTagResponse, SdkError>

Deletes an account-level tag. The tag must first be removed from all endpoints before it can be deleted.

Source

pub async fn get_usage_by_tag( &self, params: &GetUsageRequest, ) -> Result<GetUsageByTagResponse, SdkError>

Returns RPC usage grouped by endpoint tag over an optional time range. Each entry includes the tag id, label, credits consumed, and request count.

Source

pub async fn get_endpoint_security( &self, id: &str, ) -> Result<GetEndpointSecurityResponse, SdkError>

Returns the full security configuration for an endpoint in a single call, without loading the entire endpoint object. The response includes tokens, JWTs, referrers, domain masks, IPs, and a security options object describing which features are enabled.

Trait Implementations§

Source§

impl Clone for AdminApiClient

Source§

fn clone(&self) -> AdminApiClient

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AdminApiClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more