HivePress REST API
1.0

This is a reference of all the endpoints available in HivePress REST API. Since it's based on WordPress REST API, you can refer to the WordPress documentation for the available authentication methods and more details.

This is the documentation for version 1.0 of the API. Last update on May 2, 2022.

Base URL
/wp-json/hivepress/v1

Upload an attachment

POST /attachments

Body

Responses

POST /attachments
curl \
 -X POST /wp-json/hivepress/v1/attachments \
 -H "Content-Type: application/json" \
 -d '{"parent":42,"parent_model":"string","parent_field":"string","file":"string"}'
Request example
{
  "parent": 42,
  "parent_model": "string",
  "parent_field": "string",
  "file": "string"
}

Update an attachment

POST /attachments/{attachment_id}

Path parameters

Body

Responses

POST /attachments/{attachment_id}
curl \
 -X POST /wp-json/hivepress/v1/attachments/{attachment_id} \
 -H "Content-Type: application/json" \
 -d '{"sort_order":42}'
Request example
{
  "sort_order": 42
}

Delete an attachment

DELETE /attachments/{attachment_id}

Path parameters

DELETE /attachments/{attachment_id}
curl \
 -X DELETE /wp-json/hivepress/v1/attachments/{attachment_id}

Update a listing

POST /listings/{listing_id}

In addition to the default listing fields, you can also update custom fields added via the listing attributes or HivePress extensions.

Path parameters

Body

Responses

POST /listings/{listing_id}
curl \
 -X POST /wp-json/hivepress/v1/listings/{listing_id} \
 -H "Content-Type: application/json" \
 -d '{"title":"string","description":"string"}'
Request example
{
  "title": "string",
  "description": "string"
}

Delete a listing

DELETE /listings/{listing_id}

Path parameters

DELETE /listings/{listing_id}
curl \
 -X DELETE /wp-json/hivepress/v1/listings/{listing_id}

Hide a listing

POST /listings/{listing_id}/hide

Each new request hides or unhides a listing.

Path parameters

Responses

POST /listings/{listing_id}/hide
curl \
 -X POST /wp-json/hivepress/v1/listings/{listing_id}/hide

Report a listing

POST /listings/{listing_id}/report

Sends an email to the site administrator.

Path parameters

Body

Responses

POST /listings/{listing_id}/report
curl \
 -X POST /wp-json/hivepress/v1/listings/{listing_id}/report \
 -H "Content-Type: application/json" \
 -d '{"details":"string"}'
Request example
{
  "details": "string"
}

Register a user

POST /users

Body

Responses

POST /users
curl \
 -X POST /wp-json/hivepress/v1/users \
 -H "Content-Type: application/json" \
 -d '{"username":"string","email":"string","password":"string"}'
Request example
{
  "username": "string",
  "email": "string",
  "password": "string"
}

Login a user

POST /users/login

Body

Responses

POST /users/login
curl \
 -X POST /wp-json/hivepress/v1/users/login \
 -H "Content-Type: application/json" \
 -d '{"username_or_email":"string","password":"string"}'
Request example
{
  "username_or_email": "string",
  "password": "string"
}

Request a password reset

POST /users/request-password

Body

Responses

POST /users/request-password
curl \
 -X POST /wp-json/hivepress/v1/users/request-password \
 -H "Content-Type: application/json" \
 -d '{"username_or_email":"string"}'
Request example
{
  "username_or_email": "string"
}

Reset a password

POST /users/reset-password

Body

Responses

POST /users/reset-password
curl \
 -X POST /wp-json/hivepress/v1/users/reset-password \
 -H "Content-Type: application/json" \
 -d '{"username":"string","password":"string","password_reset_key":"string"}'
Request example
{
  "username": "string",
  "password": "string",
  "password_reset_key": "string"
}

Update a user

POST /users/{user_id}

In addition to the default user fields, you can also update custom fields added via the vendor attributes or HivePress extensions.

Path parameters

Body

Responses

POST /users/{user_id}
curl \
 -X POST /wp-json/hivepress/v1/users/{user_id} \
 -H "Content-Type: application/json" \
 -d '{"first_name":"string","last_name":"string","description":"string"}'
Request example
{
  "first_name": "string",
  "last_name": "string",
  "description": "string"
}

Delete a user

DELETE /users/{user_id}

Path parameters

DELETE /users/{user_id}
curl \
 -X DELETE /wp-json/hivepress/v1/users/{user_id}