API Overview
Yeastar Management Plane (YMP) provides a REST API (Application Programming Interface) that allows the 3rd-party clients to manage the YMP system, YMP users, PBXs, and customers.
The following tables display all the REST API endpoints.
Authentication
| Function | HTTP Method | Endpoint |
| Request access token | POST | /oauth/token?client_id={client_id}&client_secret={client_secret}&grant_type=client_credentials |
| Refresh access token | POST | /oauth/token?grant_type=refresh_token&refresh_token={refresh_token} |
| Revoke refresh token | DELETE | /oauth/token/refresh_token?refresh_token={refresh_token}&client_id={client_id}&client_secret={client_secret} |
System
| Function | HTTP Method | Endpoint |
| Query the system capacity | GET | /api/v1/system/capacities |
Customers
| Function | HTTP Method | Endpoint |
| GET | /api/v1/pbx/customers | |
| Query a specific customer | GET | /api/v1/pbx/customers/{customer_id} |
| Create a customer | POST | /api/v1/pbx/customers |
| Modify a customer | PUT | /api/v1/pbx/customers/{customer_id} |
| Delete a customer | DELETE | /api/v1/pbx/customers/{customer_id} |
Manage Customers' PBXs
| Function | HTTP Method | Endpoint |
| Query all the PBXs | GET | /api/v1/pbx/instances |
| Query a specific PBX | GET | /api/v1/pbx/instances/{instance_id} |
| Query available PBX versions | GET | /api/v1/pbx/versions |
| Create a PBX | POST | /api/v1/pbx/instances |
| Enable/Disable PBX advanced features | PUT | /api/v1/pbx/instances/{instance_id}/advanced_features |
| Resize PBX capacity | PUT | /api/v1/pbx/instances/{instance_id}/capacities |
| Start a PBX | POST | /api/v1/pbx/instances/{instance_id}/start |
| Send a PBX activation email | POST | /api/v1/pbx/instances/{instance_id}/send_pbx_info |
| Stop a PBX | POST | /api/v1/pbx/instances/{instance_id}/stop |
| Reboot a PBX | POST | /api/v1/pbx/instances/{instance_id}/restart |
| Delete a PBX | DELETE | /api/v1/pbx/instances/{instance_id} |
User endpoints
| Function | HTTP Method | End Point |
| Query all the YMP users | GET | /api/v1/system/users |
| Query a specific YMP user | GET | /api/v1/system/users/{user_id} |
| Create a hosting user | POST | /api/v1/system/users |
| Change a hosting user's system capacity | PUT | /api/v1/system/users/{user_id}/capacities |
| Delete a YMP user | DELETE | /api/v1/system/users/{user_id} |