# Credential

#### List All Credentials

```bash
GET /v2/container-registry-auths
```

**Response:**

```json
{
  "message": "success",
  "code": 10000,
  "data": [
    {
      "id": 123,
      "name": "my-docker-registry",
      "type": "DOCKER_HUB",
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ]
}
```

#### Get Credential by ID

```bash
GET /v2/container-registry-auths/{id}
```

**Response:** Same as list

#### Create Credential

```bash
POST /v2/container-registry-auths
```

**Request Body:**

```json
{
  "name": "my-docker-registry",
  "type": "DOCKER_HUB",
  "username": "myuser",
  "password": "mypassword"
}
```

| FIELD    | TYPE   | REQUIRED | DESCRIPTION                                  |
| -------- | ------ | -------- | -------------------------------------------- |
| name     | string | Yes      | Credential name                              |
| type     | string | Yes      | `DOCKER_HUB`, `GCR`, `ECR`, `ACR`, `PRIVATE` |
| username | string | Yes      | Registry username                            |
| password | string | Yes      | Registry password/token                      |

**Response:** Returns created credential

#### Update Credential (Partial)

```bash
PATCH /v2/container-registry-auths/{id}
```

**Request Body:** All fields optional

```json
{
  "name": "updated-name",
  "username": "newuser",
  "password": "newpassword"
}
```

#### Delete Credential

```
DELETE /v2/container-registry-auths/{id}
```

**Note:** Will fail if credential is in use by any Pod or Endpoint.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yottalabs.ai/api-and-sdk/api-guides/credential.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
