---
title: "Create credential"
method: POST
path: "/credentials"
tags: ["Credentials"]
---

# Create credential

`POST /credentials`

Create a new credential. The secret is returned once and never readable again.

## Request body

- union
  - BearerTokenCreateRequest — Create request for bearer_token credentials.
    - `api` APIReferenceRequest, required — Relaxed variant for request bodies where partial identification is allowed.
      - `catalog_api_id` string, nullable
      - `name` string
      - `vendor` string, required
      - `version` string
    - `name` string, required
    - `provider` string
    - `runtime_config` RuntimeConfig — Optional per-upstream-call overrides.
      - `headers` object, nullable
      - `query_params` object, nullable
    - `server_variables` object, nullable
    - `token` string, required
    - `type` 'bearer_token', required
  - ApiKeyCreateRequest — Create request for api_key credentials.
    - `api` APIReferenceRequest, required — Relaxed variant for request bodies where partial identification is allowed.
      - `catalog_api_id` string, nullable
      - `name` string
      - `vendor` string, required
      - `version` string
    - `field_name` string, required — Header or query-parameter name carrying the key.
    - `key` string, required — The API key secret. Stored encrypted; never returned after create.
    - `location` 'header' | 'query' | 'cookie', required — Where an API-key credential is injected into a request.
    - `name` string, required — Human-readable label for the credential.
    - `provider` string — Credential provider; 'static' for stored secrets.
    - `runtime_config` RuntimeConfig — Optional per-upstream-call overrides.
      - `headers` object, nullable
      - `query_params` object, nullable
    - `server_variables` object, nullable
    - `type` 'api_key', required
  - BasicAuthCreateRequest — Create request for basic credentials.
    - `api` APIReferenceRequest, required — Relaxed variant for request bodies where partial identification is allowed.
      - `catalog_api_id` string, nullable
      - `name` string
      - `vendor` string, required
      - `version` string
    - `name` string, required
    - `password` string, required
    - `provider` string
    - `runtime_config` RuntimeConfig — Optional per-upstream-call overrides.
      - `headers` object, nullable
      - `query_params` object, nullable
    - `server_variables` object, nullable
    - `type` 'basic', required
    - `username` string, required
  - OAuth2CreateRequest — Create request for oauth2 credentials. For managed providers (e.g. pipedream, direct_oauth2), token_url/client_id/client_secret are optional — the connect flow handles authentication without caller-supplied client details.
    - `api` APIReferenceRequest, required — Relaxed variant for request bodies where partial identification is allowed.
      - `catalog_api_id` string, nullable
      - `name` string
      - `vendor` string, required
      - `version` string
    - `authorize_url` string, nullable
    - `client_id` string, nullable
    - `client_secret` string, nullable
    - `grant_type` string
    - `name` string, required
    - `provider` string
    - `runtime_config` RuntimeConfig — Optional per-upstream-call overrides.
      - `headers` object, nullable
      - `query_params` object, nullable
    - `scopes` string[], nullable
    - `server_variables` object, nullable
    - `token_url` string, nullable
    - `type` 'oauth2', required
  - NoAuthCreateRequest — Create request for no_auth credentials. A no-auth credential carries no secret — it represents "this API is called without authentication". It still exists as a credential row so a toolkit binding (and its permission rules) can hang off it, and the broker resolves it as a no-op auth (see broker credential resolver / injection).
    - `api` APIReferenceRequest, required — Relaxed variant for request bodies where partial identification is allowed.
      - `catalog_api_id` string, nullable
      - `name` string
      - `vendor` string, required
      - `version` string
    - `name` string, required
    - `provider` string
    - `runtime_config` RuntimeConfig — Optional per-upstream-call overrides.
      - `headers` object, nullable
      - `query_params` object, nullable
    - `server_variables` object, nullable
    - `type` 'no_auth', required
  - Sigv4CreateRequest — Create request for sigv4 (AWS Signature V4) credentials.
    - `access_key_id` string, required — AWS access key id (public identifier).
    - `api` APIReferenceRequest, required — Relaxed variant for request bodies where partial identification is allowed.
      - `catalog_api_id` string, nullable
      - `name` string
      - `vendor` string, required
      - `version` string
    - `aws_region` string, required — Signing region, e.g. 'us-east-1'.
    - `aws_service` string, required — Signing service, e.g. 'aoss', 'execute-api', 's3'.
    - `name` string, required — Human-readable label for the credential.
    - `provider` string — Credential provider; 'static' for stored secrets.
    - `runtime_config` RuntimeConfig — Optional per-upstream-call overrides.
      - `headers` object, nullable
      - `query_params` object, nullable
    - `secret_access_key` string, required — AWS secret access key. Stored encrypted; never returned after create.
    - `server_variables` object, nullable
    - `session_token` string, nullable — Optional temporary-credential session token (STS). Expires; re-save when it does.
    - `type` 'sigv4', required

## Response `201`

Successful Response

- CredentialCreateResponse — Create response: redacted + secret shown once.
  - `credential` CredentialRedactedResponse, required — Redacted credential response (for read/list/patch).
    - `active` boolean, required — Whether the credential is enabled for injection.
    - `api` APIReference, required — Identifies a target API — the strict (all-required) variant. Used in responses and as the canonical identity tuple.
      - `name` string, required
      - `vendor` string, required
      - `version` string, required
    - `catalog_api_id` string, nullable — Catalog identity slug of the target API (`domain[/sub-api]`), when recorded at create time. Display-only; null for older credentials.
    - `created_at` string, date-time, required — Creation timestamp (UTC).
    - `created_by` string, nullable — Identity that created the credential (its owner).
    - `credential_id` string, required — Stable credential identifier, prefixed `cred_`.
    - `details` object, nullable — Redacted, type-specific projection (hints/last-N chars; never the secret). For oauth2: client_id, token_url, grant_type (authorization_code | client_credentials), scopes, and — for authorization_code only — `connected`, whether the interactive sign-in completed and is still usable (null for other grants).
    - `name` string, required — Human-readable label.
    - `provider` string, required — Credential provider; 'static' for stored secrets.
    - `provider_account_ref` string, nullable — Opaque reference to the provider account, when applicable.
    - `server_variables` object, nullable — OpenAPI server-variable values for URL template substitution.
    - `type` 'bearer_token' | 'api_key' | 'basic' | 'oauth2' | 'no_auth' | 'sigv4', required — Wire-level credential type used by the provider abstraction.
    - `updated_at` string, date-time, nullable — Last update timestamp (UTC).
  - `secret` object, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `422` — Unprocessable Entity
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.net/jentic/apis/jentic-control-plane-api.md) · [All operations](https://skmtc.net/jentic/apis/jentic-control-plane-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/jentic/jentic-control-plane-api/revisions/4ccade8cfa18/schema)
