Retrieve a list of templates
Fetch a list of templates with optional filters like prefix, public, unpublished, and pagination using limit and next token.
GET
Parameters
Query Parameters
Id
Filter resources by their unique identifier
Limit
How many items to return at one time (max 100)
Next
Pagination token for retrieving the next page of results
Autocomplete
Search term for autocomplete functionality
Order
Sort order for the results (ascending or descending)
SortBy
Field name to sort the results by
Language
language of the template
System
Filter templates that are publicly accessible.
Type
Filter unpublished templates.
When_created[$gt]
When_created[$lt]
When_created[$gte]
When_created[$lte]
| Status code | Description |
|---|---|
| 200 | A list of templates and the next pagination token. |
| 400 | Bad request error - the request contains invalid parameters or malformed data |
| 500 | Internal server error - an unexpected error occurred on the server |
cURL
curl -L \"https://blockv-labs.io/messages/templates?id={id}&limit={limit}&next={next}&autocomplete={autocomplete}&order={order}&sortBy={sortBy}&language={language}&system={system}&type={type}&when_created[$gt]={when_created[$gt]}&when_created[$lt]={when_created[$lt]}&when_created[$gte]={when_created[$gte]}&when_created[$lte]={when_created[$lte]}" \-H 'Accept: application/json'
Response
{"templates": [{"id": "string","name": "string","language": "en","system": "email","action_type": "register","title": "string","project": "string","content": "string","content_type": "text","when_modified": "2024-01-01T00:00:00Z","when_created": "2024-01-01T00:00:00Z"}],"next": "string"}
json
{"type": "object","required": ["templates"],"properties": {"templates": {"type": "array","description": "Array of template objects.","items": {"type": "object","required": ["id","org_id","name","language","system","action_type","content","content_type","when_modified","when_created"],"properties": {"id": {"type": "string","x-oapi-codegen-extra-tags": {"bson": "_id","json": "id"},"x-go-type": "id.ID","x-go-type-import": {"path": "github.com/vlabsio/smarttoken/pkg/types/id"}},"name": {"type": "string","x-oapi-codegen-extra-tags": {"bson": "name"},"x-go-type-skip-optional-pointer": true},"language": {"type": "string","enum": ["en","es","fr","de","it","pt","ru"],"x-oapi-codegen-extra-tags": {"bson": "language,omitempty","form": "language","validate": "omitempty,oneof=en es fr de it pt ru"}},"system": {"type": "string","enum": ["email","sms","push"],"x-oapi-codegen-extra-tags": {"bson": "system,omitempty"}},"action_type": {"type": "string","enum": ["register","login","reset","verify","otp","org_invite","custom","internal"],"x-oapi-codegen-extra-tags": {"bson": "action_type,omitempty","validate": "omitempty"}},"title": {"type": "string","x-oapi-codegen-extra-tags": {"bson": "title,omitempty"},"x-go-type-skip-optional-pointer": true},"project": {"type": "string","x-oapi-codegen-extra-tags": {"bson": "project,omitempty"}},"content": {"type": "string","x-oapi-codegen-extra-tags": {"bson": "content,omitempty"}},"content_type": {"type": "string","enum": ["text","html"],"x-oapi-codegen-extra-tags": {"bson": "content_type,omitempty"}},"values": {"type": "object","additionalProperties": {"type": "string"},"x-oapi-codegen-extra-tags": {"bson": "values,omitempty"},"x-go-type-skip-optional-pointer": true},"when_modified": {"type": "string","format": "date-time","x-oapi-codegen-extra-tags": {"bson": "when_modified,omitempty"}},"when_created": {"type": "string","format": "date-time","x-oapi-codegen-extra-tags": {"bson": "when_created,omitempty"}}}}},"next": {"type": "string","description": "Pagination token for the next set of results, if any.","x-go-type-skip-optional-pointer": true}}}