템플릿 목록
GET /v1/templates
GET https://api.k-otp.dev/v1/templates개요
Returns the whitelisted message templates that POST /issue accepts via templateId, plus the default template id used when templateId is omitted. The list is small and not paginated. Every template body contains the #{code} placeholder; new templates are registered operationally, not through the API.
Requires an sk_ secret key; pk_ public keys are rejected with 403.
인증
| 허용 키 | 필요 scope | 대체 허용 scope |
|---|---|---|
sk_ | otp:templates | otp:read, * |
응답 (200)
All available templates.
| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
defaultTemplateId | string | 예 | Template used when POST /v1/issue omits templateId. |
templates | object[] | 예 | |
note | string | 예 | Human-readable policy note. |
오류 응답
모든 오류는 { defined, code, status, message, data? } 형태입니다. 자세한 내용은 오류를 참고하세요.
| 상태 | code | 설명 |
|---|---|---|
| 400 | BAD_REQUEST | the request failed input validation. message describes the first failing constraint. |
| 401 | UNAUTHORIZED | the Authorization: Bearer credential is missing, malformed, inactive, or rejected by introspection. |
| 403 | FORBIDDEN | the credential lacks otp:templates (or an accepted alias), or a pk_ public key was used. Public keys are limited to issue/verify. |
| 409 | CONFLICT | the request conflicts with the current state of the resource. |
| 500 | INTERNAL_SERVER_ERROR | unexpected server failure. Undefined errors (defined: false) use the same envelope. |
| 503 | SERVICE_UNAVAILABLE | credential introspection or a downstream dependency is temporarily unavailable. Retry with backoff. |
요청 예시
curl "https://api.k-otp.dev/v1/templates" \
-H "Authorization: Bearer $KOTP_SECRET_KEY"