---
title: "Create a vault provider"
method: POST
path: "/v2/directories/{directoryId}/vault/providers"
tags: ["TokenVaultProviders"]
---

# Create a vault provider

`POST /v2/directories/{directoryId}/vault/providers`

## Request

- Base URL: `https://global.api.konghq.com`
- URL: `https://global.api.konghq.com/v2/directories/{directoryId}/vault/providers`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Creates a new credential provider configuration for a vault-enabled directory.

## Path parameters

- `directoryId` string, uuid, required

## Request body

- CreateVaultProviderBody
  - `template_name` 'github' | 'slack' | 'static_secret' | 'google' | 'atlassian-rovo' | 'datadog' | 'custom-oauth' | 'miro', required: The static name of the vault provider template to base this provider on (e.g. "github"). For static_secret, provide only name and credential_type ("shared"); the credential is provisioned separately via the vault provider credentials API, and client_id/client_secret are rejected.
  - `name` string, required
  - `client_id` string: OAuth client identifier. Applies only to OAuth templates (authorization_code). Rejected with 400 for static_secret templates.
  - `client_secret` string: OAuth client secret. Applies only to OAuth templates. Rejected with 400 for static_secret templates. Write-only; never returned in read APIs.
  - `token_endpoint` string: Overrides the template token endpoint.
  - `authorization_endpoint` string: Overrides the template authorization endpoint.
  - `registration_endpoint` string: Overrides the template DCR registration endpoint.
  - `dcr_enabled` boolean: When true, requests Dynamic Client Registration (RFC 7591) instead of a static client_id. Requires a resolvable registration_endpoint (provider override or template default) and that client_id is omitted. Each principal using this provider is registered its own upstream OAuth client lazily, on first use. Templates that ship their own registration endpoint (e.g. datadog) are DCR-based: dcr_enabled defaults to true when neither dcr_enabled nor client_id is supplied, and supplying a client_id selects a static client.
  - `scopes` string[]: Requested OAuth scopes. Defaults to the full set of template default scopes when omitted. Each scope must be a valid RFC 6749 §3.3 scope-token.
  - `credential_type` string: Credential scope. Defaults to "user" for authorization_code templates when omitted; static_secret templates require "shared".
  - `pkce_enabled` boolean: Use PKCE (S256) on the authorization-code flow. Templates whose authorization server mandates PKCE (pkce_required, e.g. datadog) imply true when this field is omitted; setting it explicitly to false is rejected with 400.
  - `refresh_buffer_seconds` integer

## Response `201`

A vault provider

- VaultProvider: An credential provider configuration for a token-vault enabled directory.
  - `id` string, uuid, required: Contains a unique identifier used for this resource.
  - `directory_id` string, uuid, required: Contains a unique identifier used for this resource.
  - `name` string, required
  - `template_name` 'github' | 'slack' | 'static_secret' | 'google' | 'atlassian-rovo' | 'datadog' | 'custom-oauth' | 'miro', required: The static name of the vault provider template to base this provider on (e.g. "github"). For static_secret, provide only name and credential_type ("shared"); the credential is provisioned separately via the vault provider credentials API, and client_id/client_secret are rejected.
  - `bearer_methods_supported` string[], required
  - `enabled` boolean, required: Defines if the provider is enabled or not
  - `client_id` string, nullable
  - `scopes` string[], required
  - `token_endpoint_effective` string, nullable: Resolved token endpoint (provider override or template default).
  - `authorization_endpoint_effective` string, nullable: Resolved authorization endpoint (provider override or template default).
  - `registration_endpoint_effective` string, nullable: Resolved DCR registration endpoint (provider override or template default).
  - `dcr_enabled` boolean, required: True if this provider's OAuth client is obtained via Dynamic Client Registration (RFC 7591) rather than a statically-supplied client_id. When true, client_id is null on this provider -- each principal gets its own dynamically-registered client on first use.
  - `credential_type` string, required
  - `pkce_enabled` boolean, required
  - `refresh_buffer_seconds` integer, required
  - `created_at` string, date-time, required: An ISO-8601 timestamp representation of entity creation date.
  - `updated_at` string, date-time, required: An ISO-8601 timestamp representation of entity update date.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found

## Changes

- **2026-11-03** `72599e2b1b09`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/konnect-api-go-sdk/changes/v2/directories/:directoryId/vault/providers/post.md)

---

[API](https://skmtc.dev/kong/apis/konnect-api-go-sdk.md) - [All operations](https://skmtc.dev/kong/apis/konnect-api-go-sdk/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/konnect-api-go-sdk/revisions/3b071797f6e4?raw)
