Skip to main content

Push Approver - Approve or Reject Message

Endpoint

/i/push/approve

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Approves or rejects a push message that is waiting for approver action.

Authentication

Authentication methods:

  • API Key (parameter): api_key=YOUR_API_KEY
  • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Push Approver: Update permission on the Push feature.
  • Caller must also be an approver (member.approver = true).

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
_idString (ObjectID)YesPush message ID
approveBoolean StringYestrue to approve, false to reject

Response

Success Response

{
"_id": "67b9c2e2f67aab0012cd3456",
"app": "6991c75b024cb89cdc04efd2",
"status": "active",
"info": {
"createdBy": "67b9c1a8f67aab0012cd1234",
"approved": "2026-02-15T14:20:12.151Z",
"approvedBy": "67b9c1fdf67aab0012cd2345",
"approvedByName": "Approver User"
}
}

Response Fields

FieldTypeDescription
_idStringPush message ID
appStringApp ID attached to the message
statusStringactive when approved, rejected when rejected
infoObjectMessage metadata including approver/rejector details

Error Responses

  • HTTP 400 - Validation failure or permission issue:
{
"errors": [
"You're not an approver"
]
}
  • HTTP 400 - Already approved:
{
"errors": [
"The message has been already approved"
]
}
  • HTTP 404 - Message not found:
{
"errors": [
"No such message"
]
}

Behavior/Processing

  • Validates _id and approve with common.validateArgs(...).
  • Rejects self-approval/rejection attempts by message creator.
  • On approve: updates message status to active, writes approver metadata, then schedules eligible message sending.
  • On reject: updates message status to rejected, writes rejector metadata, and notifies creator by email.

Database Collections

CollectionUsed forData touched by this endpoint
countly.messagesPush/message recordsStores message lifecycle and approval/scheduling state used by this endpoint.
countly.membersMember/account enrichmentStores member profile fields (for example names/IDs) used to resolve actor metadata.

Examples

/i/push/approve?api_key=YOUR_API_KEY&_id=67b9c2e2f67aab0012cd3456&approve=true
/i/push/approve?api_key=YOUR_API_KEY&_id=67b9c2e2f67aab0012cd3456&approve=false

Ⓔ Enterprise

This feature is part of Countly Enterprise.

Get Access:

Already a Customer? Use support portal if you have any questions.


Last Updated

2026-02-16