GET /p/:url_token.json
Retrieve a push.

Retrieving a Push

Retrieves a push and its payload. If the push is active, this request will count as a view and be logged in the audit log.

Security Features

  • Passphrase protection - Requires a passphrase to view.

    Provide the passphrase as a GET parameter: ?passphrase=xxx

Example Request

curl -X GET \
  -H "Authorization: Bearer MyAPIToken" \
  https://pwpush.com/p/fk27vnslkd.json

Example Response

{
  "payload": "secret_text",
  "passphrase": null,
  "note": "By user initiated request from the user@example.com account",
  "expire_after_days": null,
  "expire_after_views": null,
  "deletable_by_viewer": false,
  "retrieval_step": false,
  ...
}

Supported Formats

JSON

Params

Param name Description
url_token
required

Secret URL token of a previously created push.

Validations:

  • Must be a String


POST /p.json
Create a new push.

Creating a New Push

Creates a new push (secret URL) containing the provided payload.

Required Parameters

The push must be created with a payload parameter containing the secret content. All other parameters are optional and will use system defaults if not specified.

Expiration Settings

Pushes can be configured to expire after:

  • A number of views (expire_after_views)

  • A number of days (expire_after_days)

  • Both views and days (first trigger wins)

Security Options

  • Passphrase protection requires viewers to enter a secret phrase

  • Retrieval step helps prevent automated URL scanners from burning views

  • Deletable by viewer allows recipients to manually expire the push

Example Request

curl -X POST \
  -H "Authorization: Bearer MyAPIToken" \
  -H "Content-Type: application/json" \
  -d '{"password": {"payload": "secret_text"}}' \
  https://pwpush.com/p.json

Example Response

{
  "url_token": "fkwjfvhall92",
  "created_at": "2023-10-20T15:32:01Z",
  "expires_at": "2023-10-20T15:32:01Z",
  "views_remaining": 10,
  "passphrase": null,
  "note": null,
  ...
}

Supported Formats

JSON

Params

Param name Description
password
required

Push details

Validations:

  • Must be a Hash

password[payload]
required

The URL encoded password or secret text to share.

Validations:

  • Must be a String

password[passphrase]
optional

Require recipients to enter this passphrase to view the created push.

Validations:

  • Must be a String

password[note]
optional , blank allowed

If authenticated, the URL encoded note for this push. Visible only to the push creator.

Validations:

  • Must be a String

password[expire_after_days]
optional

Expire secret link and delete after this many days.

Validations:

  • Must be a Integer

password[expire_after_views]
optional

Expire secret link and delete after this many views.

Validations:

  • Must be a Integer

password[deletable_by_viewer]
optional

Allow users to delete passwords once retrieved.

Validations:

  • Must be one of: true, false.

password[retrieval_step]
optional

Helps to avoid chat systems and URL scanners from eating up views.

Validations:

  • Must be one of: true, false.

account_id
optional

The account ID to associate the push with. See: docs.pwpush.com/docs/json-api/#multiple-accounts

Validations:

  • Must be a Integer


GET /p/:url_token/preview.json
Helper endpoint to retrieve the fully qualified secret URL of a push.

Preview a Push

This method retrieves the preview URL of a push. This is useful for getting the fully qualified URL of a push before sharing it with others.

Example Request

curl -X GET \
  -H "Authorization: Bearer MyAPIToken" \
  https://pwpush.com/p/fk27vnslkd/preview.json

Example Response

{
  "url": "https://pwpush.com/p/fk27vnslkd"
}

Supported Formats

JSON

Params

Param name Description
url_token
required

Secret URL token of a previously created push.

Validations:

  • Must be a String


GET /p/:url_token/audit.json
Retrieve the audit log for a push.

Push Audit Log Retrieval

Returns the audit log for a push, containing an array of view events with metadata including:

  • IP address of viewer

  • User agent

  • Referrer URL

  • Timestamp

  • Event type (view, failed_view, expire, etc)

Authentication is required. Only the owner of the push can retrieve its audit log. Requests for pushes not owned by the authenticated user will receive a 403 Forbidden response.

Example Request

curl -X GET \
  -H "X-User-Email: user@example.com" \
  -H "X-User-Token: MyAPIToken" \
  https://pwpush.com/p/fk27vnslkd/audit.json

Example Response

{
  "views": [
    {
      "ip": "x.x.x.x",
      "user_agent": "Mozilla/5.0...",
      "referrer": "https://example.com",
      "created_at": "2023-10-20T15:32:01Z",
      "successful": true,
      ...
    }
  ]
}

Supported Formats

JSON

Params

Param name Description
url_token
required

Secret URL token of a previously created push.

Validations:

  • Must be a String


DELETE /p/:url_token.json
Expire a push: delete the payload and expire the secret URL.

Push Expiration

Expires a push immediately. Must be authenticated & owner of the push or the push must have been created with deleteable_by_viewer.

Example Request

curl -X DELETE \
  -H "Authorization: Bearer MyAPIToken" \
  https://pwpush.com/p/fkwjfvhall92.json

Example Response

{
  "expired": true,
  "expired_on": "2024-12-10T15:32:01Z"
}

Supported Formats

JSON

Params

Param name Description
url_token
required

Secret URL token of a previously created push.

Validations:

  • Must be a String


GET /p/active.json
Retrieve your active pushes.

Active Pushes Retrieval

Returns the list of pushes for your account that are still active.

Example Request

curl -X GET \
  -H "Authorization: Bearer MyAPIToken" \
  https://pwpush.com/p/active.json

Example Response

[
  {
    "url_token": "fkwjfvhall92",
    "created_at": "2023-10-20T15:32:01Z",
    "expire_after_days": 7,
    "expire_after_views": 1,
    "expired": false,
    "days_remaining": 7,
    "views_remaining": 1,
    ...
  },
  ...
]

Supported Formats

JSON

GET /p/expired.json
Retrieve your expired pushes.

Expired Pushes Retrieval

Returns the list of pushes for your account that have expired.

Example Request

curl -X GET \
  -H "Authorization: Bearer MyAPIToken" \
  https://pwpush.com/p/expired.json

Example Response

[
  {
    "url_token": "fkwjfvhall92",
    "created_at": "2023-10-20T15:32:01Z",
    "expires_on": "2023-10-23T15:32:01Z",
    "expire_after_days": 7,
    "expire_after_views": 1,
    "expired": true,
    ...
  },
  ...
]

Supported Formats

JSON