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

# 시크릿 생성·업데이트

> 시크릿 값 기록.

**`PUT`** `https://api-datahub.octoparse.com/v1/secrets/{name}`

인증: API 키 필요(`Authorization: Bearer <API Key>`).

업스트림 자격 증명 시크릿 생성 또는 로테이션. 평문은 쓸 때만. 읽기에서는 반환 안 함.

## 요청

### 경로 파라미터

<ParamField path="name" type="string" required>
  시크릿 이름. 영문·숫자·밑줄. App은 `env.<name>`.
</ParamField>

### 요청 body

<ParamField body="value" type="string" required>
  평문 시크릿 값.
</ParamField>

### 요청 예시

```bash theme={null}
curl -X PUT   -H "Authorization: Bearer $OCTOPARSE_API_KEY"   -H "Content-Type: application/json"   -d '{"value": "sk-live-example"}'   "https://api-datahub.octoparse.com/v1/secrets/EXAMPLE_API_KEY"
```

## 응답

### 200 성공

```json theme={null}
{
  "data": {
    "name": "EXAMPLE_API_KEY",
    "mask": "sk-****mple",
    "updated_at": "2026-09-01T08:00:00+00:00"
  }
}
```

페이로드는 `data`로 감쌉니다. 필드:

<ResponseField name="name" type="string" required>
  시크릿 이름.
</ResponseField>

<ResponseField name="mask" type="string" required>
  쓰기 후 마스크 값.
</ResponseField>

<ResponseField name="updated_at" type="string" required>
  업데이트 시각(ISO 8601).
</ResponseField>

### 오류

| HTTP | `code`          | `category`      | 설명              |
| ---- | --------------- | --------------- | --------------- |
| 400  | `invalid-input` | `invalid_input` | 이름 또는 값 무효.     |
| 401  | `unauthorized`  | `forbidden`     | API 키 누락 또는 무효. |

오류 응답은 `{"error": {code, category, message, retryable}}`입니다. <a href="/docs/ko/datahub/api/reference/introduction#errors">오류</a> 참고.

## 클라이언트 라이브러리

Python / JavaScript SDK는 아직 이 엔드포인트를 감싸지 않습니다. REST를 직접 호출하세요.
