Skip to content

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.

Terminal window
kinstactl auth login
kinstactl auth status
kinstactl auth profiles

Validate an API key and store it, together with your company ID, in a profile.

Terminal window
kinstactl auth login --profile work --api-key - < key.txt
kinstactl auth login [options]

Validate an API key and store it in a profile

Options

OptionDescription
--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.

Show the active credentials and validate them against Kinsta.

Terminal window
kinstactl auth status
kinstactl 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.

Remove a stored profile.

Terminal window
kinstactl auth logout --profile work
kinstactl 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.

List the stored profiles.

Terminal window
kinstactl auth profiles
kinstactl 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.