auth
The auth commands manage the credentials kinstactl uses to talk to the Kinsta API. They are stored per profile; see Authentication for the full story, including the environment variables for CI.
kinstactl auth loginkinstactl auth statuskinstactl auth profilesauth login
Section titled “auth login”Validate an API key and store it, together with your company ID, in a profile.
kinstactl auth login --profile work --api-key - < key.txtkinstactl auth login [options]Validate an API key and store it in a profile
Options
| Option | Description |
|---|---|
--api-key <key> | API key (required when not interactive); "-" reads it from stdin. A literal key ends up in your shell history: prefer "--api-key -" or KINSTA_API_KEY |
Global options --profile, --json and --no-input apply too. See scripting and CI.
Kinsta API: GET /validate
The key is validated against Kinsta (GET /validate) before anything is stored, and the company ID is the one Kinsta reports for that key, so you never type it yourself. A key passed as a literal --api-key <key> ends up in your shell history. Pass - to read it from stdin instead. When stdin is not a terminal and no --api-key is given, the command fails with a USAGE error instead of prompting. Use the global --profile <name> to store the key under a named profile.
auth status
Section titled “auth status”Show the active credentials and validate them against Kinsta.
kinstactl auth statuskinstactl auth status [options]Show the active credentials and validate them against Kinsta
Kinsta API: GET /validate
The output names the source of the credentials (env for KINSTA_API_KEY and KINSTA_COMPANY_ID, profile for a stored profile), the profile, the company ID, the name and status of the key and when it expires. The key itself is never printed. Because the key is validated against Kinsta, the command fails when the key has been revoked, which makes it a quick check at the start of a CI job.
auth logout
Section titled “auth logout”Remove a stored profile.
kinstactl auth logout --profile workkinstactl auth logout [options]Remove a stored profile
The profile is selected by the usual rules (--profile, KINSTA_PROFILE, the default profile), and the command fails with a USAGE error when that profile does not exist. Credentials that come from environment variables are not affected.
auth profiles
Section titled “auth profiles”List the stored profiles.
kinstactl auth profileskinstactl auth profiles [options]List stored profiles
The table shows each profile with its company ID and key name, and marks the default profile. See Profiles for working with more than one company.