Skip to content
Reallyusefulplugins.com Docs

Hoster API Documentation

Updated 17 October 2026

Hoster API Plugin Documentation

Overview

The Hoster API plugin provides REST API endpoints for creating, updating and retrieving license information from your WordPress site.

  • Create licenses: Create a license and assign it to an existing or new WordPress user.
  • Update licenses: Change existing license fields using flat JSON parameters.
  • Retrieve license details: Access information including license number, expiry, activations and status.

All endpoints use Bearer token authentication. Create and update requests accept flat JSON parameters. Supported date formats include UK (DD/MM/YYYY) and ISO (YYYY-MM-DD); dates are normalised to YYYY-MM-DD.

All plugin functions use the rup_hoster_api_ prefix.

Authentication

Include a valid API token in the Authorization header of every request:

Authorization: Bearer <your_api_token>

API Endpoints

1. Create License

Method: POST

https://your-site.com/wp-json/hoster-api/v1/create-license

Create a license associated with a download and assign it to a WordPress user. Identify the user with either user_id or email.

Required parameters

ParameterTypeDescription
download_idintegerID of the related download post.
statusstringLicense status, such as active or expired.
user_id or emailinteger / stringProvide an existing WordPress user ID or an email address.

If email is supplied, the API uses the existing user with that email address or creates a new user using the email as the username.

Optional parameters

ParameterTypeDescription
first_namestringFirst name when creating a new user.
last_namestringLast name when creating a new user.
rolestringRole for a new user; defaults to the role configured in the plugin settings.
enable_activation_limitbooleanSet true to enforce a limit or false for unlimited activations.
activation_limitintegerMaximum activations; use 0 for unlimited.
expiry_datestringExpiry date in a supported format. Leave empty for a lifetime license.

Note: Values such as "false" and "0" sent as strings are converted to their appropriate types.

2. Update License

Method: POST

https://your-site.com/wp-json/hoster-api/v1/update-license

Update an existing license by sending its post ID and only the fields you want to change. Parameters are supplied directly in the JSON body, not inside an update_data object.

Required parameter

ParameterTypeDescription
license_idintegerWordPress post ID of the license to update.

Optional parameters

ParameterTypeDescription
statusstringNew license status, such as expired.
expiry_datestringNew expiry date, e.g. 13/05/2026 or 2026-05-13. Empty means lifetime.
activation_limitintegerNew maximum number of activations.

The endpoint assembles the supplied fields into an update array, normalizes the expiry date where applicable and passes the data to the license update filter. Fields you omit are not included in the update.

3. Retrieve License Details

The plugin also provides a retrieve-license-details endpoint for reading license information, including license number, expiry date, activation data and status.

Note: The source documentation does not specify this endpoint’s request URL, HTTP method or parameters. Refer to the plugin implementation before integrating this endpoint.

Request Examples

Example 1: Create a license using an email and UK date

The API finds an existing user by email or creates one if needed. The UK-format date is converted to 2025-02-13.

{
  "download_id": 10,
  "email": "[email protected]",
  "status": "active",
  "enable_activation_limit": "false",
  "activation_limit": "0",
  "expiry_date": "13/02/2025"
}

Example 2: Create a license for an existing user

Supplying user_id assigns the license directly to that user without an email lookup or user creation. The expiry date is already in ISO format.

{
  "download_id": 10,
  "user_id": "1",
  "status": "active",
  "enable_activation_limit": "false",
  "activation_limit": "0",
  "expiry_date": "2025-02-13"
}

Example 3: Update a license with flat parameters

This request updates license 123, sets the status to expired, changes its activation limit and converts the expiry date to 2026-05-13.

{
  "license_id": 123,
  "status": "expired",
  "expiry_date": "13/05/2026",
  "activation_limit": 10
}

Additional Notes

Default role for new users

Administrators can configure a default role in the plugin settings. If a new user is created from an email address and the request omits role, that default role is applied.

Type conversion

The API converts supported string values to the expected types. For example, "false" becomes a boolean false and numeric fields are converted to integers.

Date conversion

UK dates matching DD/MM/YYYY are processed with DateTime::createFromFormat('d/m/Y', $date_raw). Other common date formats are processed using strtotime(). The resulting expiry date uses YYYY-MM-DD. An empty expiry date represents a lifetime license.

License storage

The retrieve-license-details endpoint depends on the plugin’s license post type and metadata. The source documentation does not include the complete list of required post types or meta keys.

Was this helpful?

Still stuck? Open a support ticket