This document provides information about the REST API endpoints, including request methods, parameters, and response formats.
All endpoints are relative to the base URL:
<https://api.getmagicpush.com/api/v1/rest/>
Authentication is required for all endpoints. Use your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Endpoint: /send
Method: POST
Description: Create a new item.
Request Body:
recipients (string array, optional): A list of user hashes.title (string, optional): Notification title.message (string, optional): Notification message.action (string, optional): URL or Activity name to open.Response:
201 Created: Notification successfully queued.400 Bad Request: Invalid input parameters.curl --location '<https://api.getmagicpush.com/api/v1/rest/send>' \
--data '{
"recipients": ["582159ef-d279-..."],
"title": "test",
"message": "hello world",
"action": "<https://getmagicpush.com>"
}'
Errors are returned using standard HTTP error codes. The response body includes a message field with a description of the error.
Endpoint: /users/<app_user_hash>/values
Method: POST
Description: Update a user value to use in Yes/No statement in flow.
Request Body:
key (string, required): the key.value (string, required): the value.Response:
200 Created: Key value successfully saved.400 Bad Request: Invalid input parameters.curl --location '<https://api.getmagicpush.com/api/v1/rest/users/><app_user_hash>/values' \
--data '{
"key": "has_pro_subscription",
"value": "true"
}'
Endpoint: /users/<app_user_hash>/events
Method: POST
Description: Trigger an event so notification flow can be activated for user.
Request Body:
event (string, required): name of the event as setup in the flow.Response:
200 Created: Event successfully triggered.400 Bad Request: Invalid input parameters.curl --location '<https://api.getmagicpush.com/api/v1/rest/users/><app_user_hash>/events' \
--data '{
"event": "signed_up"
}'