GET
/
templates?app_id=
{app_id}
&limit=
{limit}
&offset=
{offset}
curl --request GET \
  --url 'https://api.onesignal.com/templates?app_id={app_id}&limit={limit}&offset={offset}' \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>'
"{\n    \"limit\": 50,\n    \"offset\": 0,\n    \"templates\": [\n        {\n            \"id\": \"9e778dd4-6453-40d7-888d-9d9f327b9b66\",\n            \"name\": \"OneSignal Push: New Feature Announcement (Template)\",\n            \"created_at\": \"2021-07-23T18:02:23.956Z\",\n            \"updated_at\": \"2021-07-23T18:02:23.956Z\"\n        },\n        {\n            \"id\": \"806b4356-67af-4d33-8133-75e502f6d3b7\",\n            \"name\": \"OneSignal Push: User Action Notification (Template)\",\n            \"created_at\": \"2021-07-23T18:02:23.963Z\",\n            \"updated_at\": \"2021-07-23T18:02:23.963Z\"\n        },\n        {\n            \"id\": \"172f55b5-df07-49ae-8a8d-67037679487f\",\n            \"name\": \"OneSignal Push: Rating (Template)\",\n            \"created_at\": \"2021-07-23T18:02:23.984Z\",\n            \"updated_at\": \"2021-07-23T18:02:23.984Z\"\n        }\n    ],\n    \"total_count\": 3\n}"

Overview

Use this endpoint to retrieve a list of message templates associated with a specific OneSignal app. The response provides summary information only:

  • template_id
  • name
  • created_at
  • updated_at

This endpoint does not return full template content such as message bodies, channel properties, or delivery configuration. For detailed template data, use the View Template endpoint.


How to Use This API

Required Parameters

  • app_id (query param): The OneSignal App ID whose templates you want to retrieve.

Optional Parameters

  • limit (query param): Number of templates to return (default: 50, maximum: 50).
  • offset (query param): Number of templates to skip. Use for pagination.

Pagination Example

If your app has 125 templates and you’re using the default limit of 50:

  1. First request (first 50 templates):
    GET /templates?app_id={app_id}&offset=0

  2. Second request (next 50 templates):
    GET /templates?app_id={app_id}&offset=50

  3. Third request (final 25 templates):
    GET /templates?app_id={app_id}&offset=100

Repeat the request while adjusting the offset until you’ve retrieved all templates.


Headers

Authorization
string
default:Key YOUR_APP_API_KEY
required

Your App API key with prefix Key. See Keys & IDs.

Content-Type
string
default:application/json; charset=utf-8
required

Query Parameters

app_id
string
default:YOUR_APP_ID
required

Your OneSignal App ID in UUID v4 format. See Keys & IDs.

limit
integer
default:50

The maximum number of templates returned per request. The default (if omitted) and maximum is 50 templates per request.

offset
integer
default:0

The pagination or "starting point" of the templates to be returned. Setting it to 0 with a limit of 50 will retrieve the first 50 templates. Increasing the offset by 50 will return the next set of templates, and so on.

channel
enum<string>

Filter the fetched templates by the delivery channel. Available options are: push, email, and SMS.

Available options:
push,
email,
sms

Response

200
application/json

200

The response is of type object.