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
impl AdminApiClient
pub fn new(config: SdkConfig) -> Self
Sourcepub async fn get_endpoints(
&self,
params: &GetEndpointsRequest,
) -> Result<GetEndpointsResponse, SdkError>
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.
Sourcepub async fn create_endpoint(
&self,
params: &CreateEndpointRequest,
) -> Result<CreateEndpointResponse, SdkError>
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.
Sourcepub async fn show_endpoint(
&self,
id: &str,
) -> Result<ShowEndpointResponse, SdkError>
pub async fn show_endpoint( &self, id: &str, ) -> Result<ShowEndpointResponse, SdkError>
Returns details for a specific endpoint by ID.
Sourcepub async fn update_endpoint(
&self,
id: &str,
params: &UpdateEndpointRequest,
) -> Result<(), SdkError>
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.
Sourcepub async fn archive_endpoint(&self, id: &str) -> Result<(), SdkError>
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.
Sourcepub async fn update_endpoint_status(
&self,
id: &str,
params: &UpdateEndpointStatusRequest,
) -> Result<UpdateEndpointStatusResponse, SdkError>
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.
Sourcepub async fn create_tag(
&self,
id: &str,
params: &CreateTagRequest,
) -> Result<(), SdkError>
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.
Sourcepub async fn delete_tag(&self, id: &str, tag_id: &str) -> Result<(), SdkError>
pub async fn delete_tag(&self, id: &str, tag_id: &str) -> Result<(), SdkError>
Removes a tag from a specific endpoint by tag id.
Sourcepub async fn list_teams(&self) -> Result<ListTeamsResponse, SdkError>
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).
Sourcepub async fn create_team(
&self,
params: &CreateTeamRequest,
) -> Result<CreateTeamResponse, SdkError>
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.
Sourcepub async fn get_team(&self, id: i64) -> Result<GetTeamResponse, SdkError>
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.
Sourcepub async fn delete_team(&self, id: i64) -> Result<DeleteTeamResponse, SdkError>
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.
Sourcepub async fn list_team_endpoints(
&self,
id: i64,
) -> Result<ListTeamEndpointsResponse, SdkError>
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.
Sourcepub async fn update_team_endpoints(
&self,
id: i64,
params: &UpdateTeamEndpointsRequest,
) -> Result<UpdateTeamEndpointsResponse, SdkError>
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.
Sourcepub async fn invite_team_member(
&self,
id: i64,
params: &InviteTeamMemberRequest,
) -> Result<InviteTeamMemberResponse, SdkError>
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.
Sourcepub async fn remove_team_member(
&self,
id: i64,
user_id: i64,
params: &RemoveTeamMemberRequest,
) -> Result<RemoveTeamMemberResponse, SdkError>
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.
Sourcepub async fn resend_team_invite(
&self,
id: i64,
user_id: i64,
) -> Result<ResendTeamInviteResponse, SdkError>
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.
Sourcepub async fn get_usage(
&self,
params: &GetUsageRequest,
) -> Result<GetUsageResponse, SdkError>
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.
Sourcepub async fn get_usage_by_endpoint(
&self,
params: &GetUsageRequest,
) -> Result<GetUsageByEndpointResponse, SdkError>
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.
Sourcepub async fn get_usage_by_method(
&self,
params: &GetUsageRequest,
) -> Result<GetUsageByMethodResponse, SdkError>
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.
Sourcepub async fn get_usage_by_chain(
&self,
params: &GetUsageRequest,
) -> Result<GetUsageByChainResponse, SdkError>
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.
Sourcepub async fn get_endpoint_logs(
&self,
id: &str,
params: &GetEndpointLogsRequest,
) -> Result<GetEndpointLogsResponse, SdkError>
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.
Sourcepub async fn get_log_details(
&self,
id: &str,
request_id: &str,
) -> Result<GetLogDetailsResponse, SdkError>
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.
Sourcepub async fn get_security_options(
&self,
id: &str,
) -> Result<GetSecurityOptionsResponse, SdkError>
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.
Sourcepub async fn update_security_options(
&self,
id: &str,
params: &UpdateSecurityOptionsRequest,
) -> Result<UpdateSecurityOptionsResponse, SdkError>
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.
Sourcepub async fn create_token(&self, id: &str) -> Result<(), SdkError>
pub async fn create_token(&self, id: &str) -> Result<(), SdkError>
Generates a new authentication token for an endpoint.
Sourcepub async fn delete_token(
&self,
id: &str,
token_id: &str,
) -> Result<DeleteBoolResponse, SdkError>
pub async fn delete_token( &self, id: &str, token_id: &str, ) -> Result<DeleteBoolResponse, SdkError>
Revokes a token on an endpoint by token id.
Sourcepub async fn create_referrer(
&self,
id: &str,
params: &CreateReferrerRequest,
) -> Result<(), SdkError>
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.
Sourcepub async fn delete_referrer(
&self,
id: &str,
referrer_id: &str,
) -> Result<DeleteBoolResponse, SdkError>
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.
Sourcepub async fn create_ip(
&self,
id: &str,
params: &CreateIpRequest,
) -> Result<(), SdkError>
pub async fn create_ip( &self, id: &str, params: &CreateIpRequest, ) -> Result<(), SdkError>
Adds an IP address to an endpoint’s security whitelist.
Sourcepub async fn delete_ip(
&self,
id: &str,
ip_id: &str,
) -> Result<DeleteBoolResponse, SdkError>
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.
Sourcepub async fn create_domain_mask(
&self,
id: &str,
params: &CreateDomainMaskRequest,
) -> Result<(), SdkError>
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.
Sourcepub async fn delete_domain_mask(
&self,
id: &str,
domain_mask_id: &str,
) -> Result<DeleteBoolResponse, SdkError>
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.
Sourcepub async fn create_jwt(
&self,
id: &str,
params: &CreateJwtRequest,
) -> Result<(), SdkError>
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.
Sourcepub async fn delete_jwt(&self, id: &str, jwt_id: &str) -> Result<(), SdkError>
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.
Sourcepub async fn create_request_filter(
&self,
id: &str,
params: &CreateRequestFilterRequest,
) -> Result<CreateRequestFilterResponse, SdkError>
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.
Sourcepub async fn update_request_filter(
&self,
id: &str,
request_filter_id: &str,
params: &UpdateRequestFilterRequest,
) -> Result<(), SdkError>
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.
Sourcepub async fn delete_request_filter(
&self,
id: &str,
request_filter_id: &str,
) -> Result<(), SdkError>
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.
Sourcepub async fn enable_multichain(&self, id: &str) -> Result<(), SdkError>
pub async fn enable_multichain(&self, id: &str) -> Result<(), SdkError>
Enables multichain functionality on an endpoint, allowing a single endpoint to serve multiple chains.
Sourcepub async fn disable_multichain(&self, id: &str) -> Result<(), SdkError>
pub async fn disable_multichain(&self, id: &str) -> Result<(), SdkError>
Disables multichain functionality on an endpoint.
Sourcepub async fn create_or_update_ip_custom_header(
&self,
id: &str,
params: &CreateOrUpdateIpCustomHeaderRequest,
) -> Result<CreateOrUpdateIpCustomHeaderResponse, SdkError>
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.
Sourcepub async fn delete_ip_custom_header(
&self,
id: &str,
) -> Result<DeleteBoolResponse, SdkError>
pub async fn delete_ip_custom_header( &self, id: &str, ) -> Result<DeleteBoolResponse, SdkError>
Removes the custom IP header configuration from an endpoint.
Sourcepub async fn get_method_rate_limits(
&self,
id: &str,
) -> Result<GetMethodRateLimitsResponse, SdkError>
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.
Sourcepub async fn create_method_rate_limit(
&self,
id: &str,
params: &CreateMethodRateLimitRequest,
) -> Result<CreateMethodRateLimitResponse, SdkError>
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.
Sourcepub async fn update_method_rate_limit(
&self,
id: &str,
method_rate_limit_id: &str,
params: &UpdateMethodRateLimitRequest,
) -> Result<UpdateMethodRateLimitResponse, SdkError>
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.
Sourcepub async fn delete_method_rate_limit(
&self,
id: &str,
method_rate_limit_id: &str,
) -> Result<(), SdkError>
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.
Sourcepub async fn update_rate_limits(
&self,
id: &str,
params: &UpdateRateLimitsRequest,
) -> Result<(), SdkError>
pub async fn update_rate_limits( &self, id: &str, params: &UpdateRateLimitsRequest, ) -> Result<(), SdkError>
Updates the overall rate limits on an endpoint. Accepts rps
(requests per second), rpm (requests per minute), and rpd (requests
per day).
Sourcepub async fn get_endpoint_metrics(
&self,
id: &str,
params: &GetEndpointMetricsRequest,
) -> Result<GetEndpointMetricsResponse, SdkError>
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.
Sourcepub async fn get_account_metrics(
&self,
params: &GetAccountMetricsRequest,
) -> Result<GetAccountMetricsResponse, SdkError>
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.
Sourcepub async fn list_chains(&self) -> Result<ListChainsResponse, SdkError>
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.
Sourcepub async fn list_invoices(&self) -> Result<ListInvoicesResponse, SdkError>
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.
Sourcepub async fn list_payments(&self) -> Result<ListPaymentsResponse, SdkError>
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.
Sourcepub async fn bulk_update_endpoint_status(
&self,
params: &BulkUpdateEndpointStatusRequest,
) -> Result<BulkUpdateEndpointStatusResponse, SdkError>
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.
Sourcepub async fn bulk_add_tag(
&self,
params: &BulkAddTagRequest,
) -> Result<BulkAddTagResponse, SdkError>
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.
Sourcepub async fn bulk_remove_tag(
&self,
params: &BulkRemoveTagRequest,
) -> Result<BulkRemoveTagResponse, SdkError>
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.
Returns all account-level tags, including tags with zero associated endpoints. Each tag includes its id, label, and endpoint usage count.
Sourcepub async fn rename_tag(
&self,
id: i32,
params: &RenameTagRequest,
) -> Result<RenameTagResponse, SdkError>
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.
Sourcepub async fn delete_account_tag(
&self,
id: i32,
) -> Result<DeleteAccountTagResponse, SdkError>
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.
Sourcepub async fn get_usage_by_tag(
&self,
params: &GetUsageRequest,
) -> Result<GetUsageByTagResponse, SdkError>
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.
Sourcepub async fn get_endpoint_security(
&self,
id: &str,
) -> Result<GetEndpointSecurityResponse, SdkError>
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
impl Clone for AdminApiClient
Source§fn clone(&self) -> AdminApiClient
fn clone(&self) -> AdminApiClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more