> For the complete documentation index, see [llms.txt](https://docs.yottalabs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yottalabs.ai/api-and-sdk/api-reference-v2/credentials.md).

# Credentials

## Create credential

> Create a new container registry credential

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Credentials v2"}],"security":[{}],"paths":{"/v2/container-registry-auths":{"post":{"summary":"Create credential","deprecated":false,"description":"Create a new container registry credential","operationId":"createCredential","tags":["Credentials v2","API v2"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialV2CreateRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultCredentialV2Response"}}},"headers":{}},"400":{"description":"Invalid request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"CredentialV2CreateRequest":{"type":"object","description":"Container Registry Credential Create Request (v2)","properties":{"name":{"type":"string","description":"Credential name (1-20 chars, starts with letter)","minLength":1,"pattern":"^(?=[A-Za-z])[A-Za-z0-9@._-]{1,20}$"},"username":{"type":"string","description":"Registry username","maxLength":255,"minLength":1},"password":{"type":"string","description":"Registry password/token","maxLength":255,"minLength":1}},"required":["name","password","username"]},"ResultCredentialV2Response":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/CredentialV2Response","description":"data"}}},"CredentialV2Response":{"type":"object","description":"Container Registry Credential Response (v2)","properties":{"id":{"type":"integer","format":"int64","description":"Credential ID"},"name":{"type":"string","description":"Credential name"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Delete credential

> Delete a credential

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Credentials v2"}],"security":[{}],"paths":{"/v2/container-registry-auths/{id}":{"delete":{"summary":"Delete credential","deprecated":false,"description":"Delete a credential","operationId":"deleteCredential","tags":["Credentials v2","API v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Credential deleted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"409":{"description":"Credential in use","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultVoid":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Update credential

> Update an existing credential (partial update)

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Credentials v2"}],"security":[{}],"paths":{"/v2/container-registry-auths/{id}":{"patch":{"summary":"Update credential","deprecated":false,"description":"Update an existing credential (partial update)","operationId":"updateCredential","tags":["Credentials v2","API v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialV2UpdateRequest"}}},"required":true},"responses":{"200":{"description":"Credential updated","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultCredentialV2Response"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"404":{"description":"Credential not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"CredentialV2UpdateRequest":{"type":"object","description":"Container Registry Credential Update Request (v2)","properties":{"name":{"type":"string","description":"Credential name (1-20 chars, starts with letter)","maxLength":20,"minLength":1},"username":{"type":"string","description":"Registry username","maxLength":255,"minLength":1},"password":{"type":"string","description":"Registry password/token","maxLength":255,"minLength":1}}},"ResultCredentialV2Response":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/CredentialV2Response","description":"data"}}},"CredentialV2Response":{"type":"object","description":"Container Registry Credential Response (v2)","properties":{"id":{"type":"integer","format":"int64","description":"Credential ID"},"name":{"type":"string","description":"Credential name"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Get credential

> Get details of a specific credential

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Credentials v2"}],"security":[{}],"paths":{"/v2/container-registry-auths/{id}":{"get":{"summary":"Get credential","deprecated":false,"description":"Get details of a specific credential","operationId":"getCredential","tags":["Credentials v2","API v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Credential found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultCredentialV2Response"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"404":{"description":"Credential not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultCredentialV2Response":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/CredentialV2Response","description":"data"}}},"CredentialV2Response":{"type":"object","description":"Container Registry Credential Response (v2)","properties":{"id":{"type":"integer","format":"int64","description":"Credential ID"},"name":{"type":"string","description":"Credential name"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## List credentials

> Get all credentials for your organization

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Credentials v2"}],"security":[{}],"paths":{"/v2/container-registry-auths":{"get":{"summary":"List credentials","deprecated":false,"description":"Get all credentials for your organization","operationId":"listCredentials","tags":["Credentials v2","API v2"],"parameters":[],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultListCredentialV2Response"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultListCredentialV2Response":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"type":"array","description":"data","items":{"$ref":"#/components/schemas/CredentialV2Response"}}}},"CredentialV2Response":{"type":"object","description":"Container Registry Credential Response (v2)","properties":{"id":{"type":"integer","format":"int64","description":"Credential ID"},"name":{"type":"string","description":"Credential name"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.yottalabs.ai/api-and-sdk/api-reference-v2/credentials.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
