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

# Create a credential

`POST /credentials`

## Request

- Base URL: `http://localhost:8080/api/2.1/unity-catalog`
- URL: `http://localhost:8080/api/2.1/unity-catalog/credentials`
- Auth: none declared

Creates a new credential. The type of credential to be created is determined by the **purpose** field.

## Request body

- CreateCredentialRequest
  - `name` string, required: The credential name. The name must be unique within the metastore.
  - `comment` string: Comment associated with the credential.
  - `aws_iam_role` AwsIamRoleRequest
    - `role_arn` string, required: The Amazon Resource Name (ARN) of the AWS IAM role used to vend temporary credentials.
  - `purpose` 'STORAGE'

## Response `200`

The new credential was successfully created.

- CredentialInfo
  - `name` string: The credential name. The name must be unique within the metastore.
  - `aws_iam_role` AwsIamRoleResponse
    - `role_arn` string, required: The Amazon Resource Name (ARN) of the AWS IAM role used to vend temporary credentials.
    - `unity_catalog_iam_arn` string: The Amazon Resource Name (ARN) of the AWS IAM used by the Unity Catalog Server. This is the identity that is going to assume the AWS IAM role.
    - `external_id` string: The external ID used in role assumption to prevent confused deputy problem.
  - `comment` string: Comment associated with the credential.
  - `owner` string: Username of current owner of credential.
  - `full_name` string: The full name of the credential.
  - `id` string: The unique identifier of the credential.
  - `created_at` integer: Time at which this Credential was created, in epoch milliseconds.
  - `created_by` string: Username of credential creator.
  - `updated_at` integer: Time at which this credential was last modified, in epoch milliseconds.
  - `updated_by` string: Username of user who last modified the credential.
  - `purpose` 'STORAGE'

## Changes

- **2025-03-24** `ed1fa6308c2f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/unitycatalog/apis/unity-catalog-api/changes/credentials/post.md)

---

[API](https://skmtc.dev/unitycatalog/apis/unity-catalog-api.md) - [All operations](https://skmtc.dev/unitycatalog/apis/unity-catalog-api/llms.txt) - [OpenAPI document](https://skmtc.dev/unitycatalog/apis/unity-catalog-api/revisions/c84507f0d7e0?raw)
