Skip to content
Docs
Providers

Validate provider connection

Validate provider connection

client.zones.providers.validate(stringid, ProviderValidateParams { zoneId } params, RequestOptionsoptions?): ValidationResult { checks, provider_id, status, validated_at }
POST/zones/{zoneId}/providers/{id}/validate

Runs on-demand OIDC connection checks (issuer reachability, metadata retrieval, endpoint consistency, authorization endpoint reachability, and a demonstration client_credentials exchange) against the provider and returns a per-check result. Results are not persisted.

ParametersExpand Collapse
id: string
params: ProviderValidateParams { zoneId }
zoneId: string
ReturnsExpand Collapse
ValidationResult { checks, provider_id, status, validated_at }

Result of running the provider OIDC connection checks on demand. Not persisted.

checks: Array<Check>

Per-check results, in execution order

check: "issuer_reachability" | "metadata_retrieval" | "endpoint_consistency" | 2 more

Identifier of an individual provider validation check

Accepts one of the following:
"issuer_reachability"
"metadata_retrieval"
"endpoint_consistency"
"authorization_endpoint_reachability"
"credential_exchange"
status: "pass" | "fail" | "skipped_with_reason" | "not_applicable"

Outcome of a single check. pass/fail mean the check ran. skipped_with_reason means it could not run because a prerequisite is missing on our side (e.g. no credential stored). not_applicable means the check does not apply to this provider class (e.g. a login-flow-only provider that does not advertise the client_credentials grant) — render as a neutral state, distinct from a failure. Neither skipped_with_reason nor not_applicable fails the overall run.

Accepts one of the following:
"pass"
"fail"
"skipped_with_reason"
"not_applicable"
detail?: string

Human-readable explanation, present on fail, skipped_with_reason, and not_applicable.

provider_id: string

Provider that was validated

status: "pass" | "fail"

Overall outcome. fail when any individual check failed; skipped checks do not fail the run.

Accepts one of the following:
"pass"
"fail"
validated_at: string

When the validation run completed

formatdate-time

Validate provider connection

import KeycardAPI from '@keycardai/api';

const client = new KeycardAPI({
  apiKey: process.env['KEYCARD_API_API_KEY'], // This is the default and can be omitted
});

const validationResult = await client.zones.providers.validate('id', { zoneId: 'zoneId' });

console.log(validationResult.provider_id);
{
  "checks": [
    {
      "check": "issuer_reachability",
      "status": "pass",
      "detail": "detail"
    }
  ],
  "provider_id": "provider_id",
  "status": "pass",
  "validated_at": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
  "checks": [
    {
      "check": "issuer_reachability",
      "status": "pass",
      "detail": "detail"
    }
  ],
  "provider_id": "provider_id",
  "status": "pass",
  "validated_at": "2019-12-27T18:11:19.117Z"
}