Get template detail
GET /v1/templates/{templateId}
GET https://api.k-otp.dev/v1/templates/{templateId}Overview
Returns one template including the variables schema that templateVariables must satisfy on POST /issue. code is always filled in by the server and must not be sent in templateVariables.
Requires an sk_ secret key; pk_ public keys are rejected with 403.
Authentication
| Accepted keys | Required scope | Also accepted |
|---|---|---|
sk_ | otp:templates | otp:read, * |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
templateId | path | string | yes | Template id from GET /v1/templates. |
Response (200)
Template detail.
| Field | Type | Required | Description |
|---|---|---|---|
templateId | string | yes | |
name | string | yes | |
channelSupport | "alimtalk" | "sms"[] | yes | Channels this template can be sent on. |
body | string | yes | Message body; #{code} is replaced with the OTP and other #{variable} placeholders with templateVariables. |
variables | object | yes | Variables accepted in templateVariables when issuing with this template. |
Error responses
Every error uses the { defined, code, status, message, data? } envelope. See Errors.
| Status | code | Description |
|---|---|---|
| 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. |
| 404 | NOT_FOUND | no template with this templateId is available. |
| 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. |
Example request
curl "https://api.k-otp.dev/v1/templates/otp_default_kr" \
-H "Authorization: Bearer $KOTP_SECRET_KEY"