Welcome to the Mewayz API documentation. Build powerful integrations and applications using our RESTful API.
The Mewayz API provides programmatic access to our platform, allowing you to build applications that interact with Mewayz data and functionality. Our API follows REST principles and returns JSON responses.
All API requests should be made to:
https://social.mewayz.com/api
Most API endpoints require authentication. We use API keys and OAuth 2.0 for authentication:
Authorization: Bearer YOUR_API_KEYImportant: Never share your API key publicly or commit it to version control.
POST /api/auth/login - Authenticate and obtain access tokenPOST /api/auth/refresh - Refresh access tokenPOST /api/auth/logout - Invalidate access tokenGET /api/user/profile - Get current user profilePUT /api/user/profile - Update user profileGET /api/user/{id} - Get user by IDGET /api/user/{id}/posts - Get user's postsGET /api/user/{id}/followers - Get user's followersGET /api/user/{id}/following - Get users followed by userGET /api/posts - Get posts feedPOST /api/posts - Create a new postGET /api/posts/{id} - Get post by IDPUT /api/posts/{id} - Update postDELETE /api/posts/{id} - Delete postPOST /api/posts/{id}/like - Like a postPOST /api/posts/{id}/comment - Comment on a postPOST /api/media/upload - Upload media fileGET /api/media/{id} - Get media by IDDELETE /api/media/{id} - Delete mediaAll requests should include:
Content-Type: application/jsonAccept: application/jsonAuthorization: Bearer YOUR_ACCESS_TOKEN (for authenticated endpoints)curl -X GET "https://social.mewayz.com/api/user/profile" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Accept: application/json"
Successful responses return a 200 status code with JSON data:
{
"success": true,
"data": {
"id": 123,
"username": "example_user",
"name": "Example User"
}
}
Errors return appropriate HTTP status codes with error details:
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid.",
"details": {
"email": ["The email field is required."]
}
}
}
To ensure fair usage and system stability, API requests are rate-limited:
Rate limit information is included in response headers:
X-RateLimit-Limit - Total requests allowedX-RateLimit-Remaining - Remaining requests in current windowX-RateLimit-Reset - Time when rate limit resets (Unix timestamp)When rate limits are exceeded, requests return a 429 status code.
List endpoints support pagination using query parameters:
page - Page number (default: 1)per_page - Items per page (default: 20, max: 100)Example:
GET /api/posts?page=2&per_page=50
Pagination metadata is included in the response:
{
"data": [...],
"pagination": {
"current_page": 2,
"per_page": 50,
"total": 150,
"last_page": 3
}
}
Subscribe to real-time events using webhooks:
Available webhook events:
user.created - New user registrationpost.created - New post publishedpost.updated - Post updatedpost.deleted - Post deletedcomment.created - New comment addedWe provide official SDKs for popular programming languages:
npm install @mewayz/sdkpip install mewayz-sdkcomposer require mewayz/sdkCommunity-maintained libraries may also be available. Check our GitHub organization for more resources.
By using the Mewayz API, you agree to:
Happy coding! If you have questions or need help, don't hesitate to reach out to our developer support team.