Back to TresekoView full library

API keys and external access

How to connect integrations without sharing users or passwords.

Practical guide

1 guide found

All guides

API keys and external access

How to connect integrations without sharing users or passwords.

Open guide
Reading
6 min
Updated
2026-07-12
Version
1.0.6

When to use this guide

Use it before connecting pipelines, external scripts or integrations that report results to Treseko.

Expected result

The integration uses an active API key, with appropriate permissions and the ability to revoke without changing the user account.

An API key identifies an integration. It should not replace human login or be shared across teams without control.

To report external tests, the key must belong to an active user with permissions on the involved solution, project and build.

If a key is leaked, it is revoked. That is the advantage over sharing personal passwords in CI/CD scripts.

Recommended flow

  1. Log in with the user who will be responsible for the integration.
  2. Open My Profile or the API keys section.
  3. Create a key with a descriptive name.
  4. Save the token in the pipeline's secret manager.
  5. Test a minimal external report.
  6. Rotate the key if the responsible person changes or there is suspicion of leakage.
  7. Revoke keys that are no longer used.

Use API key in an external report

curl -X POST "$TRESEKO_API_URL/external/executions/report" \
  -H "Authorization: Bearer $TRESEKO_EXTERNAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"solution_code":"SOL-demo","project_code":"PRJ-demo","component_code":"CMP-web","build_code":"BLD-001","external_run_id":"ci-001","cases":[]}'

How to verify

  • The key is not written in repositories or logs.
  • The associated user is still active.
  • The external report returns a 2xx response or an understandable permission error.
  • Revoking the key prevents new reports with that token.

Common pitfalls

  • Using a personal key in a shared pipeline without a clear owner.
  • Pasting tokens in versioned files.
  • Giving broad permissions to solve a one-time error.
  • Not rotating keys after a demo or public test.
api keyintegracionesci cdsecurityexternal api