Authenticate with the v2 API

Send requests to your Gen 3 tenant host, https://<tenant>.katalon.io, over
HTTPS. Create a Katalon API key in your user settings. Use HTTP Basic with an
empty username and the API key as the password:
Authorization: Basic <base64(:API_KEY)>.

An API key uses its owner's access; it does not grant additional permissions.
Keep both the key and its Base64 value secret. Encoding is not encryption.

Send project context

  • x-project-id is required. Use the numeric ID of a project you can access,
    including when listing projects. You can obtain initial context from an
    accessible project's URL in the True Platform UI.
  • x-account-id selects account context and takes an account UUID, not a
    numeric account ID. It is generally optional; the Storage operations in this
    reference explicitly require it, so follow each operation's header list.
  • x-organization-id is optional numeric organization context. If supplied, the
    account and organization must be consistent with the project.

Context headers do not grant membership or permission. Check each operation's
permission requirements and use the correct resource ID type.

Pass credentials through curl's standard input

Set KATALON_API_HOST, KATALON_API_KEY, and KATALON_PROJECT_ID from your
environment or secret store. Use the Bash helper below to keep the key out of
curl's command-line arguments. Do not enable shell tracing (set -x). If the key
contains " or \, escape those characters as \" and \\ for curl's
configuration format.

katalon_request() {
  : "${KATALON_API_KEY:?Missing API key}"
  printf 'user = ":%s"\n' "${KATALON_API_KEY}" |
  curl --config - --silent --show-error --fail-with-body \
    --header "x-project-id: ${KATALON_PROJECT_ID:?Missing project ID}" \
    "$@"
}

katalon_request "${KATALON_API_HOST:?Missing tenant host}/v2/schedules"

To select account or organization context, add the corresponding header to a
request. Keep x-project-id in the helper on every call. Do not send your API
key to a separate signed upload or download destination returned by an operation.

Understand authentication errors

StatusWhat to check
401The API key is missing, invalid, or no longer usable. Confirm HTTP Basic uses an empty username and the key as the password.
403The caller lacks access or a required permission, or the supplied context/resource ID is not accepted. Some operations also reject missing project context with this status.
400A required header or parameter is missing, an ID has the wrong form, or a request/filter is invalid. Check the operation's input contract.

Status and error text can vary by operation. Inspect the response without
logging credentials or private test data. See
Run tests from CI
for a complete execution workflow.


Did this page help you?