# Pushbullet API

Pushbullet's API enables developers to build on the Pushbullet infrastructure. Our goal is to provide a full API that enables anything to tap into the Pushbullet network.
This is important to us because we believe everything, not just smartphones and computers, should be able to exchange information in real time. Here are some of the things you can build with Pushbullet:

- Have a website and want to offer push notifications? We've built everything you need.
- Want to build a Pushbullet client for a platform we don't officially support yet? Everything you need is here.
- Working on a home automation system? Pushbullet can get everything chatting.
- Working with sensors and want to send messages to another device? Pushbullet is just what you need.
- Manage IT/servers and want to get updates and alerts no matter where you are or what device you're using? Pushbullet makes it easy.

Check out this ProgrammableWeb article for a longer introduction to Pushbullet and this API.

### Sections

- API - Send/receive pushes using the Pushbullet server.
- iPhone Extensions - Interact with the iPhone app from your app or webpage.
- Changelog - Recent changes to the API.

### Problems/Feedback

If you have questions, feel free to post them to the pushbullet tag on Stack Overflow. We monitor this tag and will reply as quickly as we can.
For everything else (including incorrect things or suggested changes to these docs) feel free to contact us at [email protected]
.

# API Quick Start

All of our examples use the curl command line tool already available on most systems.

- If you use Mac, it should already be installed, just open the Terminal app and run it.
- If you are using Linux, it should already be installed, just open the Console and run it.
- On Windows you're going to have to download it here or from the curl download page.

The Pushbullet API lets you send/receive pushes and do everything else the official Pushbullet clients can do. To access the API you'll need an access token so the server knows who you are. You can get one from your Account Settings page.
Once you have that access token, you can use it to access your Pushbullet account using the Pushbullet API:

######
Example: Get Current User

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         https://api.pushbullet.com/v2/users/me

Response

    {
      "created": 1.381092887398433e+09,
      "email": "[email protected]",
      "email_normalized": "[email protected]",
      "iden": "ujpah72o0",
      "image_url": "https://static.pushbullet.com/missing-image/55a7dc-45",
      "max_upload_size": 2.62144e+07,
      "modified": 1.441054560741007e+09,
      "name": "Elon Musk"
    }

# API Overview

## Requests

The API accepts requests over HTTPS at https://api.pushbullet.com. All POST requests must use a JSON body with the Content-Type header set to application/json. Most programming languages have some way to encoded objects to JSON, and using the built-in library is recommended, since it will correctly handle newline characters and quotes.

#### Authentication

To authenticate for the API, use your access token in a header like Access-Token: <your_access_token_here>. Your access token can be found on the Account Settings page. Keep in mind that this key has full access to your account, so don't go posting it all over the internets.
If you are making an app that uses the Pushbullet API on behalf of another user (for instance, to send push notifications as that user), use OAuth to get an access token for that user. Using your own access token while developing though saves you from having to setup OAuth until later.
You can make a request from any app, though how you do that may depend on if you are writing a script or using a programming language. If you have a terminal and the curl utility you can perform requests from the command line.

######
Example: Get Current User

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         https://api.pushbullet.com/v2/users/me

Response

    {
      "created": 1.381092887398433e+09,
      "email": "[email protected]",
      "email_normalized": "[email protected]",
      "iden": "ujpah72o0",
      "image_url": "https://static.pushbullet.com/missing-image/55a7dc-45",
      "max_upload_size": 2.62144e+07,
      "modified": 1.441054560741007e+09,
      "name": "Elon Musk"
    }

Because we allow CORS requests, you can make a request from any browser (you can hit the run button or copy and paste this code into your javascript console):

## Responses

Responses are always JSON. Keys are either present with a non-empty value, or entirely absent from the response. Empty values are: null, false, "", [], and {}. Deleted objects will only have the keys iden, active, created, and modified because all other properties have been removed and are now empty values.

###### Example: API Response

    {
      "created": 1.35794175382879e+09,
      "email": "[email protected]",
      "email_normalized": "[email protected]",
      "iden": "ujpah72o0sjAoRtnM0jc",
      "modified": 1.39932599218423e+09
    }

#### HTTP Status Codes

- 200 OK - Everything worked as expected.
- 400 Bad Request - Usually this results from missing a required parameter.
- 401 Unauthorized - No valid access token provided.
- 403 Forbidden - The access token is not valid for that request.
- 404 Not Found - The requested item doesn't exist.
- 429 Too Many Requests - You have been ratelimited for making too many requests to the server.
- 5XX Server Error - Something went wrong on Pushbullet's side. If this error is from an intermediate server, it may not be valid JSON.

#### Errors

Error responses (any non-200 error code) contain information on the kind of error that happened. The response JSON will have an error property with the following fields:

- type - A machine-readable code to refer to this type of error. Either invalid_request for client side errors or server for server side errors.
- message - A (mostly) human-readable error message.
- param - (OPTIONAL) Appears sometimes during an invalid_request error to say which parameter in the request caused the error.
- cat - Some sort of ASCII cat to offset the pain of receiving an error message.

###### Example: Error Response

    {
      "error": {
        "cat": "~(=^‥^)",
        "message": "The resource could not be found.",
        "type": "invalid_request"
      }
    }

Errors from the Pushbullet server will have this JSON body. Errors from intermediate servers or the hosting infrastructure may not, so you should be able to handle a non-JSON response as a generic error.

## Objects

Objects (such as pushes and devices) can be created, modified, listed and deleted.
All timestamps that appear on objects are floating point seconds since the epoch, also called Unix Time.
All calls to list objects (list-*) accept the active, limit, and cursor parameters.

#### Bootstrapping

By default, listing objects of any type will return deleted objects (this is useful for syncing). When you are getting the initial list of objects, you may want to only fetch the active ones. To get only active objects, set active to true on the request.

#### Pagination

When listing objects, if you receive a cursor in the response, it means the results are on multiple pages. To request the next page of results, use this cursor as the parameter cursor in the next request. Any time you list a collection of objects, they may be multiple pages (objects are always returned with the most recent ones first). You can specify a limit parameter on any calls that return a list of objects to get a smaller number of objects on each page. The default (maximum) limit is 500, including deleted objects.

#### Syncing Changes

All calls to list objects accept a modified_after property (a timestamp). Any objects modified since that time will be returned, most recently modified first. The modified_after parameter should be the most recent modified value from an object returned by the server (don't trust the local machine's timestamp as it usually is not the same value as the server).

#### Deleted Objects

When you query with a modified_after timestamp to sync changed objects to a device, you need to know if an object was deleted so you can remove it locally. Deleted objects will have active=false and all properties except for iden, created, modified, and active will be missing from the returned object. Deleted objects show up by default when listing objects.

#### Resizing Images

Pushes have an image_url property that can be resized by setting query parameters. To use this, add =s<pixels> to the end of the url.

###### Example: Resize an Image

Resize the image so that the longest side is not longer than 100 pixels
Before
https://lh3.googleusercontent.com/kR7yrU5ioduH9D0LGM1qr6GAPxFv6gybYmIvQwxwhvIkDj_hJA1GrwP4pqOn5wW5Hawp-kvNGWEHch4AAo6aiUGcug
After
https://lh3.googleusercontent.com/kR7yrU5ioduH9D0LGM1qr6GAPxFv6gybYmIvQwxwhvIkDj_hJA1GrwP4pqOn5wW5Hawp-kvNGWEHch4AAo6aiUGcug=s100
The image_url should be hosted on domain ending with .googleusercontent.com. If the domain does not end with that, you should not attempt to resize the image with a query parameter. Objects besides pushes have an image_url property but they cannot necessarily be resized the same way.

### Backwards Compatibility

We try to make only backwards compatible changes to existing public API calls. This means that we should not change the meaning of existing calls, and that we will only add, not remove, keys from objects returned from the API. Adding a key is considered to be a backwards-compatible change.

### Ratelimiting

When you do a request to the API you will receive headers like the following on the response:

    X-Ratelimit-Limit: 32768
    X-Ratelimit-Remaining: 32765
    X-Ratelimit-Reset: 1432447070

These tell you what the ratelimit is, how much you have remaining and when it resets (integer seconds in Unix Time). The units are a sort of generic 'cost' number. A request costs 1 and a database operation costs 4. So reading 500 pushes costs about 500 database operations + 1 request = 500*4 + 1 = 2001. You can see how much a request cost by the change in X-Ratelimit-Remaining between two requests.

# Guides

## OAuth2

### Overview

OAuth lets you access a user's Pushbullet account or have them authenticate with their Pushbullet account using a browser.
OAuth is a standard authentication procedure used by most websites, here's how it works:

1. You, the app developer, register your app (called an "OAuth client") with Pushbullet
2. Using a url you generate in your app (you can see an example one on the Create Client page) you send the user to the Pushbullet site. One of the parameters of the url is a redirect url that the user will be sent to when they are done authorizing your app.
3. The user authorizes your application by clicking the "Allow" button.
4. The user is redirected to the redirect url you provided earlier, which is generally your site or your app.

Here's roughly how this looks with pictures:

### Getting Started

To get started, create a client (register your application) on the Create Client page. For the examples on this page, the client looks like this:

##### EXAMPLE CLIENT

    {
      "client_id": "YW7uItOzxPFx8vJ4",
      "client_secret": "MmA98EDg0pjr4fZw",
      "iden": "ujpah72o0sjAoRtnM0jc",
      "image_url": "http://www.catpusher.com/logo.png",
      "name": "Cat Pusher",
      "redirect_uri": "http://www.catpusher.com/auth_complete",
      "website_url": "http://www.catpusher.com"
    }

### Getting an Access Token

Once you've created a client, you can send a user to https://www.pushbullet.com/authorize with the following parameters:

- client_id - client_id from registering your client
- redirect_uri - The url you want to redirect the user to after authorization is complete. The path portion must match what was provided for the client, the query string may be set dynamically.
- response_type - Either "code" (if you've got a server) or "token" (if your app is entirely on the client)

##### EXAMPLE URL

    https://www.pushbullet.com/authorize?client_id=YW7uItOzxPFx8vJ4&redirect_uri=http%3A%2F%2Fwww.catpusher.com%2Fauth_complete&response_type=code

NOTE: There's an example url ("oauth test url") on the Create Client page for your app.
When the user is sent to this page, they are able to authorize or deny your application. If they choose deny, they get redirected to the redirect_uri with the parameter "error=access_denied".
If they chose authorize, there are two possible next steps, depending on the value of response_type:

#### For Client-Side Apps: response_type=token

The user is redirected to the redirect_uri with a url fragment of "access_token=<access_token>". If you have a client side app running an embedded web browser, you can configure your redirect_uri to be "https://www.pushbullet.com/login-success" and then use this redirect_uri in the authorize call.

##### EXAMPLE URL

    https://www.pushbullet.com/authorize?client_id=YW7uItOzxPFx8vJ4&redirect_uri=https%3A%2F%2Fwww.pushbullet.com%2Flogin-success&response_type=token

##### EXAMPLE REDIRECT

    https://www.pushbullet.com/login-success#access_token=o.RUe7IZgC6384GrI1

#### For Apps with Servers: response_type=code

If you have a server you can use this response_type, it's potentially more secure than the client-side one, since the client never sees the actual access token. In this mode the user is redirected to the redirect_uri with a parameter "code=<code>".

##### EXAMPLE URL

    https://www.pushbullet.com/authorize?client_id=YW7uItOzxPFx8vJ4&redirect_uri=http%3A%2F%2Fwww.catpusher.com%2Fauth_complete&response_type=code

##### EXAMPLE REDIRECT

    http://www.catpusher.com/auth_complete?code=RUe7IZgC6384GrI1

Your server then peforms a POST request to https://api.pushbullet.com/oauth2/token with the following parameters:

- grant_type - Set to "authorization_code"
- client_id - client_id from registering your client
- client_secret - client_secret from registering your client
- code - code from the redirect

######
Example: Convert Code to Access Token

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"client_id":"YW7uItOzxPFx8vJ4","client_secret":"MmA98EDg0pjr4fZw","code":"RUe7IZgC6384GrI1","grant_type":"authorization_code"}' \
         --request POST \
         https://api.pushbullet.com/oauth2/token

Response

    {
      "access_token": "a6FJVAA0LVJKrT8k",
      "token_type": "Bearer"
    }

You can add extra query params to the end of redirect_uri if you need to store extra state for the request. For instance, if you have your client's redirect_uri set to http://www.catpusher.com/auth_complete, then when you build the url to send the user to Pushbullet, you could specify redirect_uri=http://www.catpusher.com/auth_complete?state=zhk2KJ3SAAS3q1. When the user finishes authorizing your app, they would end up at http://www.catpusher.com/auth_complete?state=zhk2KJ3SAAS3q1&code=RUe7IZgC6384GrI1.

### Using Your Access Token

Now that you have an access token, you can access Pushbullet as that user. Just include the access_token with your requests as the username in HTTP Basic Auth or set the Access-Token header to your access_token. Make sure to keep the access_token in a safe place, it allows access to your users accounts!

######
Example: Get Current User

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         https://api.pushbullet.com/v2/users/me

Response

    {
      "created": 1.381092887398433e+09,
      "email": "[email protected]",
      "email_normalized": "[email protected]",
      "iden": "ujpah72o0",
      "image_url": "https://static.pushbullet.com/missing-image/55a7dc-45",
      "max_upload_size": 2.62144e+07,
      "modified": 1.441054560741007e+09,
      "name": "Elon Musk"
    }

The access_token does not have a set expiration time, but may be expired at some point in the future. If you delete your client, all existing tokens are invalidated.

## End-to-End Encryption

We support end-to-end encryption for Notification Mirroring, Universal Copy & Paste, and SMS. We use client-side symmetric encryption for this. No keys are ever sent to the server, not even public keys, which is especially nice from a security standpoint.
The encryption is used primarily for ephemerals. If you enable it in your Pushbullet client, you should be able to see the encrypted messages on the stream whenever you use any of the features that support end-to-end encryption.

#### Key Generation

The key is created from a user-supplied password and passed through PBKDF2:

- Pseudorandom function: HMAC-SHA256
- Password: password supplied by the user for encryption, must be the same on all Pushbullet devices owned by the user
- Salt: the user iden for the current user, e.g. up0snaKOsn
- Number of iterations: 30,000
- Derived key length: 256-bit

###### Code Sample: Generate an Encryption/Decryption Key

This example uses the javascript Forge library

    var pseudorandom_function = forge.md.sha256.create();
    var password = "hunter2";
    var salt = "up0snaKOsn";
    var iterations = 30000;
    var derived_key_length_bytes = 32; // 256-bit
    var key = forge.pkcs5.pbkdf2(
      password,
      salt,
      iterations,
      derived_key_length_bytes,
      pseudorandom_function
    )
    // encode to base64 so we can easily print the key
    // (normally it's in binary and can't be printed)
    var base64_key = btoa(key);
    console.log("base64_key:", base64_key);

#### Encryption

To encrypt a message, use AES-256 with GCM Authentication. AES-256 uses the 256-bit key that is output by PBKDF2. To encrypt you need to generate a 96-bit initialization vector (this is used to start the encryption process, it is not a secret). The output of AES-256 with GCM will be the encrypted message (arbitrary length) and a 128-bit tag. The encoding for this encrypted message looks like this:

    encoded_message = "1" + tag + initialization_vector + encrypted_message

The 1 prefix is a version number indicating the version of the encoding. When encoded_message is put into JSON, it must be base64-encoded since JSON cannot handle binary data.

###### Code Sample: Encrypt a Message

This example uses the javascript Forge library

    // convert key from base64 to binary
    var key = atob("1sW28zp7CWv5TtGjlQpDHHG4Cbr9v36fG5o4f74LsKg=");
    var initialization_vector = forge.random.getBytes(12); // 96-bit
    var message = "meow!";

    var cipher = forge.cipher.createCipher('AES-GCM', key);
    cipher.start({"iv": initialization_vector});
    cipher.update(forge.util.createBuffer(forge.util.encodeUtf8(message)));
    cipher.finish();

    var tag = cipher.mode.tag.getBytes();
    var encrypted_message = cipher.output.getBytes();

    var encoded_message = "1" + tag + initialization_vector + encrypted_message;
    var base64_encoded_message = btoa(encoded_message);
    console.log("base64_encoded_message:", base64_encoded_message);

#### Decryption

If you can encrypt a message, decrypting it is straightforward. You need to decode the encoded_message into the tag, initialization_vector, and encrypted_message.

###### Code Sample: Decrypt an Encrypted Message

This example uses the javascript Forge library

    var key = atob("1sW28zp7CWv5TtGjlQpDHHG4Cbr9v36fG5o4f74LsKg=");
    var encoded_message = atob("MSfJxxY5YdjttlfUkCaKA57qU9SuCN8+ZhYg/xieI+lDnQ==");

    var version = encoded_message.substr(0, 1);
    var tag = encoded_message.substr(1, 16); // 128 bits
    var initialization_vector = encoded_message.substr(17, 12); // 96 bits
    var encrypted_message = encoded_message.substr(29);

    if (version != "1") {
      throw "invalid version"
    }

    var decipher = forge.cipher.createDecipher('AES-GCM', key);
    decipher.start({
        'iv': initialization_vector,
        'tag': tag
    });
    decipher.update(forge.util.createBuffer(encrypted_message));
    decipher.finish();

    var message = decipher.output.toString('utf8');
    console.log("message:", message);

Make sure your encryption library is checking the validity of the tag parameter by using an incorrect tag and verifying that you get some sort of error. You must also discard any encoded_message without a prefix of 1 as those will be different, incompatible encodings in the future.

#### Encrypted Ephemeral Format

An ephemeral that looks like this:

    {
      "push": {
        "data": {
          "key1": "value1",
          "key2": "value2"
        }
      },
      "type": "push"
    }

Will look like this when encrypted:

    {
      "push": {
        "ciphertext": "MXAdvN64uXWtLXCRaqYHEtGhiogR1VHyXX21Lpjp4jv3v+JWygMBA9Wp5npbQdfeZAgOZI+JT3y3pbmq+OrKXrK1rg==",
        "encrypted": true
      },
      "type": "push"
    }

Where ciphertext is the base64_encoded_message from the encryption example.
If you decode ciphertext then you will get the following javascript object:

    {
      "key1": "value1",
      "key2": "value2"
    }

# Realtime Event Stream

### Connect to the stream

You can connect to the websocket for an account by creating a secure websocket connection (wss://) to wss://stream.pushbullet.com/websocket/<your_access_token_here>
Live jsFiddle example
Once you are connected, you will see type="nop" messages periodically as well as other types if you send any ephemerals or pushes.

#### Stream Messages

All messages are JSON objects with a type key.

#### Types

- type="nop" - Sent every 30 seconds confirming the connection is active.
- type="tickle" - Tells you something has changed on the server. The subtype property tells you what has changed.
  - subtype="push" - A change to the /v2/pushes resources.
  - subtype="device" - A change to the /v2/devices resources.
- type="push" - A new push. The push data is available in an object from the push key. NOTE: This is only used for Ephemerals (such as mirrored notifications) not normal pushes (such as those you see with list-pushes). Normal pushes only generate tickles, not these messages.

##### EXAMPLE MESSAGES

    {
      "type": "nop"
    }

    {
      "subtype": "push",
      "type": "tickle"
    }

    {
      "push": {
        "cat": "meow"
      },
      "type": "push"
    }

#### Push message types

A message with type="push" will contain a data object mapped to by the key push. This object is documented here based on its internal type.

- type="mirror" - This push is a notification mirrored from an Android device.
- type="dismissal" - This push is a dismissal message for a notification.

##### EXAMPLE NOTIFICATION MIRROR

    {
      "push": {
        "application_name": "Pushbullet",
        "body": "If you see this on your computer, mirroring is working!\n",
        "created": 1.39935096416497e+09,
        "dismissable": true,
        "icon": "iVBORw0KGgoAAAANSUhEBgUzC42AAAADNElEQVRo\ng==\n",
        "iden": "1e443556ba3217c",
        "notification_id": "-8",
        "notification_tag": null,
        "package_name": "com.pushbullet.android",
        "receiver_email": "[email protected]",
        "receiver_email_normalized": "[email protected]",
        "receiver_iden": "ujpah72o0",
        "sender_email": "[email protected]",
        "sender_email_normalized": "[email protected]",
        "sender_iden": "ujpah72o0",
        "source_device_iden": "ujpah72o0sjAoRtnM0jc",
        "title": "Mirroring test",
        "type": "mirror"
      },
      "type": "push"
    }

##### EXAMPLE NOTIFICATION DISMISSAL

    {
      "push": {
        "created": 1.39935096622458e+09,
        "iden": "1e443556ba3217c",
        "notification_id": "-8",
        "notification_tag": null,
        "package_name": "com.pushbullet.android",
        "receiver_email": "[email protected]",
        "receiver_email_normalized": "[email protected]",
        "receiver_iden": "ujpah72o0",
        "sender_email": "[email protected]",
        "sender_email_normalized": "[email protected]",
        "sender_iden": "ujpah72o0",
        "source_device_iden": "ujpah72o0sjAoRtnM0jc",
        "type": "dismissal"
      },
      "type": "push"
    }

### Reacting to tickles

When you receive a tickle message, it means that a resource of the type subtype has changed. This is your cue to update that resource. Here's an example for the pushes type:
On receiving this message:

    {
      "subtype": "push",
      "type": "tickle"
    }

Request the pushes that have changed since the last time we received them:

    GET https://api.pushbullet.com/v2/pushes?modified_after=1399008037.849

Then merge these updates into your local copy of the push history.
Note: It's best to use the most recently modified local push's modified timestamp when making requests for updates. This will keep the responses small and fast. Additionally, don't trust the local machine's current timestamp because it is inevitably different from the server's timestamp. Use the latest timestamp you have seen on a push object instead. Since pushes are returned with most recently modified first, this will be the first push you get from any call to list-pushes.

# Ephemerals

You can send arbitrary JSON messages, called "ephemerals", to all devices on your account. Ephemerals are stored for a short period of time (if at all) and are sent directly to devices. Because they are sent directly, there is no "tickle" message like when creating or updating pushes or other objects, the JSON message appears directly in the stream.
Ephemerals are used by the Pushbullet apps for notification mirroring and universal copy/paste.
Unlike some of the other HTTP endpoints, POST parameters are not supported for ephemerals due to their JSON structure.

### Send an ephemeral

#### Parameters

- type - Must be set to push which is the only type of ephemeral currently.
- push - An arbitrary JSON object.

######
Example: Send Ephemeral

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"push":{"cat":"meow"},"type":"push"}' \
         --request POST \
         https://api.pushbullet.com/v2/ephemerals

Response

    {}

Ephemerals respond with an empty JSON object unless there is an error.

## Send SMS

You can send an SMS from your phone by sending an ephemeral message to your phone.

#### SMS Ephemeral

- type - push for send SMS.
- push - information about the SMS to send
  - type - messaging_extension_reply for send SMS.
  - package_name - com.pushbullet.android for send SMS
  - source_user_iden - The user iden of the user sending this message.
  - target_device_iden - The iden of the device corresponding to the phone that should send the SMS.
  - conversation_iden - Phone number to send the SMS to.
  - message - The SMS message to send.

##### EXAMPLE

    {
      "push": {
        "conversation_iden": "+1 303 555 1212",
        "message": "Hello!",
        "package_name": "com.pushbullet.android",
        "source_user_iden": "ujpah72o0",
        "target_device_iden": "ujpah72o0sjAoRtnM0jc",
        "type": "messaging_extension_reply"
      },
      "type": "push"
    }

## Mirrored Notifications

Mirrored notifications are notifications sent from android devices (currently the only source of mirrored notifications) to other devices. To test these out you can go into the android app's settings screen and hit the button "Send a test notification" while listening to the stream.

### Notification Ephemeral

- type - push for mirrored notifications.
- push - information about the notification
  - type - mirror for mirrored notifications.
  - icon - Base64-encoded JPEG image to use as the icon of the push.
  - title - The title of the notification.
  - body - The body of the notification.
  - source_user_iden - The user iden of the user sending this message.
  - source_device_iden - The iden of the device sending this message.
  - application_name - The name of the application that created the notification.
  - dismissable - True if the notification can be dismissed.
  - package_name - The package that made the notification, used when updating/dismissing an existing notification.
  - notification_id - The id of the notification, used when updating/dismissing an existing notification.
  - notification_tag - The tag of the notification, used when updating/dismissing an existing notification.
  - has_root - The phone is rooted.
  - client_version - The client version of the app sending this message.

##### EXAMPLE

    {
      "push": {
        "application_name": "Pushbullet",
        "body": "If you see this on your computer, Android-to-PC notifications are working!\n",
        "client_version": 125,
        "dismissable": true,
        "has_root": false,
        "icon": "(base64_encoded_jpeg)",
        "notification_id": "-8",
        "notification_tag": null,
        "package_name": "com.pushbullet.android",
        "source_device_iden": "ujpah72o0sjAoRtnM0jc",
        "source_user_iden": "ujpah72o0",
        "title": "Mirroring test",
        "type": "mirror"
      },
      "type": "push"
    }

### Dismissal Ephemeral

- type - "push" for notification dismissals.
- push - information about the dismissal.
  - type - "dismissal" for notification dismissals.
  - package_name - Set to the package_name field from the mirrored notification.
  - notification_id - Set to the notification_id field from the mirrored notification.
  - notification_tag - Set to the notification_tag field from the mirrored notification.
  - source_user_iden - Set to the source_user_iden field from the mirrored notification.

##### EXAMPLE

    {
      "push": {
        "notification_id": "-8",
        "notification_tag": null,
        "package_name": "com.pushbullet.android",
        "source_user_iden": "ujpah72o0",
        "type": "dismissal"
      },
      "type": "push"
    }

######
Example: Dismiss Notification

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"push":{"notification_id":"-8","notification_tag":null,"package_name":"com.pushbullet.android","source_user_iden":"ujpah72o0","type":"dismissal"},"type":"push"}' \
         --request POST \
         https://api.pushbullet.com/v2/ephemerals

Response

    {}

## Universal Copy/Paste

The Pushbullet apps can monitor the clipboard and send out a message each time the user copies a new text selection, sending it to all the user's devices which can copy it to the system clipboard or otherwise make it available to the user.

#### Copy a String to the Clipboard

#### Properties

- type - push for clipboard messages.
- push - information about the clipboard message.
  - type - clip for clipboard messages.
  - body - The text to copy to the clipboard.
  - source_user_iden - The iden of the user sending this message.
  - source_device_iden - The iden of the device sending this message.

#### Example

    {
      "push": {
        "body": "http://www.google.com",
        "source_device_iden": "ujpah72o0sjAoRtnM0jc",
        "source_user_iden": "ujpah72o0",
        "type": "clip"
      },
      "type": "push"
    }

######
Example: Send Clipboard Content

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"push":{"body":"http://www.google.com","source_device_iden":"ujpah72o0sjAoRtnM0jc","source_user_iden":"ujpah72o0","type":"clip"},"type":"push"}' \
         --request POST \
         https://api.pushbullet.com/v2/ephemerals

Response

    {}

# Chat

Chats are created whenever you send a message to someone or a receive a message from them and there is no existing chat between you and the other user.

Field | Type | Description
--- | --- | ---
iden | string | Unique identifier for this object Example: "ujpah72o0sjAoRtnM0jc"
active | bool | false if the item has been deleted Example: true
created | float | Creation time in floating point seconds (unix timestamp) Example: 1.381092887398433e+09
modified | float | Last modified time in floating point seconds (unix timestamp) Example: 1.441054560741007e+09
muted | bool | If true, notifications from this chat will not be shown Example: false
with | object | The user or email that the chat is with
↳ email | string | Email address of the person Example: "[email protected] "
↳ email_normalized | string | Canonical email address of the person Example: "[email protected] "
↳ iden | string | If this is a user, the iden of that user Example: "ujlMns72k"
↳ image_url | string | Image to display for the person Example: "https://dl.pushbulletusercontent.com/foGfub1jtC6yYcOMACk1AbHwTrTKvrDc/john.jpg"
↳ type | string | "email" or "user" Example: "user"
↳ name | string | Name of the person Example: "John Carmack"

#####
Example

    {
      "active": true,
      "created": 1.412047948579029e+09,
      "iden": "ujpah72o0sjAoRtnM0jc",
      "modified": 1.412047948579031e+09,
      "with": {
        "email": "[email protected]",
        "email_normalized": "[email protected]",
        "iden": "ujlMns72k",
        "image_url": "https://dl.pushbulletusercontent.com/foGfub1jtC6yYcOMACk1AbHwTrTKvrDc/john.jpg",
        "name": "John Carmack",
        "type": "user"
      }
    }

## list-chats

Get a list of chats belonging to the current user. If you have a large number of chats, you will need to use Pagination.

#####
Call

    GET https://api.pushbullet.com/v2/chats

#####
Request

none

#####
Response

Field | Type | Description
--- | --- | ---
chats | []Chat | Array of Chat objects ordered with most recently modified first

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         https://api.pushbullet.com/v2/chats

Response

    {
      "chats": [
        {
          "active": true,
          "created": 1.412047948579029e+09,
          "iden": "ujpah72o0sjAoRtnM0jc",
          "modified": 1.412047948579031e+09,
          "with": {
            "email": "[email protected]",
            "email_normalized": "[email protected]",
            "iden": "ujlMns72k",
            "image_url": "https://dl.pushbulletusercontent.com/foGfub1jtC6yYcOMACk1AbHwTrTKvrDc/john.jpg",
            "name": "John Carmack",
            "type": "user"
          }
        }
      ]
    }

## create-chat

Create a chat with another user or email address if one does not already exist.

#####
Call

    POST https://api.pushbullet.com/v2/chats

#####
Request

Field | Type | Description
--- | --- | ---
email | string | Email of person to create chat with (does not have to be a Pushbullet user) Example: "[email protected] "

#####
Response

Chat object

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"email":"[email protected]"}' \
         --request POST \
         https://api.pushbullet.com/v2/chats

Response

    {
      "active": true,
      "created": 1.412047948579029e+09,
      "iden": "ujpah72o0sjAoRtnM0jc",
      "modified": 1.412047948579031e+09,
      "with": {
        "email": "[email protected]",
        "email_normalized": "[email protected]",
        "iden": "ujlMns72k",
        "image_url": "https://dl.pushbulletusercontent.com/foGfub1jtC6yYcOMACk1AbHwTrTKvrDc/john.jpg",
        "name": "John Carmack",
        "type": "user"
      }
    }

## update-chat

Update existing chat object.

#####
Call

    POST https://api.pushbullet.com/v2/chats/{iden}

#####
Request

Field | Type | Description
--- | --- | ---
muted | bool | true to mute the grant, false to unmute it Example: true

#####
Response

Chat object

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"muted":true}' \
         --request POST \
         https://api.pushbullet.com/v2/chats/ujpah72o0sjAoRtnM0jc

Response

    {
      "active": true,
      "created": 1.412047948579029e+09,
      "iden": "ujpah72o0sjAoRtnM0jc",
      "modified": 1.412094382919271e+09,
      "muted": true,
      "with": {
        "email": "[email protected]",
        "email_normalized": "[email protected]",
        "iden": "ujlMns72k",
        "image_url": "https://dl.pushbulletusercontent.com/foGfub1jtC6yYcOMACk1AbHwTrTKvrDc/john.jpg",
        "name": "John Carmack",
        "type": "user"
      }
    }

## delete-chat

Delete a chat object.

#####
Call

    DELETE https://api.pushbullet.com/v2/chats/{iden}

#####
Request

none

#####
Response

none

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --request DELETE \
         https://api.pushbullet.com/v2/chats/ujpah72o0sjAoRtnM0jc

Response

    {}

# Device

Field | Type | Description
--- | --- | ---
iden | string | Unique identifier for this object Example: "ujpah72o0sjAoRtnM0jc"
active | bool | false if the item has been deleted Example: true
created | float | Creation time in floating point seconds (unix timestamp) Example: 1.381092887398433e+09
modified | float | Last modified time in floating point seconds (unix timestamp) Example: 1.441054560741007e+09
icon | string | Icon to use for this device, can be an arbitrary string. Commonly used values are: "desktop", "browser", "website", "laptop", "tablet", "phone", "watch", "system" Example: "ios"
nickname | string | Name to use when displaying the device Example: "Elon Musk's iPhone"
generated_nickname | bool | true if the nickname was automatically generated from the manufacturer and model fields (only used for some android phones) Example: true
manufacturer | string | Manufacturer of the device Example: "Apple"
model | string | Model of the device Example: "iPhone 5s (GSM)"
app_version | int | Version of the Pushbullet application installed on the device Example: 8623
fingerprint | string | String fingerprint for the device, used by apps to avoid duplicate devices. Value is platform-specific. Example: "nLN19IRNzS5xidPF+X8mKGNRpQo2X6XBgyO30FL6OiQ="
key_fingerprint | string | Fingerprint for the device's end-to-end encryption key, used to determine which devices the current device (based on its own key fingerprint) will be able to talk to. Example: "5ae6ec7e1fe681861b0cc85c53accc13bf94c11db7461a2808903f7469bfda56"
push_token | string | Platform-specific push token. Normally a prefix followed by an identifier. Prefixes are set per-app, if you want to receive push notifications in your app, contact [email protected] with your push backend credentials to get a prefix. Example: "production:f73be0ee7877c8c7fa69b1468cde764f"
has_sms | string | true if the devices has SMS capability, currently only true for type="android" devices Example: true
type | string | DEPRECATED, use icon field instead. Type of device, can be an arbitrary string. Commonly used values are: "android", "chrome", "firefox", "ios", "windows", "stream", "safari", "mac", "opera", "website"
kind | string | DEPRECATED, old name for type
pushable | bool | DEPRECATED, used to be for partially-initialized type="android" devices

#####
Example

    {
      "active": true,
      "app_version": 8623,
      "created": 1.412047948579029e+09,
      "iden": "ujpah72o0sjAoRtnM0jc",
      "manufacturer": "Apple",
      "model": "iPhone 5s (GSM)",
      "modified": 1.412047948579031e+09,
      "nickname": "Elon Musk's iPhone",
      "push_token": "production:f73be0ee7877c8c7fa69b1468cde764f"
    }

## list-devices

Get a list of devices belonging to the current user. If you have a large number of devices, you will need to use Pagination.

#####
Call

    GET https://api.pushbullet.com/v2/devices

#####
Request

none

#####
Response

Field | Type | Description
--- | --- | ---
devices | []Device | Array of Device objects ordered with most recently modified first

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         https://api.pushbullet.com/v2/devices

Response

    {
      "devices": [
        {
          "active": true,
          "app_version": 8623,
          "created": 1.412047948579029e+09,
          "iden": "ujpah72o0sjAoRtnM0jc",
          "manufacturer": "Apple",
          "model": "iPhone 5s (GSM)",
          "modified": 1.412047948579031e+09,
          "nickname": "Elon Musk's iPhone",
          "push_token": "production:f73be0ee7877c8c7fa69b1468cde764f"
        }
      ]
    }

## create-device

Create a new device.

#####
Call

    POST https://api.pushbullet.com/v2/devices

#####
Request

Field | Type | Description
--- | --- | ---
nickname | string | Name to use when displaying the device Example: "Elon Musk's iPhone"
model | string | Model of the device Example: "iPhone 5s (GSM)"
manufacturer | string | Manufacturer of the device Example: "Apple"
push_token | string | Platform-specific push token. Normally a prefix followed by an identifier. Prefixes are set per-app, if you want to receive push notifications in your app, contact [email protected] with your push backend credentials to get a prefix. Example: "production:f73be0ee7877c8c7fa69b1468cde764f"
app_version | int | Version of the Pushbullet application installed on the device Example: 8623
icon | string | Icon to use for this device, can be an arbitrary string. Commonly used values are: "desktop", "browser", "website", "laptop", "tablet", "phone", "watch", "system" Example: "ios"
has_sms | string | true if the devices has SMS capability, currently only true for type="android" devices Example: true

#####
Response

Device object

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"app_version":8623,"manufacturer":"Apple","model":"iPhone 5s (GSM)","nickname":"Elon Musk's iPhone","push_token":"production:f73be0ee7877c8c7fa69b1468cde764f"}' \
         --request POST \
         https://api.pushbullet.com/v2/devices

Response

    {
      "active": true,
      "app_version": 8623,
      "created": 1.412047948579029e+09,
      "iden": "ujpah72o0sjAoRtnM0jc",
      "manufacturer": "Apple",
      "model": "iPhone 5s (GSM)",
      "modified": 1.412047948579031e+09,
      "nickname": "Elon Musk's iPhone",
      "push_token": "production:f73be0ee7877c8c7fa69b1468cde764f"
    }

## update-device

Update an existing device.

#####
Call

    POST https://api.pushbullet.com/v2/devices/{iden}

#####
Request

Field | Type | Description
--- | --- | ---
nickname | string | Name to use when displaying the device Example: "Elon Musk's iPhone"
model | string | Model of the device Example: "iPhone 5s (GSM)"
manufacturer | string | Manufacturer of the device Example: "Apple"
push_token | string | Platform-specific push token. Normally a prefix followed by an identifier. Prefixes are set per-app, if you want to receive push notifications in your app, contact [email protected] with your push backend credentials to get a prefix. Example: "production:f73be0ee7877c8c7fa69b1468cde764f"
app_version | int | Version of the Pushbullet application installed on the device Example: 8623
icon | string | Icon to use for this device, can be an arbitrary string. Commonly used values are: "desktop", "browser", "website", "laptop", "tablet", "phone", "watch", "system" Example: "ios"
has_sms | string | true if the devices has SMS capability, currently only true for type="android" devices Example: true

#####
Response

Device object

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"nickname":"Work Phone"}' \
         --request POST \
         https://api.pushbullet.com/v2/devices/ujpah72o0sjAoRtnM0jc

Response

    {
      "active": true,
      "app_version": 8623,
      "created": 1.412047948579029e+09,
      "iden": "ujpah72o0sjAoRtnM0jc",
      "manufacturer": "Apple",
      "model": "iPhone 5s (GSM)",
      "modified": 1.412094382919271e+09,
      "nickname": "Work Phone",
      "push_token": "production:f73be0ee7877c8c7fa69b1468cde764f"
    }

## delete-device

Delete a device.

#####
Call

    DELETE https://api.pushbullet.com/v2/devices

#####
Request

none

#####
Response

none

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --request DELETE \
         https://api.pushbullet.com/v2/devices/ujpah72o0sjAoRtnM0jc

Response

    {}

# Push

A Push.

Field | Type | Description
--- | --- | ---
iden | string | Unique identifier for this object Example: "ujpah72o0sjAoRtnM0jc"
active | bool | false if the item has been deleted Example: true
created | float | Creation time in floating point seconds (unix timestamp) Example: 1.381092887398433e+09
modified | float | Last modified time in floating point seconds (unix timestamp) Example: 1.441054560741007e+09
type | string | Type of the push, one of "note", "file", "link". Example: "note"
dismissed | bool | true if the push has been dismissed by any device or if any device was active when the push was received Example: false
guid | string | Unique identifier set by the client, used to identify a push in case you receive it from /v2/everything before the call to /v2/pushes has completed. This should be a unique value. Pushes with guid set are mostly idempotent, meaning that sending another push with the same guid is unlikely to create another push (it will return the previously created push). Example: "993aaa48567d91068e96c75a74644159"
direction | string | Direction the push was sent in, can be "self", "outgoing", or "incoming" Example: "self"
sender_iden | string | User iden of the sender Example: "ujpah72o0"
sender_email | string | Email address of the sender Example: "[email protected] "
sender_email_normalized | string | Canonical email address of the sender Example: "[email protected] "
sender_name | string | Name of the sender Example: "Elon Musk"
receiver_iden | string | User iden of the receiver Example: "ujpah72o0"
receiver_email | string | Email address of the receiver Example: "[email protected] "
receiver_email_normalized | string | Canonical email address of the receiver Example: "[email protected] "
target_device_iden | string | Device iden of the target device, if sending to a single device Example: "ujpah72o0sjAoRtnM0jc"
source_device_iden | string | Device iden of the sending device. Optionally set by the sender when creating a push Example: "ujpah72o0sjAoRtnM0jc"
client_iden | string | If the push was created by a client, set to the iden of that client. Example: "ujpah72o0sjAoRtnM0jc"
channel_iden | string | If the push was created by a channel, set to the iden of that channel Example: "ujpah72o0sjAoRtnM0jc"
awake_app_guids | []string | List of guids (client side identifiers, not the guid field on pushes) for awake apps at the time the push was sent. If the length of this list is > 0, dismissed will be set to true and the awake app(s) must decide what to do with the notification Example: ["web-2d8cdf2a2b9b","web-cdb2313c74e"]
title | string | Title of the push, used for all types of pushes Example: "Space Travel Ideas"
body | string | Body of the push, used for all types of pushes Example: "Space Elevator, Mars Hyperloop, Space Model S (Model Space?)"
url | string | URL field, used for type="link" pushes Example: "http://www.teslamotors.com/"
file_name | string | File name, used for type="file" pushes Example: "john.jpg"
file_type | string | File mime type, used for type="file" pushes Example: "image/jpeg"
file_url | string | File download url, used for type="file" pushes Example: "https://dl.pushbulletusercontent.com/foGfub1jtC6yYcOMACk1AbHwTrTKvrDc/john.jpg"
image_url | string | URL to an image to use for this push, present on type="file" pushes if file_type matches image/* Example: "https://lh3.googleusercontent.com/mrrz35lLbiYAz8ejkJcpdsYhN3tMEtrXxj93k_gQPin4GfdDjVy2Bj26pOGrpFQmAM7OFBHcDfdMjrScg3EUIJrgJeY"
image_width | int | Width of image in pixels, only present if image_url is set Example: 322
image_height | int | Height of image in pixels, only present if image_url is set Example: 484

#####
Example

    {
      "active": true,
      "body": "Space Elevator, Mars Hyperloop, Space Model S (Model Space?)",
      "created": 1.412047948579029e+09,
      "direction": "self",
      "dismissed": false,
      "iden": "ujpah72o0sjAoRtnM0jc",
      "modified": 1.412047948579031e+09,
      "receiver_email": "[email protected]",
      "receiver_email_normalized": "[email protected]",
      "receiver_iden": "ujpah72o0",
      "sender_email": "[email protected]",
      "sender_email_normalized": "[email protected]",
      "sender_iden": "ujpah72o0",
      "sender_name": "Elon Musk",
      "title": "Space Travel Ideas",
      "type": "note"
    }

## list-pushes

Request push history.

#####
Call

    GET https://api.pushbullet.com/v2/pushes

#####
Request

Field | Type | Description
--- | --- | ---
modified_after | string | Request pushes modified after this timestamp Example: 1.4e+09
active | string | Don't return deleted pushes Example: true
cursor | string | Cursor for getting multiple pages of pushes, see Pagination Example: "3eae6fa796b06b51b7bd6ad824b9b63b"
limit | integer | Limit on the number of results returned, see Pagination Example: 10

#####
Response

Field | Type | Description
--- | --- | ---
pushes | []Push | Array of Push objects ordered with most recently modified first

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --data-urlencode active="true" \
         --data-urlencode modified_after="1.4e+09" \
         --get \
         https://api.pushbullet.com/v2/pushes

Response

    {
      "pushes": [
        {
          "active": true,
          "body": "Space Elevator, Mars Hyperloop, Space Model S (Model Space?)",
          "created": 1.412047948579029e+09,
          "direction": "self",
          "dismissed": false,
          "iden": "ujpah72o0sjAoRtnM0jc",
          "modified": 1.412047948579031e+09,
          "receiver_email": "[email protected]",
          "receiver_email_normalized": "[email protected]",
          "receiver_iden": "ujpah72o0",
          "sender_email": "[email protected]",
          "sender_email_normalized": "[email protected]",
          "sender_iden": "ujpah72o0",
          "sender_name": "Elon Musk",
          "title": "Space Travel Ideas",
          "type": "note"
        }
      ]
    }

## create-push

Send a push to a device or another person.

#### Target Parameters

Each push has a target, if you don't specify a target, we will broadcast it to all of the user's devices. Only one target may be specified.

- device_iden - Send the push to a specific device. Appears as target_device_iden on the push. You can find this using the /v2/devices call.
- email - Send the push to this email address. If that email address is associated with a Pushbullet user, we will send it directly to that user, otherwise we will fallback to sending an email to the email address (this will also happen if a user exists but has no devices registered).
- channel_tag - Send the push to all subscribers to your channel that has this tag.
- client_iden - Send the push to all users who have granted access to your OAuth client that has this iden.

#### Parameters for different types of pushes

- Note
  - type - Set to note
  - title - The note's title.
  - body - The note's message.
- Link
  - type - Set to link
  - title - The link's title.
  - body - A message associated with the link.
  - url - The url to open.
- File
  - type - Set to file
  - body - A message to go with the file.
  - file_name - The name of the file.
  - file_type - The MIME type of the file.
  - file_url - The url for the file. See pushing files for how to get a file_url

### Push a file

Pushing files is a two-part process: first the file needs to be uploaded, then a push needs to be sent for that file.
To upload a new file, use upload-request.
Once the file has been uploaded, set the file_name, file_url, and file_type returned in the response to the upload request as the parameters for a new push with type="file".

#####
Call

    POST https://api.pushbullet.com/v2/pushes

#####
Request

Field | Type | Description
--- | --- | ---
type | string | Type of the push, one of "note", "file", "link". Example: "note"
title | string | Title of the push, used for all types of pushes Example: "Space Travel Ideas"
body | string | Body of the push, used for all types of pushes Example: "Space Elevator, Mars Hyperloop, Space Model S (Model Space?)"
url | string | URL field, used for type="link" pushes Example: "http://www.teslamotors.com/"
file_name | string | File name, used for type="file" pushes Example: "john.jpg"
file_type | string | File mime type, used for type="file" pushes Example: "image/jpeg"
file_url | string | File download url, used for type="file" pushes Example: "https://dl.pushbulletusercontent.com/foGfub1jtC6yYcOMACk1AbHwTrTKvrDc/john.jpg"
source_device_iden | string | Device iden of the sending device. Optional. Example: "ujpah72o0sjAoRtnM0jc"
device_iden | string | Device iden of the target device, if sending to a single device. Appears as target_device_iden on the push. Example: "ujpah72o0sjAoRtnM0jc"
client_iden | string | Client iden of the target client, sends a push to all users who have granted access to this client. The current user must own this client. Example: "ujpah72o0sjAoRtnM0jc"
channel_tag | string | Channel tag of the target channel, sends a push to all people who are subscribed to this channel. The current user must own this channel.
email | string | Email address to send the push to. If there is a pushbullet user with this address, they get a push, otherwise they get an email. Example: "[email protected] "
guid | string | Unique identifier set by the client, used to identify a push in case you receive it from /v2/everything before the call to /v2/pushes has completed. This should be a unique value. Pushes with guid set are mostly idempotent, meaning that sending another push with the same guid is unlikely to create another push (it will return the previously created push). Example: "993aaa48567d91068e96c75a74644159"

#####
Response

Push object

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"body":"Space Elevator, Mars Hyperloop, Space Model S (Model Space?)","title":"Space Travel Ideas","type":"note"}' \
         --request POST \
         https://api.pushbullet.com/v2/pushes

Response

    {
      "active": true,
      "body": "Space Elevator, Mars Hyperloop, Space Model S (Model Space?)",
      "created": 1.412047948579029e+09,
      "direction": "self",
      "dismissed": false,
      "iden": "ujpah72o0sjAoRtnM0jc",
      "modified": 1.412047948579031e+09,
      "receiver_email": "[email protected]",
      "receiver_email_normalized": "[email protected]",
      "receiver_iden": "ujpah72o0",
      "sender_email": "[email protected]",
      "sender_email_normalized": "[email protected]",
      "sender_iden": "ujpah72o0",
      "sender_name": "Elon Musk",
      "title": "Space Travel Ideas",
      "type": "note"
    }

## update-push

Update a push.

#####
Call

    POST https://api.pushbullet.com/v2/pushes/{iden}

#####
Request

Field | Type | Description
--- | --- | ---
dismissed | bool | Marks a push as having been dismissed by the user, will cause any notifications for the push to be hidden if possible. Example: true

#####
Response

Push object

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"dismissed":true}' \
         --request POST \
         https://api.pushbullet.com/v2/pushes/ujpah72o0sjAoRtnM0jc

Response

    {
      "active": true,
      "body": "Space Elevator, Mars Hyperloop, Space Model S (Model Space?)",
      "created": 1.412047948579029e+09,
      "direction": "self",
      "dismissed": true,
      "iden": "ujpah72o0sjAoRtnM0jc",
      "modified": 1.412094382919271e+09,
      "receiver_email": "[email protected]",
      "receiver_email_normalized": "[email protected]",
      "receiver_iden": "ujpah72o0",
      "sender_email": "[email protected]",
      "sender_email_normalized": "[email protected]",
      "sender_iden": "ujpah72o0",
      "sender_name": "Elon Musk",
      "title": "Space Travel Ideas",
      "type": "note"
    }

## delete-push

Delete a push.

#####
Call

    DELETE https://api.pushbullet.com/v2/pushes/{iden}

#####
Request

none

#####
Response

none

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --request DELETE \
         https://api.pushbullet.com/v2/pushes/ujpah72o0sjAoRtnM0jc

Response

    {}

## delete-all-pushes

Delete all pushes belonging to the current user. This call is asynchronous, the pushes will be deleted after the call returns.

#####
Call

    DELETE https://api.pushbullet.com/v2/pushes

#####
Request

none

#####
Response

none

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --request DELETE \
         https://api.pushbullet.com/v2/pushes

Response

    {}

# Subscription

Subscribe to channels to receive any updates pushed to that channel.
Channels can be created on the website. Each channel has a unique tag to identify it. When you push to a channel, all people subscribed to that channel will receive a push.
To push to a channel, use the channel_tag parameter on create-push

Field | Type | Description
--- | --- | ---
iden | string | Unique identifier for this object Example: "ujpah72o0sjAoRtnM0jc"
active | bool | false if the item has been deleted Example: true
created | float | Creation time in floating point seconds (unix timestamp) Example: 1.381092887398433e+09
modified | float | Last modified time in floating point seconds (unix timestamp) Example: 1.441054560741007e+09
muted | bool | If true, notifications from this subscription will not be shown Example: false
channel | object | Information about the channel that is being subscribed to
↳ iden | string | Unique identifier for the channel Example: "ujpah72o0sjAoRtnM0jc"
↳ tag | string | Unique tag for this channel Example: "elonmusknews"
↳ name | string | Name of the channel Example: "Elon Musk News"
↳ description | string | Description of the channel Example: "News about Elon Musk."
↳ image_url | string | Image for the channel Example: "https://dl.pushbulletusercontent.com/StzRmwdkIe8gluBH3XoJ9HjRqjlUYSf4/musk.jpg"
↳ website_url | string | Link to a website for the channel Example: "https://twitter.com/elonmusk"

#####
Example

    {
      "active": true,
      "channel": {
        "description": "News about Elon Musk.",
        "iden": "ujxPklLhvyKsjAvkMyTVh6",
        "image_url": "https://dl.pushbulletusercontent.com/StzRmwdkIe8gluBH3XoJ9HjRqjlUYSf4/musk.jpg",
        "name": "Elon Musk News",
        "tag": "elonmusknews"
      },
      "created": 1.412047948579029e+09,
      "iden": "ujpah72o0sjAoRtnM0jc",
      "modified": 1.412047948579031e+09,
      "muted": false
    }

## list-subscriptions

Get a list of subscriptions belonging to the current user. If you have a large number of subscriptions, you will need to use Pagination.

#####
Call

    GET https://api.pushbullet.com/v2/subscriptions

#####
Request

none

#####
Response

Field | Type | Description
--- | --- | ---
subscriptions | []Subscription | Array of Subscription objects ordered with most recently modified first

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         https://api.pushbullet.com/v2/subscriptions

Response

    {
      "subscriptions": [
        {
          "active": true,
          "channel": {
            "description": "News about Elon Musk.",
            "iden": "ujxPklLhvyKsjAvkMyTVh6",
            "image_url": "https://dl.pushbulletusercontent.com/StzRmwdkIe8gluBH3XoJ9HjRqjlUYSf4/musk.jpg",
            "name": "Elon Musk News",
            "tag": "elonmusknews"
          },
          "created": 1.412047948579029e+09,
          "iden": "ujpah72o0sjAoRtnM0jc",
          "modified": 1.412047948579031e+09
        }
      ]
    }

## create-subscription

#####
Call

    POST https://api.pushbullet.com/v2/subscriptions

#####
Request

Field | Type | Description
--- | --- | ---
channel_tag | string | Unique tag for the channel to subscribe to Example: "elonmusknews"

#####
Response

Subscription object

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"channel_tag":"elonmusknews"}' \
         --request POST \
         https://api.pushbullet.com/v2/subscriptions

Response

    {
      "active": true,
      "channel": {
        "description": "News about Elon Musk.",
        "iden": "ujxPklLhvyKsjAvkMyTVh6",
        "image_url": "https://dl.pushbulletusercontent.com/StzRmwdkIe8gluBH3XoJ9HjRqjlUYSf4/musk.jpg",
        "name": "Elon Musk News",
        "tag": "elonmusknews"
      },
      "created": 1.412047948579029e+09,
      "iden": "ujpah72o0sjAoRtnM0jc",
      "modified": 1.412047948579031e+09
    }

## update-subscription

#####
Call

    POST https://api.pushbullet.com/v2/subscriptions/{iden}

#####
Request

Field | Type | Description
--- | --- | ---
muted | bool | true to mute the subscription, false to unmute it Example: true

#####
Response

Subscription object

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"muted":true}' \
         --request POST \
         https://api.pushbullet.com/v2/subscriptions/ujpah72o0sjAoRtnM0jc

Response

    {
      "active": true,
      "channel": {
        "description": "News about Elon Musk.",
        "iden": "ujxPklLhvyKsjAvkMyTVh6",
        "image_url": "https://dl.pushbulletusercontent.com/StzRmwdkIe8gluBH3XoJ9HjRqjlUYSf4/musk.jpg",
        "name": "Elon Musk News",
        "tag": "elonmusknews"
      },
      "created": 1.412047948579029e+09,
      "iden": "ujpah72o0sjAoRtnM0jc",
      "modified": 1.412094382919271e+09,
      "muted": true
    }

## delete-subscription

Unsubscribe from a channel.

#####
Call

    DELETE https://api.pushbullet.com/v2/subscriptions/{iden}

#####
Request

none

#####
Response

Subscription object

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --request DELETE \
         https://api.pushbullet.com/v2/subscriptions/ujpah72o0sjAoRtnM0jc

Response

    {}

## channel-info

Get information about a channel.

#####
Call

    GET https://api.pushbullet.com/v2/channel-info

#####
Request

Field | Type | Description
--- | --- | ---
tag | string | Tag of the channel to get information for Example: "elonmusknews"
no_recent_pushes | bool | Don't show recent pushes, defaults to false Example: true

#####
Response

Field | Type | Description
--- | --- | ---
iden | string | Unique identifier for the channel Example: "ujpah72o0sjAoRtnM0jc"
name | string | Name of the channel Example: "Elon Musk News"
description | string | Description of the channel Example: "News about Elon Musk"
image_url | string | Image to display for the channel Example: "https://dl.pushbulletusercontent.com/StzRmwdkIe8gluBH3XoJ9HjRqjlUYSf4/musk.jpg"
subscriber_count | int | Number of subscribers to the channel Example: 9382239
tag | string | Globally unique identifier for the channel, chosen by the channel creator Example: "elonmusknews"
recent_pushes | []Push | Array of recent Push objects sent on the channel

#####
Example

Request

    curl --data-urlencode no_recent_pushes="true" \
         --data-urlencode tag="elonmusknews" \
         --get \
         https://api.pushbullet.com/v2/channel-info

Response

    {
      "active": true,
      "created": 1.412047948579029e+09,
      "description": "News about Elon Musk.",
      "iden": "ujxPklLhvyKsjAvkMyTVh6",
      "image_url": "https://dl.pushbulletusercontent.com/StzRmwdkIe8gluBH3XoJ9HjRqjlUYSf4/musk.jpg",
      "modified": 1.412047948579031e+09,
      "name": "Elon Musk News",
      "subscriber_count": 9.382239e+06,
      "tag": "elonmusknews"
    }

# User

Field | Type | Description
--- | --- | ---
iden | string | Unique identifier for the current user Example: "ujpah72o0"
created | float | Creation time in floating point seconds (unix timestamp) Example: 1.381092887398433e+09
modified | float | Last modified time in floating point seconds (unix timestamp) Example: 1.441054560741007e+09
email | string | Email address Example: "[email protected] "
email_normalized | string | Canonical email address Example: "[email protected] "
name | string | Full name if available Example: "Elon Musk"
image_url | string | URL for image of user or placeholder image Example: "https://static.pushbullet.com/missing-image/55a7dc-45"
max_upload_size | int | Maximum upload size in bytes Example: 26214400
referred_count | int | Number of users referred by this user Example: 2
referrer_iden | string | User iden for the user that referred the current user, if set Example: "ujlxm0aiz2"

#####
Example

    {
      "created": 1.381092887398433e+09,
      "email": "[email protected]",
      "email_normalized": "[email protected]",
      "iden": "ujpah72o0",
      "image_url": "https://static.pushbullet.com/missing-image/55a7dc-45",
      "max_upload_size": 2.62144e+07,
      "modified": 1.441054560741007e+09,
      "name": "Elon Musk"
    }

## get-user

Gets the currently logged in user.

#####
Call

    GET https://api.pushbullet.com/v2/users/me

#####
Request

none

#####
Response

User object

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         https://api.pushbullet.com/v2/users/me

Response

    {
      "created": 1.381092887398433e+09,
      "email": "[email protected]",
      "email_normalized": "[email protected]",
      "iden": "ujpah72o0",
      "image_url": "https://static.pushbullet.com/missing-image/55a7dc-45",
      "max_upload_size": 2.62144e+07,
      "modified": 1.441054560741007e+09,
      "name": "Elon Musk"
    }

# Upload

To upload a file you need to call upload-request with the file name and type. After you get an upload_url from the response, you can upload the file contents using multipart/form-data encoding.

##### EXAMPLE REQUEST

    curl -i -X POST https://upload.pushbullet.com/upload-legacy/a5e1776d2566a6b16032958697288df4 \
      -F [email protected]

##### EXAMPLE RESPONSE

    HTTP/1.1 204 No Content

After the request completes, the file will be available at the file_url from the upload-request response.

## upload-request

Request authorization to upload a file.

#####
Call

    POST https://api.pushbullet.com/v2/upload-request

#####
Request

Field | Type | Description
--- | --- | ---
file_name | string | The name of the file you want to upload Example: "cat.jpg"
file_type | string | The MIME type of the file Example: "image/jpeg"

#####
Response

Field | Type | Description
--- | --- | ---
file_name | string | The file name that will be used for the file (may be truncated from the original file_name.
file_type | string | The file type that will be used for the file (may be different from the one provided to upload-request.
file_url | string | The URL where the file will be available after it is uploaded.
upload_url | string | The URL to POST the file to. The file must be posted using multipart/form-data encoding.
data | object | DEPRECATED

#####
Example

Request

    curl --header 'Access-Token: <your_access_token_here>' \
         --header 'Content-Type: application/json' \
         --data-binary '{"file_name":"cat.jpg","file_type":"image/jpeg"}' \
         --request POST \
         https://api.pushbullet.com/v2/upload-request

Response

    {
      "file_name": "cat.jpg",
      "file_type": "image/jpeg",
      "file_url": "https://dl.pushbulletusercontent.com/034f197bc6c37cac3cc03542659d458b/cat.jpg",
      "upload_url": "https://upload.pushbullet.com/upload-legacy/a5e1776d2566a6b16032958697288df4"
    }

# iPhone Extensions

### Pushbullet URL Handler

The iPhone app has a url handler, pushbullet:// that can be used to compose pushes like so:

      pushbullet://compose?type=note&body=Hello

compose is the only option right now, but a few push types can be constructed (make sure to urlencode any parameters):

      pushbullet://compose?type=link&url=https%3A%2F%2Fwww.pushbullet.com
      pushbullet://compose?type=address&address=850%20Bryant%20St

Only type="note" and type="link" are supported for now (and their parameters are the same as in create-push).

### Open in Pushbullet

If you use a UIDocumentInteractionController to preview a file, when the user selects "Open In..." for most file types, Pushbullet should show up in the list of applications.
If the user selects the Pushbullet app, the app should open with a new compose window for a type="file" push with the provided file attached.

### Feedback

Let us know what you think at [email protected]

# Changelog

####
January 28, 2015

• Removed address and list pushes which have been deprecated for forever.

####
December 18, 2015

• Fixed curl link for windows.

####
November 4, 2015

• Removed Android Extension section, as this has been replaced with Android Wear integration, the Android Extension is no longer needed.

####
September 11, 2015

• New style for docs.
• Removed Contacts calls as the official apps no longer user Contacts. These have been replaced with the Chat objects.

####
August 24, 2015

• Added a run button to execute javascript snippets.

####
August 18, 2015

• Added information on encryption in End-to-End Encryption.
• Added new auth header Access-Token to Requests, removed mention of older auth headers.
• Removed outdated information from Resizing Images.

####
May 23, 2015

• Added information about ratelimiting.

####
April 13, 2015

• Added Send SMS using ephemerals.
• Updated Resizing Images to mention new resizing method and remove old ones.

####
March 10, 2015

• Removed mention of HTTP Basic Auth, it's more confusing than setting an Authorization header.

####
February 20, 2015

• Added a note about Backwards Compatibility.

####
February 16, 2015

• Added a call to delete all pushes.