> For the complete documentation index, see [llms.txt](https://a-send.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://a-send.gitbook.io/api/api-reference/reference/template.md).

# Template

템플릿 조회

## 템플릿 목록 조회

> 템플릿 목록을 조회합니다. 커서 기반 페이지네이션을 사용합니다.\
> \
> 삭제된 템플릿은 목록에서 제외됩니다.<br>

```json
{"openapi":"3.0.3","info":{"title":"Asend API Reference","version":"1.1.0"},"tags":[{"name":"Template","description":"템플릿 조회"}],"servers":[{"url":"https://api.a-send.kr","description":"Production"}],"security":[{"HmacAuth":[]}],"components":{"securitySchemes":{"HmacAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"`apiKey={API_KEY}, ts={TIMESTAMP}, nonce={NONCE}, signature={SIGNATURE}` 형식.\n자세한 내용은 Introduction을 참고하세요.\n"}},"schemas":{"TemplateListRequest":{"type":"object","properties":{"cursor":{"type":"string","nullable":true,"description":"페이지네이션 커서.\n이전 응답의 `next_cursor` 값을 전달합니다. 첫 요청 시 생략합니다.\n"},"limit":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"한 페이지당 반환할 항목 수 (기본값 20, 최대 100)"},"type":{"type":"string","nullable":true,"description":"템플릿 타입 필터","enum":["alimtalk","brandtalk","sms","mms","email"]},"status":{"type":"string","nullable":true,"description":"템플릿 상태 필터"}}},"TemplateListResponse":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TemplateListItem"}},"next_cursor":{"type":"string","nullable":true,"description":"다음 페이지 커서 (마지막 페이지이면 null)"},"has_more":{"type":"boolean","description":"다음 페이지 존재 여부"}}}}},"TemplateListItem":{"type":"object","properties":{"tid":{"type":"string","description":"템플릿 ID"},"name":{"type":"string","description":"템플릿 이름"},"type":{"type":"string","description":"템플릿 유형"},"status":{"type":"string","description":"템플릿 상태"},"created_at":{"type":"string","format":"date-time","description":"생성 시각"},"updated_at":{"type":"string","format":"date-time","description":"수정 시각"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"object","nullable":true,"properties":{"reason":{"type":"string","description":"실패 상세 사유"}}}}},"BaseResponse":{"type":"object","properties":{"message":{"type":"string"},"data":{"nullable":true}}}},"headers":{"X-RateLimit-Limit":{"description":"1분당 허용되는 최대 요청 횟수","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"남은 요청 가능 횟수","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"요청 제한이 초기화되는 시간 (Unix Timestamp)","schema":{"type":"integer"}}},"responses":{"Unauthorized":{"description":"인증 실패","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseResponse"}}}},"RateLimitExceeded":{"description":"요청 제한 초과 (1분당 60회)","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseResponse"}}}},"InternalError":{"description":"서버 내부 오류","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseResponse"}}}}}},"paths":{"/v1/template/list":{"post":{"tags":["Template"],"summary":"템플릿 목록 조회","description":"템플릿 목록을 조회합니다. 커서 기반 페이지네이션을 사용합니다.\n\n삭제된 템플릿은 목록에서 제외됩니다.\n","operationId":"listTemplates","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateListRequest"}}}},"responses":{"200":{"description":"조회 성공","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateListResponse"}}}},"400":{"description":"잘못된 요청","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimitExceeded"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## 템플릿 상세 조회

> 템플릿의 상세 정보를 조회합니다.\
> \
> 응답에 \`variables\` 배열이 포함되며, 이 배열에 있는 변수들은 메시지 발송 시 \`variables\`에 반드시 포함해야 합니다.<br>

```json
{"openapi":"3.0.3","info":{"title":"Asend API Reference","version":"1.1.0"},"tags":[{"name":"Template","description":"템플릿 조회"}],"servers":[{"url":"https://api.a-send.kr","description":"Production"}],"security":[{"HmacAuth":[]}],"components":{"securitySchemes":{"HmacAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"`apiKey={API_KEY}, ts={TIMESTAMP}, nonce={NONCE}, signature={SIGNATURE}` 형식.\n자세한 내용은 Introduction을 참고하세요.\n"}},"headers":{"X-RateLimit-Limit":{"description":"1분당 허용되는 최대 요청 횟수","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"남은 요청 가능 횟수","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"요청 제한이 초기화되는 시간 (Unix Timestamp)","schema":{"type":"integer"}}},"schemas":{"TemplateDetailResponse":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"object","properties":{"tid":{"type":"string","description":"템플릿 ID"},"name":{"type":"string","description":"템플릿 이름"},"type":{"type":"string","description":"템플릿 유형"},"status":{"type":"string","description":"템플릿 상태"},"variables":{"type":"array","description":"템플릿에서 사용하는 변수 목록.\n알림톡 발송 시 `variables`에 이 목록의 모든 변수 값을 포함해야 합니다.\n","items":{"type":"string"}},"created_at":{"type":"string","format":"date-time","description":"생성 시각"},"updated_at":{"type":"string","format":"date-time","description":"수정 시각"}}}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"object","nullable":true,"properties":{"reason":{"type":"string","description":"실패 상세 사유"}}}}},"BaseResponse":{"type":"object","properties":{"message":{"type":"string"},"data":{"nullable":true}}}},"responses":{"Unauthorized":{"description":"인증 실패","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseResponse"}}}},"RateLimitExceeded":{"description":"요청 제한 초과 (1분당 60회)","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseResponse"}}}},"InternalError":{"description":"서버 내부 오류","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseResponse"}}}}}},"paths":{"/v1/template/detail":{"post":{"tags":["Template"],"summary":"템플릿 상세 조회","description":"템플릿의 상세 정보를 조회합니다.\n\n응답에 `variables` 배열이 포함되며, 이 배열에 있는 변수들은 메시지 발송 시 `variables`에 반드시 포함해야 합니다.\n","operationId":"getTemplateDetail","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tid"],"properties":{"tid":{"type":"string","description":"템플릿 ID"}}}}}},"responses":{"200":{"description":"조회 성공","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetailResponse"}}}},"400":{"description":"잘못된 요청","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"템플릿을 찾을 수 없음","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseResponse"}}}},"429":{"$ref":"#/components/responses/RateLimitExceeded"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```
