PHPackages                             ocolin/pushover - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ocolin/pushover

ActiveLibrary[API Development](/categories/api)

ocolin/pushover
===============

PHP client for Pushover API

2.7(4mo ago)09MITPHPPHP ^8.2

Since Nov 4Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/ocolin/Pushover)[ Packagist](https://packagist.org/packages/ocolin/pushover)[ Docs](https://github.com/ocolin/Pushover)[ RSS](/packages/ocolin-pushover/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (11)Used By (0)

Description
===========

[](#description)

A PHP client for Pushover API. This is a work in progress, adding testing as endpoints are used and time allows. Each endpoint is labeled whether it has been tested yet or not in this document.

Installation
------------

[](#installation)

Easily install using composer.

```
composer require ocolin/pushover

```

Environment Variables
---------------------

[](#environment-variables)

There is an environment variable that can be used instead of as an argument when instantiating a new Client object. See .env.example file.

```
- $_ENV['PUSHOVER_API_TOKEN'] - API Authentication token.

```

Instantiating an API client.
----------------------------

[](#instantiating-an-api-client)

### Required Arguments

[](#required-arguments)

- token - API authentication token. Defaults to environment variable.

### Optional arguments

[](#optional-arguments)

- format - Output format JSON or XML. Defaults to JSON.
- verify - Verify SSL connection to API server. Defaults to true.
- timeout - Set HTTP timeout. Defaults to 20 seconds.

### Example - Using only environment variables

[](#example---using-only-environment-variables)

```
$_ENV['PUSHOVER_API_TOKEN'] = 'yourauthtokenhere';

$client = new Ocolin\Pushover\Client();
```

### Example - Using constructor arguments

[](#example---using-constructor-arguments)

```
$client = new Ocolin\Pushover\Client(
      token: 'yourauthtokenhere',
     format: 'json',
     verify: true,
    timeout: 20
);
```

APIS
----

[](#apis)

There are multiple Pushover APIs each with their own end points. It uses the follwing format:

```
{client}->{api}->{endpoint}({arguments})

```

### TOC

[](#toc)

- [Message](#Message)
- [Groups](#Groups)
- [Receipts](#Receipts)
- [Apps](#Apps)
- [Devices](#Devices)
- [Glances](#Glances)
- [Licenses](#Licenses)
- [Subscriptions](#Subscriptions)
- [Teams](#Teams)
- [Sounds](#Sounds)

### Message

[](#message)

#### Push (Tested)

[](#push-tested)

```
$output = $client->message->push(
       user: 'kjhs6fjhk2jhsf19hj',
    message: 'This is a message body',
     params: [ 'title' => 'This is a title' ]
);
```

Optional parameters:

- attachment - a binary image attachment to send with the message (documentation)
- attachment\_base64 - a Base64-encoded image attachment to send with the message (documentation)
- attachment\_type - the MIME type of the included attachment or attachment\_base64 (documentation)
- device - the name of one of your devices to send just to that device instead of all devices (documentation)
- html - set to 1 to enable HTML parsing (documentation)
- priority - a value of -2, -1, 0 (default), 1, or 2 (documentation)
- sound - the name of a supported sound to override your default sound choice (documentation)
- timestamp - a Unix timestamp of a time to display instead of when our API received it (documentation)
- title - your message's title, otherwise your app's name is used
- ttl - a number of seconds that the message will live, before being deleted automatically (documentation)
- url - a supplementary URL to show with your message (documentation)
- url\_title - a title for the URL specified as the url parameter, otherwise just the URL is shown (documentation)
- retry - For priority 2 messages, this is required. How many seconds between resending alerts.
- expire - For priority 2 messages, this is required. How many seconds until the emergency stops alerting.
-

#### Get (Untested)

[](#get-untested)

```
$output = $client->message->get(
    secret: 'KJHd7hsjqk3jh',
    device_id: 'kljshdf62j10'
);
```

### Groups

[](#groups)

#### Create (Tested)

[](#create-tested)

Create a new group. Key will be provided in response.

Parameters:

- name (required) - the group's name

```
$output = $client->groups->create(
    name: 'MyGroup'
);
```

#### Groups (Tested)

[](#groups-tested)

Fetch a list of groups.

```
$output = $client->groups->groups();
```

#### Get (Tested)

[](#get-tested)

Get information on a group, including users in it.

Parameters:

- group - (Required) Key of group to query.

```
$output = $client->groups->get( group: 'kjhJHf7hJh72jh' );
```

#### Add User (Tested)

[](#add-user-tested)

Add a user to a group.

Parameters:

- group (required) - Key of group to add user to
- user (required) - The user's Pushover user key
- device (optional) A user's device name to restrict messages to that device, otherwise leave blank to send messages to all devices of that user
- memo (optional) A free-text memo used to associate data with the user such as their name or e-mail address, viewable through the API and the groups editor on our website (limited to 200 characters)

```
$output = $client->groups->addUser(
    group: 'KJHjhdfkjsd',
     user: 'gRhdnml6gsji8df'
);
```

#### Remove User (Tested)

[](#remove-user-tested)

Remove a user from a group.

Parameters:

- group (required) - Key of group to add user to
- user (required) - the user's Pushover user key
- device (optional) - the device name to match for the user's group membership; if left blank, all users with the matching user key will be removed

```
$output = $client->groups->removeUser(
    group: 'KJHjhdfkjsd',
     user: 'gRhdnml6gsji8df'
);
```

#### Disable User (Tested)

[](#disable-user-tested)

Disable a user in a group.

Parameters:

- group (required) - Key of group to disable user in
- user (required) - the user's Pushover user key
- device (optional) - the device name to match for the user's group membership; if left blank, all users with the matching user key will be disabled

```
$output = $client->groups->disableUser(
    group: 'KJHjhdfkjsd',
     user: 'gRhdnml6gsji8df'
);
```

#### Enable User (Tested)

[](#enable-user-tested)

Enable a user in a group.

Parameters:

- group (required) - Key of group to enable user in
- user (required) - the user's Pushover user key
- device (optional) - the device name to match for the user's group membership; if left blank, all users with the matching user key will be enabled

```
$output = $client->groups->enableUser(
    group: 'KJHjhdfkjsd',
     user: 'gRhdnml6gsji8df'
);
```

#### Rename (Tested)

[](#rename-tested)

Change the name of a gorup.

Parameters:

- group (required) Key of group to modify
- name (required) New name of group

```
$output = $client->groups->rename(
    group: 'KJHjhdfkjsd',
     name: 'New Name'
);
```

### Receipts

[](#receipts)

#### Get (Tested)

[](#get-tested-1)

```
$output = $client->receipts->get( receipt: 'JKHk1262jhfs' );
```

#### Cancel (Tested)

[](#cancel-tested)

An emergency-priority notification will continue to be sent to devices until it reaches its original expire value. To cancel an emergency-priority notification early, you can send a POST request to our API.

```
$output = $client->receipts->cancel( receipt: 'JKHk1262jhfs' );
```

#### Cancel by tag (Tested)

[](#cancel-by-tag-tested)

```
$output = $client->receipts->cancelByTag( tag: 'MyTag' );
```

#### Acknowledge (Untested)

[](#acknowledge-untested)

```
$output = $client->receipts->acknowledge(
    receipt: 'KJHd7hsjqk3jh',
    secret: 'JKHk1262jhfs'
);
```

### Apps

[](#apps)

#### Limits (Tested)

[](#limits-tested)

Get API limit information.

```
$output = $client->apps->limits();
```

### Devices

[](#devices)

#### Register (Untested)

[](#register-untested)

```
$output = $client->devices->register(
    secret: 'jhdD87hKjhd8h',
      name: 'My device',
        os: 'O'
);
```

#### Delete (Untested)

[](#delete-untested)

```
$output = $client->devices->delete(
    device_id: 'lkjskdjsdf',
       secret: 'sdfgsdfgdf',
      message: 2
);
```

### Glances

[](#glances)

#### Update (Untested)

[](#update-untested)

Update your widget.

Parameters:

- user (required) - the user's Pushover user key
- device (optional) a user's device name to restrict messages to the widget on that device, otherwise leave blank to send messages to all available widgets of that user

Updatable fields:

- title (100 characters) - a description of the data being shown, such as "Widgets Sold"
- text (100 characters) - the main line of data, used on most screens
- subtext (100 characters) - a second line of data
- count (integer, may be negative) - shown on smaller screens; useful for simple counts
- percent (integer 0 through 100, inclusive) - shown on some screens as a progress bar/circle

```
$output = $client->glances->update(
    user: 'KJHjdk8h9dsf',
    params: [ 'text' => 'Message to widget' ]
);
```

### Licenses

[](#licenses)

#### Assign (Untested)

[](#assign-untested)

```
$output = $client->licenses->assign(
    email: 'test@email.com'
);
```

#### Check (Tested)

[](#check-tested)

```
$output = $client->licenses->check();
```

### Subscriptions

[](#subscriptions)

#### Migrate (Untested)

[](#migrate-untested)

```
$output = $client->subscriptions->migrate(
    subscription: 'kjh234jhf8',
            user: 'VB2bc34nfgg'
);
```

Parameters:

- subscription (required) - your subscription's code
- user (required) - the user's Pushover user key
- device\_name (optional) - a user's device name that the subscription should be limited to
- sound (optional) - a user's preferred default sound

### Teams

[](#teams)

#### Show (Tested)

[](#show-tested)

```
$output = $client->teams->show( team: 'kjh234he8hhj' );
```

#### Add User (Untested)

[](#add-user-untested)

Add a user to your team.

Parameters:

- email (required) - the user's e-mail address
- name (optional) - the user's full name
- password (optional) the user's password if assigning one to the user which will not be e-mailed; if not included or left blank, a random password will be assigned to the user and e-mailed to them (in cleartext)
- instant (optional) a string value of true will include an Instant Login link in the initial welcome e-mail to the user; Instant Login links allow the user to optionally download the Pushover app and then login to their new account without entering any credentials, and links are valid for 7 days
- admin (optional) a string value of true will add this user to the team as an administrator
- group (optional) by default, all users are added to your auto-updating Team Delivery Group; to add this user to another Delivery Group, put the group's name in this field (if the group does not exist, it will be created)

```
$output = $client->teams->add(
    email: 'test@test.com',
    params: [
        'password' => 'MyPassword'
    ]
);
```

#### Remove User (Untested)

[](#remove-user-untested)

Remove a user from a team.

Parameters:

- email (required) - the user's e-mail address

```
$output = $client->teams->remove(
    email: 'test@test.com'
);
```

### Users

[](#users)

#### Validate (Tested)

[](#validate-tested)

As an optional step in collecting user keys for users of your application, you may validate those keys to ensure that a user has copied them properly, that the account is valid, and that there is at least one active device on the account.

```
$output = $client->users->validate();
```

#### Login

[](#login)

```
$output = $client->users->login(
    email: 'test@test.com',
    password: 'mypassword123'
);
```

### Sounds

[](#sounds)

#### List (Tested)

[](#list-tested)

List available alert sounds.

```
$output = $client->sounds->list();
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance76

Regular maintenance activity

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~47 days

Recently: every ~6 days

Total

10

Last Release

132d ago

Major Versions

1.1 → 2.02025-12-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/e97ac0aa452b872ddc3f7f4c56c83852574a27bb74622f8c054d11ca20008fc9?d=identicon)[Ocolin](/maintainers/Ocolin)

---

Top Contributors

[![ocolin](https://avatars.githubusercontent.com/u/8870196?v=4)](https://github.com/ocolin "ocolin (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ocolin-pushover/health.svg)

```
[![Health](https://phpackages.com/badges/ocolin-pushover/health.svg)](https://phpackages.com/packages/ocolin-pushover)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
