---
title: "POST /credentials"
method: POST
path: "/credentials"
tags: ["CredentialsService"]
---

# POST /credentials

`POST /credentials`

## Request body

- CreateCredentialRequest — Create a new credential
  - `name` string, required — The credential name. The name must be unique among storage and service credentials within the metastore.
  - `purpose` integer, required — The credential purpose.
  - `comment` string — Comment associated with the credential.
  - `readOnly` boolean — Whether the credential is usable only for read operations. Only applicable when purpose is STORAGE.
  - `skipValidation` boolean — Supplying true to this argument skips validation of the created set of credentials.
  - `azureServicePrincipal` AzureServicePrincipal
    - `directoryId` string, required — The directory ID corresponding to the Azure Active Directory (AAD) tenant of the application.
    - `applicationId` string, required — The application ID of the application registration within the referenced AAD tenant.
    - `clientSecret` string — The client secret generated for the above app ID in AAD.
    - `federatedTokenFile` string — Location of the file containing a federated token. Specifically useful for workload identity federation.
  - `azureManagedIdentity` AzureManagedIdentity
    - `objectId` string — Object id for use with managed identity authentication
    - `applicationId` string — The application ID of the application registration within the referenced AAD tenant.
    - `msiResourceId` string — Msi resource id for use with managed identity authentication
  - `azureStorageKey` AzureStorageKey
    - `accountName` string, required — The name of the storage account.
    - `accountKey` string, required — The account key of the storage account.

## Response `200`

OK

- CredentialInfo
  - `id` string — The unique identifier of the credential.
  - `name` string — The credential name. The name must be unique among storage and service credentials within the metastore.
  - `purpose` integer — Indicates the purpose of the credential.
  - `readOnly` boolean — Whether the credential is usable only for read operations. Only applicable when purpose is STORAGE.
  - `comment` string — User-provided free-form text description.
  - `owner` string — Username of current owner of credential.
  - `createdAt` string — Time at which this credential was created, in epoch milliseconds.
  - `createdBy` string — Username of credential creator.
  - `updatedAt` string — Time at which this credential was last updated, in epoch milliseconds.
  - `updatedBy` string — Username of user who last modified credential.
  - `usedForManagedStorage` boolean — Whether this credential is the current metastore's root storage credential. Only applicable when purpose is STORAGE.
  - `fullName` string — The full name of the credential.
  - `azureServicePrincipal` AzureServicePrincipal
    - `directoryId` string, required — The directory ID corresponding to the Azure Active Directory (AAD) tenant of the application.
    - `applicationId` string, required — The application ID of the application registration within the referenced AAD tenant.
    - `clientSecret` string — The client secret generated for the above app ID in AAD.
    - `federatedTokenFile` string — Location of the file containing a federated token. Specifically useful for workload identity federation.
  - `azureManagedIdentity` AzureManagedIdentity
    - `objectId` string — Object id for use with managed identity authentication
    - `applicationId` string — The application ID of the application registration within the referenced AAD tenant.
    - `msiResourceId` string — Msi resource id for use with managed identity authentication
  - `azureStorageKey` AzureStorageKey
    - `accountName` string, required — The name of the storage account.
    - `accountKey` string, required — The account key of the storage account.

## Other responses

- `default` — Default error response

## Changes

> 9 revisions in range; 1 could not be searched.

- **2025-03-03** `411e17bba490` — 2 info
  - added the new optional request property `azureStorageKey`
  - added the optional property `azureStorageKey` to the response with the `200` status
- **2025-02-27** `60220bae69ec` — 3 breaking, 4 warning, 22 info
  - added the new required request property `name`
  - added the new required request property `purpose`
  - the response property `name` became optional for the status `200`
  - removed the request property `credential`
  - …25 more
- **2025-02-22** `45486f7d0cd5` — 1 breaking, 2 warning, 5 info
  - added the new required request property `credential`
  - removed the request property `azure`
  - removed the request property `name`
  - added the optional property `createAt` to the response with the `200` status
  - …4 more
- **2025-02-20** `27d7bed71eaa` — 1 info
  - endpoint added
- **2025-02-16** `af378e92b27b` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/delta-incubator/apis/delta-sharing-api/changes/credentials/post.md)

---

[API](https://skmtc.dev/delta-incubator/apis/delta-sharing-api.md) · [All operations](https://skmtc.dev/delta-incubator/apis/delta-sharing-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/delta-incubator/delta-sharing-api/revisions/a47a0389fffc/schema)
