# Template

## List

> Returns client-specific templates (optionally filtered by status) plus common approved templates.<br>

```json
{"openapi":"3.0.3","info":{"title":"SMS Template API","version":"1.0.0"},"servers":[{"url":"https://messaging-api.bind.hr","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY","description":"API key header."}},"schemas":{}},"paths":{"/v1.0/sms/template":{"get":{"tags":["Template"],"summary":"List","description":"Returns client-specific templates (optionally filtered by status) plus common approved templates.\n","parameters":[{"in":"query","name":"status","schema":{"type":"string"},"required":false,"description":"Optional status filter (e.g. `approved`, `for_review`)."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"401":{"description":"Unauthorized (missing/invalid API key)"},"500":{"description":"Internal server error"}}}}}}
```

## Create

> Create a new template.

```json
{"openapi":"3.0.3","info":{"title":"SMS Template API","version":"1.0.0"},"servers":[{"url":"https://messaging-api.bind.hr","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY","description":"API key header."}},"schemas":{"SubmitRequest":{"type":"object","properties":{"name":{"type":"string"},"sender":{"type":"string","minLength":3,"maxLength":15},"content":{"type":"string","maxLength":1000}},"required":["name","sender","content"]},"SubmitResponse":{"type":"object","properties":{"success":{"type":"boolean"},"item":{"$ref":"#/components/schemas/TemplateBase"}},"required":["success","item"]},"TemplateBase":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"sender":{"type":"string","description":"Sender ID. Numeric 4-15 digits or alphanumeric up to 11 chars (A-Z a-z 0-9 _ space)."},"content":{"type":"string"},"status":{"type":"string","description":"Template status (e.g., for_review, approved)."}},"required":["id","name","sender","content","status"]},"OperationError":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}}},"paths":{"/v1.0/sms/template":{"post":{"tags":["Template"],"summary":"Create","description":"Create a new template.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitRequest"}}}},"responses":{"200":{"description":"Created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationError"}}}},"401":{"description":"Unauthorized (missing/invalid API key)"},"500":{"description":"Failed to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationError"}}}}}}}}}
```

## Update

> Update an existing template.

```json
{"openapi":"3.0.3","info":{"title":"SMS Template API","version":"1.0.0"},"servers":[{"url":"https://messaging-api.bind.hr","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY","description":"API key header."}},"schemas":{"SubmitRequest":{"type":"object","properties":{"name":{"type":"string"},"sender":{"type":"string","minLength":3,"maxLength":15},"content":{"type":"string","maxLength":1000}},"required":["name","sender","content"]},"SubmitResponse":{"type":"object","properties":{"success":{"type":"boolean"},"item":{"$ref":"#/components/schemas/TemplateBase"}},"required":["success","item"]},"TemplateBase":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"sender":{"type":"string","description":"Sender ID. Numeric 4-15 digits or alphanumeric up to 11 chars (A-Z a-z 0-9 _ space)."},"content":{"type":"string"},"status":{"type":"string","description":"Template status (e.g., for_review, approved)."}},"required":["id","name","sender","content","status"]},"OperationError":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}}},"paths":{"/v1.0/sms/template/{id}":{"put":{"tags":["Template"],"summary":"Update","description":"Update an existing template.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"},"description":"Template id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitRequest"}}}},"responses":{"200":{"description":"Updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationError"}}}},"401":{"description":"Unauthorized (missing/invalid API key)"},"404":{"description":"Template not found"},"500":{"description":"Failed to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationError"}}}}}}}}}
```

## DELETE /v1.0/sms/template/{id}

> Delete

```json
{"openapi":"3.0.3","info":{"title":"SMS Template API","version":"1.0.0"},"servers":[{"url":"https://messaging-api.bind.hr","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY","description":"API key header."}},"schemas":{"DeleteResponse":{"type":"object","properties":{"success":{"type":"boolean"},"item":{"$ref":"#/components/schemas/TemplateBase"}},"required":["success","item"]},"TemplateBase":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"sender":{"type":"string","description":"Sender ID. Numeric 4-15 digits or alphanumeric up to 11 chars (A-Z a-z 0-9 _ space)."},"content":{"type":"string"},"status":{"type":"string","description":"Template status (e.g., for_review, approved)."}},"required":["id","name","sender","content","status"]}}},"paths":{"/v1.0/sms/template/{id}":{"delete":{"tags":["Template"],"summary":"Delete","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"},"description":"Template id"}],"responses":{"200":{"description":"Deleted (soft) successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}}},"401":{"description":"Unauthorized (missing/invalid API key)"},"404":{"description":"Template not found / already deleted"},"500":{"description":"Failed to delete"}}}}}}
```
