This article explains how to use the searchAccounts GraphQL query to find accounts and their associated patients in Vetspire. This is especially useful for account verification, syncing with external systems, or retrieving patient details before an appointment.
Example Query
query searchAccounts($query: String!, $limit: Int!) { searchAccounts(query: $query, limit: $limit) { id name isActive hasExternalMatches patientResults { id name species isActive isDeceased clientId } } }
Required Variables
You’ll need to include both a query string and a limit to define the maximum number of results returned:
{ "query": "SearchTermHere", "limit": 25 }
query: A partial or full search term (e.g., a client name, patient name, or email).
limit: Maximum number of accounts to return. The default is 10 if not explicitly set, so we recommend specifying this to ensure sufficient results.
Returned Fields Explained
id: The unique internal ID of the account.
name: Account name, typically the pet parent’s full name.
isActive: Indicates if the account is currently active.
hasExternalMatches: Boolean indicating whether the account matches any external systems.
patientResults: A list of patients linked to the account, including:
id: Patient’s unique Vetspire ID
name: Pet’s name
species: Type of animal (e.g., Dog, Cat)
isActive: Whether the patient is still active
isDeceased: Indicates if the pet has been marked deceased
clientId: Reference ID linking the patient to the client
Common Use Cases
Verifying a client before scheduling or billing
Pulling records for migration or sync projects
Checking if a pet is deceased before automated communication
Cross-referencing clients with external integrations
Notes
Omitting the limit field defaults the result to 10 entries.
For broader queries, use a higher limit like 25 or 50 based on your data needs.
Always use specific search terms to avoid unnecessary data load.
Still Need Help?
If you’d like help fine-tuning your search or modifying this query for your specific workflow, reach out to Vetspire Support via chat or submit a ticket.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article