---
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

---

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