Skip to main content

Authentication

The Auth tab attaches credentials to a request without you hand-writing the header. Pick a scheme from Auth type and fill its fields; Trq materializes the right header (or query param) when the request fires. Every field is templatable, so credentials come from a captured variable or an environment rather than being hard-coded.

The Auth tab — Bearer token, applied at send as an Authorization header

Auth types

  • No auth — the default; nothing is added.
  • Bearer token — sends Authorization: Bearer <token>. Point Token at a captured value like {{var.token}} from a prior login request, or paste a literal.
  • Basic auth — sends Authorization: Basic <base64(user:pass)>. Fill Username and Password; Trq encodes them at send time.
  • API key — sends a key/value pair either as a Header or a Query param (choose under Add to). Set the Key (e.g. X-Api-Key) and Value (e.g. {{env.API_KEY}}).

Applied at send

Auth is resolved the moment the request fires — templates in the fields are expanded, then the header or query param is added. That means:

  • A Bearer token captured by an earlier request in the case is live for every request after it.
  • Putting the value in an environment ({{env.API_KEY}}) lets the same request authenticate against dev, staging, and prod with different keys.
Keep secrets out of the file

Prefer {{env.*}} or a captured {{var.*}} over pasting a literal secret. Environment values and captured variables aren't baked into the request the way a typed-in token would be.

Next: choose a request body, or see how variables chain a login token into every later request.