> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blobhub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Credential

Create a new credential for a target.

## **POST** `/:target/:target_id/credentials`

### Path Parameters

| Parameter   | Type   | Required | Description                                 |
| :---------- | :----- | :------- | :------------------------------------------ |
| `target`    | string | Yes      | Resource type: `users`, `orgs`, or `blobs`. |
| `target_id` | string | Yes      | The unique ID of the target resource.       |

### Request Body

| Parameter     | Type   | Required | Description                             |
| :------------ | :----- | :------- | :-------------------------------------- |
| `alias`       | string | Yes      | Unique alias for the credential.        |
| `type`        | string | Yes      | Credential provider type (e.g., `aws`). |
| `body`        | object | Yes      | Provider-specific credential details.   |
| `description` | string | No       | Description of the credential.          |

### Response

| Parameter       | Type   | Description                      |
| :-------------- | :----- | :------------------------------- |
| `credential_id` | string | The unique ID of the credential. |

### Example

<CodeGroup>
  ```json Request theme={null}
  {
    "alias": "aws-dev",
    "type": "aws",
    "body": {
      "access_key_id": "AKIA...",
      "secret_access_key": "secret..."
    }
  }
  ```

  ```json Response theme={null}
  {
    "credential_id": "cred_002"
  }
  ```
</CodeGroup>
