Airbnb-Style Rental Marketplace Backend - REST API Reference

Complete REST API documentation for all services in Airbnb-Style Rental Marketplace Backend

This document provides comprehensive REST API documentation for all services. Use this reference to understand available endpoints, request/response formats, and authentication requirements.


Table of Contents


Introduction

Airbnb-Style Rental Marketplace Backend

Version : 1.0.108

airbnb is a global platform enabling hosts to list properties and guests to book short-term stays with secure payments, messaging, and review systems. It connects hosts and guests through a robust travel/hospitality marketplace, handling authentication, bookings, payments, and moderation. The backend supports global operations with multi-language and multi-currency features…

How to Use Project Documents

The Airbnb project has been designed and generated using Mindbricks, a powerful microservice-based backend generation platform. All documentation is automatically produced by the Mindbricks Genesis Engine, based on the high-level architectural patterns defined by the user or inferred by AI.

This documentation set is intended for both AI agents and human developers—including frontend and backend engineers—who need precise and structured information about how to interact with the backend services of this project. Each document reflects the live architecture of the system, providing a reliable reference for API consumption, data models, authentication flows, and business logic.

By following this documentation, developers can seamlessly integrate with the backend, while AI agents can use it to reason about the service structure, make accurate decisions, or even generate compatible client-side code.

Accessing Project Services

Each service generated by Mindbricks is exposed via a dedicated REST API endpoint. Every service documentation set includes the base URL of that service along with the specific API paths for each available route.

Before consuming any API, developers or agents must understand the service URL structure and environment-specific endpoints.

Service Endpoint Structure

Environment URL Pattern Example
Preview https://airbnb3.prw.mindbricks.com/auth-api
Staging https://airbnb3-stage.mindbricks.co/auth-api
Production https://airbnb3.mindbricks.co/auth-api

Replace auth with the actual service name as lower case (e.g., order-api, bff-service, customermanagement-api etc.).

Environment Usage Notes

Frontend applications should be designed to easily switch between environments, allowing dynamic endpoint targeting for Preview, Staging, and Production.

Getting Started: Use the Auth Service First

Before interacting with other services in the Airbnb project, AI agents and developers should begin by integrating with the Auth Service.

Mindbricks automatically generates a dedicated authentication microservice based on the project’s authentication definitions provided by the architect. This service provides the essential user and access management foundation for the project.

Agents should first utilize the Auth Service to:

Auth Service Documentation

Use the following resources to understand and integrate the Auth Service:

Note: For most frontend use cases, the REST API Guide will be the primary source. The Event Guide and Service Design documents are especially useful when integrating with other backend microservices or building systems that interact with the auth service indirectly.

Using the BFF (Backend-for-Frontend) Service

In Mindbricks, all backend services are designed with an advanced CQRS (Command Query Responsibility Segregation) architecture. Within this architecture, business services are responsible for managing their respective domains and ensuring the accuracy and freshness of domain data.

The BFF service complements these business services by providing a read-only aggregation and query layer tailored specifically for frontend and client-side applications.

Key Principles of the BFF Service

BFF Service Documentation

Tip: Use the BFF service as the main entry point for all frontend data queries. It simplifies access, reduces round-trips, and ensures that data is shaped appropriately for the UI layer.

Business Services Overview

The Airbnb-Style Rental Marketplace Backend project consists of multiple business services, each responsible for managing a specific domain within the system. These services expose their own REST APIs and documentation sets, and are accessible based on the environment (Preview, Staging, Production).

Usage Guidance

Business services are primarily designed to:

For advanced query needs across multiple services or aggregated views, prefer using the BFF service.

Available Business Services

messaging Service

Description: Enables secure in-app messaging between guests and hosts. Handles threads, messages (with text/media/system types), abuse flagging, and admin moderation for resolution…

Documentation:

Base URL Examples:

Environment URL
Preview https://airbnb3.prw.mindbricks.com/messaging-api
Staging https://airbnb3-stage.mindbricks.co/messaging-api
Production https://airbnb3.mindbricks.co/messaging-api

propertyCatalog Service

Description: Service for management of property listings, calendars, amenities, and localization for a short-term rental marketplace. Hosts can manage listings, availability, multi-language descriptions, policies, pricing, and attributes, served for global search and discovery…

Documentation:

Base URL Examples:

Environment URL
Preview https://airbnb3.prw.mindbricks.com/propertycatalog-api
Staging https://airbnb3-stage.mindbricks.co/propertycatalog-api
Production https://airbnb3.mindbricks.co/propertycatalog-api

bookingManagement Service

Description: Orchestrates booking, payment, calendar, changewsand dispute flows for Airbnb-style short-term rental marketplace…test Handles reservations, approval, Stripe payments, iCal sync, payment records, and the dispute/refund lifecycle with host/guest/admin visibility.

Documentation:

Base URL Examples:

Environment URL
Preview https://airbnb3.prw.mindbricks.com/bookingmanagement-api
Staging https://airbnb3-stage.mindbricks.co/bookingmanagement-api
Production https://airbnb3.mindbricks.co/bookingmanagement-api

reviewSystem Service

Description: Handles double-blind, moderated reviews and rating aggregation for stays. Allows guests/hosts to review each other and listings, supports moderation, and exposes aggregate stats for listings/profiles…

Documentation:

Base URL Examples:

Environment URL
Preview https://airbnb3.prw.mindbricks.com/reviewsystem-api
Staging https://airbnb3-stage.mindbricks.co/reviewsystem-api
Production https://airbnb3.mindbricks.co/reviewsystem-api

platformAdmin Service

Description: Administrative and compliance management backend for moderation, audit, dispute, financial oversight, localization, and GDPR in the Airbnb-style rental platform.

Documentation:

Base URL Examples:

Environment URL
Preview https://airbnb3.prw.mindbricks.com/platformadmin-api
Staging https://airbnb3-stage.mindbricks.co/platformadmin-api
Production https://airbnb3.mindbricks.co/platformadmin-api

agentHub Service

Description: AI Agent Hub

Documentation:

Base URL Examples:

Environment URL
Preview https://airbnb3.prw.mindbricks.com/agenthub-api
Staging https://airbnb3-stage.mindbricks.co/agenthub-api
Production https://airbnb3.mindbricks.co/agenthub-api

Connect via MCP (Model Context Protocol)

All backend services in the Airbnb project expose their Business APIs as MCP tools. These tools are aggregated by the MCP-BFF service into a single unified endpoint that external AI tools can connect to.

Unified MCP Endpoint

Environment StreamableHTTP (recommended) SSE (legacy fallback)
Preview https://airbnb3.prw.mindbricks.com/mcpbff-api/mcp https://airbnb3.prw.mindbricks.com/mcpbff-api/mcp/sse
Staging https://airbnb3-stage.mindbricks.co/mcpbff-api/mcp https://airbnb3-stage.mindbricks.co/mcpbff-api/mcp/sse
Production https://airbnb3.mindbricks.co/mcpbff-api/mcp https://airbnb3.mindbricks.co/mcpbff-api/mcp/sse

Authentication

MCP connections require authentication via the Authorization header:

OAuth is not supported for MCP connections at this time.

Connecting from Cursor

Add the following to your project’s .cursor/mcp.json:

{
  "mcpServers": {
    "airbnb3": {
      "url": "https://airbnb3.prw.mindbricks.com/mcpbff-api/mcp",
      "headers": {
        "Authorization": "Bearer sk_mbx_your_api_key_here"
      }
    }
  }
}

Connecting from Claude Desktop

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "airbnb3": {
      "url": "https://airbnb3.prw.mindbricks.com/mcpbff-api/mcp",
      "headers": {
        "Authorization": "Bearer sk_mbx_your_api_key_here"
      }
    }
  }
}

What’s Available

Once connected, the AI tool can discover and call all Business API tools from all services — CRUD operations, custom queries, file operations, and more. The MCP-BFF handles routing each tool call to the correct backend service and propagates your authentication context.


Conclusion

This documentation set provides a comprehensive guide for understanding and consuming the Airbnb-Style Rental Marketplace Backend backend, generated by the Mindbricks platform. It is structured to support both AI agents and human developers in navigating authentication, data access, service responsibilities, and system architecture.

To summarize:

Each service offers a complete set of documentation—REST API guides, event interface definitions, and design insights—to help you integrate efficiently and confidently.

Whether you are building a frontend application, configuring an automation agent, or simply exploring the architecture, this documentation is your primary reference for working with the backend of this project.

For environment-specific access, ensure you’re using the correct base URLs (Preview, Staging, Production), and coordinate with the project owner for any custom deployments.


Service API Documentation

REST API GUIDE

airbnb-auth-service

Version: 1.0.8

Authentication service for the project

Architectural Design Credit and Contact Information

The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to:

Email:

We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice.

Documentation Scope

Welcome to the official documentation for the Auth Service’s REST API. This document is designed to provide a comprehensive guide to interfacing with our Auth Service exclusively through RESTful API endpoints.

Intended Audience

This documentation is intended for developers and integrators who are looking to interact with the Auth Service via HTTP requests for purposes such as creating, updating, deleting and querying Auth objects.

Overview

Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases.

Beyond REST It’s important to note that the Auth Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation.

Authentication And Authorization

To ensure secure access to the Auth service’s protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it’s important to note that access control varies across different routes:

Protected API: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected.

**Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token.

Token Locations

When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters.

Location Token Name / Param Name
Query access_token
Authorization Header Bearer
Header airbnb3-access-token
Cookie airbnb3-access-token

Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies.

Api Definitions

This section outlines the API endpoints available within the Auth service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It’s important to understand the flexibility in how parameters can be included in requests to effectively interact with the Auth service.

This service is configured to listen for HTTP requests on port 3011, serving both the main API interface and default administrative endpoints.

The following routes are available by default:

This service is accessible via the following environment-specific URLs:

Parameter Inclusion Methods: Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests:

Query Parameters: Included directly in the URL’s query string.

Path Parameters: Embedded within the URL’s path.

Body Parameters: Sent within the JSON body of the request.

Session Parameters: Automatically read from the session object. This method is used for parameters that are intrinsic to the user’s session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request.

Note on Session Parameters: Session parameters represent a unique method of parameter inclusion, relying on the context of the user’s session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request.

By adhering to the specified parameter inclusion methods, you can effectively utilize the Auth service’s API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below.

Common Parameters

The Auth service’s business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL.

Supported Common Parameters:

By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the Auth service.

Error Response

If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity:

Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently.

{
  "result": "ERR",
  "status": 400,
  "message": "errMsg_organizationIdisNotAValidID",
  "errCode": 400,
  "date": "2024-03-19T12:13:54.124Z",
  "detail": "String"
}

Object Structure of a Successfull Response

When the Auth service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client.

Key Characteristics of the Response Envelope:

Design Considerations: The structure of a API’s response data is meticulously crafted during the service’s architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information.

Brief Data: Certain API’s return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect.

API Response Structure

The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response.

HTTP Status Codes:

Success Response Format:

For successful operations, the response includes a "status": "OK" property, signaling the successful execution of the request. The structure of a successful response is outlined below:

{
  "status":"OK",
  "statusCode": 200,   
  "elapsedMs":126,
  "ssoTime":120,
  "source": "db",
  "cacheKey": "hexCode",
  "userId": "ID",
  "sessionId": "ID",
  "requestId": "ID",
  "dataName":"products",
  "method":"GET",
  "action":"list",
  "appVersion":"Version",
  "rowCount":3
  "products":[{},{},{}],
  "paging": {
    "pageNumber":1, 
    "pageRowCount":25, 
    "totalRowCount":3,
    "pageCount":1
  },
  "filters": [],
  "uiPermissions": []
}

Handling Errors:

For details on handling error scenarios and understanding the structure of error responses, please refer to the “Error Response” section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages.

Resources

Auth service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service.

User resource

Resource Definition : A data object that stores the user information and handles login settings. User Resource Properties

Name Type Required Default Definition
email String * A string value to represent the user's email.*
password String * A string value to represent the user's password. It will be stored as hashed.*
fullname String A string value to represent the fullname of the user
avatar String The avatar url of the user. A random avatar will be generated if not provided
roleId String A string value to represent the roleId of the user.
emailVerified Boolean A boolean value to represent the email verification status of the user.
preferredLanguage String User's preferred language for the application interface
bio Text User's biography or profile description

UserGroup resource

Resource Definition : A data object that stores the user group information. UserGroup Resource Properties

Name Type Required Default Definition
groupName String * A string value to represent the group name.*
avatar String * A string value to represent the groups icon.*

UserGroupMember resource

Resource Definition : A data object that stores the members of the user group. UserGroupMember Resource Properties

Name Type Required Default Definition
groupId ID * An ID value to represent the group that the user is asssigned as a memeber to.*
userId ID * An ID value to represent the user that is assgined as a member to the group.*
ownerId ID An ID value to represent the admin user who assgined the member.

UserAvatarsFile resource

Resource Definition : Auto-generated file storage for the userAvatars database bucket. Files are stored as BYTEA in PostgreSQL. UserAvatarsFile Resource Properties

Name Type Required Default Definition
fileName String Original file name as uploaded by the client.
mimeType String MIME type of the uploaded file (e.g., image/png, application/pdf).
fileSize Integer File size in bytes.
accessKey String 12-character random key for shareable access. Auto-generated on upload.
ownerId ID ID of the user who uploaded the file (from session).
fileData Blob Binary file content. Stored as BYTEA in PostgreSQL or Buffer in MongoDB.
metadata Object Optional JSON metadata for the file (tags, alt text, etc.).
userId ID Reference to the owner user record.

Business Api

Get User API

This api is used by admin roles or the users themselves to get the user profile information.

Rest Route

The getUser API REST controller can be triggered via the following route:

/v1/users/:userId

Rest Request Parameters

The getUser api has got 1 regular request parameter

Parameter Type Required Population
userId ID true request.params?.[“userId”]
userId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/users/:userId

  axios({
    method: 'GET',
    url: `/v1/users/${userId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "user",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"user": {
		"id": "ID",
		"email": "String",
		"password": "String",
		"fullname": "String",
		"avatar": "String",
		"roleId": "String",
		"emailVerified": "Boolean",
		"preferredLanguage": "String",
		"bio": "Text",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update User API

This route is used by admins to update user profiles.

Rest Route

The updateUser API REST controller can be triggered via the following route:

/v1/users/:userId

Rest Request Parameters

The updateUser api has got 5 regular request parameters

Parameter Type Required Population
userId ID true request.params?.[“userId”]
fullname String false request.body?.[“fullname”]
avatar String false request.body?.[“avatar”]
preferredLanguage String false request.body?.[“preferredLanguage”]
bio Text false request.body?.[“bio”]
userId : This id paremeter is used to select the required data object that will be updated
fullname : A string value to represent the fullname of the user
avatar : The avatar url of the user. A random avatar will be generated if not provided
preferredLanguage : User’s preferred language for the application interface
bio : User’s biography or profile description

REST Request To access the api you can use the REST controller with the path PATCH /v1/users/:userId

  axios({
    method: 'PATCH',
    url: `/v1/users/${userId}`,
    data: {
            fullname:"String",  
            avatar:"String",  
            preferredLanguage:"String",  
            bio:"Text",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "user",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"user": {
		"id": "ID",
		"email": "String",
		"password": "String",
		"fullname": "String",
		"avatar": "String",
		"roleId": "String",
		"emailVerified": "Boolean",
		"preferredLanguage": "String",
		"bio": "Text",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Profile API

This route is used by users to update their profiles.

Rest Route

The updateProfile API REST controller can be triggered via the following route:

/v1/profile/:userId

Rest Request Parameters

The updateProfile api has got 5 regular request parameters

Parameter Type Required Population
userId ID true request.params?.[“userId”]
fullname String false request.body?.[“fullname”]
avatar String false request.body?.[“avatar”]
preferredLanguage String false request.body?.[“preferredLanguage”]
bio Text false request.body?.[“bio”]
userId : This id paremeter is used to select the required data object that will be updated
fullname : A string value to represent the fullname of the user
avatar : The avatar url of the user. A random avatar will be generated if not provided
preferredLanguage : User’s preferred language for the application interface
bio : User’s biography or profile description

REST Request To access the api you can use the REST controller with the path PATCH /v1/profile/:userId

  axios({
    method: 'PATCH',
    url: `/v1/profile/${userId}`,
    data: {
            fullname:"String",  
            avatar:"String",  
            preferredLanguage:"String",  
            bio:"Text",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "user",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"user": {
		"id": "ID",
		"email": "String",
		"password": "String",
		"fullname": "String",
		"avatar": "String",
		"roleId": "String",
		"emailVerified": "Boolean",
		"preferredLanguage": "String",
		"bio": "Text",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Create User API

This api is used by admin roles to create a new user manually from admin panels

Rest Route

The createUser API REST controller can be triggered via the following route:

/v1/users

Rest Request Parameters

The createUser api has got 6 regular request parameters

Parameter Type Required Population
avatar String false request.body?.[“avatar”]
email String true request.body?.[“email”]
password String true request.body?.[“password”]
fullname String true request.body?.[“fullname”]
preferredLanguage String false request.body?.[“preferredLanguage”]
bio Text false request.body?.[“bio”]
avatar : The avatar url of the user. If not sent, a default random one will be generated.
email : A string value to represent the user’s email.
password : A string value to represent the user’s password. It will be stored as hashed.
fullname : A string value to represent the fullname of the user
preferredLanguage : User’s preferred language for the application interface
bio : User’s biography or profile description

REST Request To access the api you can use the REST controller with the path POST /v1/users

  axios({
    method: 'POST',
    url: '/v1/users',
    data: {
            avatar:"String",  
            email:"String",  
            password:"String",  
            fullname:"String",  
            preferredLanguage:"String",  
            bio:"Text",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "user",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"user": {
		"id": "ID",
		"email": "String",
		"password": "String",
		"fullname": "String",
		"avatar": "String",
		"roleId": "String",
		"emailVerified": "Boolean",
		"preferredLanguage": "String",
		"bio": "Text",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete User API

This api is used by admins to delete user profiles.

Rest Route

The deleteUser API REST controller can be triggered via the following route:

/v1/users/:userId

Rest Request Parameters

The deleteUser api has got 1 regular request parameter

Parameter Type Required Population
userId ID true request.params?.[“userId”]
userId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/users/:userId

  axios({
    method: 'DELETE',
    url: `/v1/users/${userId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "user",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"user": {
		"id": "ID",
		"email": "String",
		"password": "String",
		"fullname": "String",
		"avatar": "String",
		"roleId": "String",
		"emailVerified": "Boolean",
		"preferredLanguage": "String",
		"bio": "Text",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Archive Profile API

This api is used by users to archive their profiles.

Rest Route

The archiveProfile API REST controller can be triggered via the following route:

/v1/archiveprofile/:userId

Rest Request Parameters

The archiveProfile api has got 1 regular request parameter

Parameter Type Required Population
userId ID true request.params?.[“userId”]
userId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/archiveprofile/:userId

  axios({
    method: 'DELETE',
    url: `/v1/archiveprofile/${userId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "user",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"user": {
		"id": "ID",
		"email": "String",
		"password": "String",
		"fullname": "String",
		"avatar": "String",
		"roleId": "String",
		"emailVerified": "Boolean",
		"preferredLanguage": "String",
		"bio": "Text",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Users API

The list of users is filtered by the tenantId.

Rest Route

The listUsers API REST controller can be triggered via the following route:

/v1/users

Rest Request Parameters

Filter Parameters

The listUsers api supports 3 optional filter parameters for filtering list results:

email (String): A string value to represent the user’s email.

fullname (String): A string value to represent the fullname of the user

roleId (String): A string value to represent the roleId of the user.

REST Request To access the api you can use the REST controller with the path GET /v1/users

  axios({
    method: 'GET',
    url: '/v1/users',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // email: '<value>' // Filter by email
        // fullname: '<value>' // Filter by fullname
        // roleId: '<value>' // Filter by roleId
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "users",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"users": [
		{
			"id": "ID",
			"email": "String",
			"password": "String",
			"fullname": "String",
			"avatar": "String",
			"roleId": "String",
			"emailVerified": "Boolean",
			"preferredLanguage": "String",
			"bio": "Text",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Search Users API

The list of users is filtered by the tenantId.

Rest Route

The searchUsers API REST controller can be triggered via the following route:

/v1/searchusers

Rest Request Parameters

The searchUsers api has got 1 regular request parameter

Parameter Type Required Population
keyword String true request.query?.[“keyword”]
keyword :

Filter Parameters

The searchUsers api supports 1 optional filter parameter for filtering list results:

roleId (String): A string value to represent the roleId of the user.

REST Request To access the api you can use the REST controller with the path GET /v1/searchusers

  axios({
    method: 'GET',
    url: '/v1/searchusers',
    data: {
    
    },
    params: {
             keyword:'"String"',  
    
        // Filter parameters (see Filter Parameters section above)
        // roleId: '<value>' // Filter by roleId
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "users",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"users": [
		{
			"id": "ID",
			"email": "String",
			"password": "String",
			"fullname": "String",
			"avatar": "String",
			"roleId": "String",
			"emailVerified": "Boolean",
			"preferredLanguage": "String",
			"bio": "Text",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Update Userrole API

This route is used by admin roles to update the user role.The default role is user when a user is registered. A user’s role can be updated by superAdmin or admin

Rest Route

The updateUserRole API REST controller can be triggered via the following route:

/v1/userrole/:userId

Rest Request Parameters

The updateUserRole api has got 2 regular request parameters

Parameter Type Required Population
userId ID true request.params?.[“userId”]
roleId String true request.body?.[“roleId”]
userId : This id paremeter is used to select the required data object that will be updated
roleId : The new roleId of the user to be updated

REST Request To access the api you can use the REST controller with the path PATCH /v1/userrole/:userId

  axios({
    method: 'PATCH',
    url: `/v1/userrole/${userId}`,
    data: {
            roleId:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "user",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"user": {
		"id": "ID",
		"email": "String",
		"password": "String",
		"fullname": "String",
		"avatar": "String",
		"roleId": "String",
		"emailVerified": "Boolean",
		"preferredLanguage": "String",
		"bio": "Text",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Userpassword API

This route is used to update the password of users in the profile page by users themselves

Rest Route

The updateUserPassword API REST controller can be triggered via the following route:

/v1/userpassword/:userId

Rest Request Parameters

The updateUserPassword api has got 3 regular request parameters

Parameter Type Required Population
userId ID true request.params?.[“userId”]
oldPassword String true request.body?.[“oldPassword”]
newPassword String true request.body?.[“newPassword”]
userId : This id paremeter is used to select the required data object that will be updated
oldPassword : The old password of the user that will be overridden bu the new one. Send for double check.
newPassword : The new password of the user to be updated

REST Request To access the api you can use the REST controller with the path PATCH /v1/userpassword/:userId

  axios({
    method: 'PATCH',
    url: `/v1/userpassword/${userId}`,
    data: {
            oldPassword:"String",  
            newPassword:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "user",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"user": {
		"id": "ID",
		"email": "String",
		"password": "String",
		"fullname": "String",
		"avatar": "String",
		"roleId": "String",
		"emailVerified": "Boolean",
		"preferredLanguage": "String",
		"bio": "Text",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Userpasswordbyadmin API

This route is used to change any user password by admins only. Superadmin can chnage all passwords, admins can change only nonadmin passwords

Rest Route

The updateUserPasswordByAdmin API REST controller can be triggered via the following route:

/v1/userpasswordbyadmin/:userId

Rest Request Parameters

The updateUserPasswordByAdmin api has got 2 regular request parameters

Parameter Type Required Population
userId ID true request.params?.[“userId”]
password String true request.body?.[“password”]
userId : This id paremeter is used to select the required data object that will be updated
password : The new password of the user to be updated

REST Request To access the api you can use the REST controller with the path PATCH /v1/userpasswordbyadmin/:userId

  axios({
    method: 'PATCH',
    url: `/v1/userpasswordbyadmin/${userId}`,
    data: {
            password:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "user",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"user": {
		"id": "ID",
		"email": "String",
		"password": "String",
		"fullname": "String",
		"avatar": "String",
		"roleId": "String",
		"emailVerified": "Boolean",
		"preferredLanguage": "String",
		"bio": "Text",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Briefuser API

This route is used by public to get simple user profile information.

Rest Route

The getBriefUser API REST controller can be triggered via the following route:

/v1/briefuser/:userId

Rest Request Parameters

The getBriefUser api has got 1 regular request parameter

Parameter Type Required Population
userId ID true request.params?.[“userId”]
userId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/briefuser/:userId

  axios({
    method: 'GET',
    url: `/v1/briefuser/${userId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

This route’s response is constrained to a select list of properties, and therefore does not encompass all attributes of the resource.

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "user",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"user": {
		"isActive": true
	}
}

Stream Test API

Test API for iterator action streaming via SSE.

Rest Route

The streamTest API REST controller can be triggered via the following route:

/v1/streamtest/:userId

Rest Request Parameters

The streamTest api has got 1 regular request parameter

Parameter Type Required Population
userId ID true request.params?.[“userId”]
userId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/streamtest/:userId

  axios({
    method: 'GET',
    url: `/v1/streamtest/${userId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "user",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"user": {
		"id": "ID",
		"email": "String",
		"password": "String",
		"fullname": "String",
		"avatar": "String",
		"roleId": "String",
		"emailVerified": "Boolean",
		"preferredLanguage": "String",
		"bio": "Text",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Register User API

This api is used by public users to register themselves

Rest Route

The registerUser API REST controller can be triggered via the following route:

/v1/registeruser

Rest Request Parameters

The registerUser api has got 6 regular request parameters

Parameter Type Required Population
avatar String false request.body?.[“avatar”]
password String true request.body?.[“password”]
fullname String true request.body?.[“fullname”]
email String true request.body?.[“email”]
preferredLanguage String false request.body?.[“preferredLanguage”]
bio Text false request.body?.[“bio”]
avatar : The avatar url of the user. If not sent, a default random one will be generated.
password : The password defined by the the user that is being registered.
fullname : The fullname defined by the the user that is being registered.
email : The email defined by the the user that is being registered.
preferredLanguage : User’s preferred language for the application interface
bio : User’s biography or profile description

REST Request To access the api you can use the REST controller with the path POST /v1/registeruser

  axios({
    method: 'POST',
    url: '/v1/registeruser',
    data: {
            avatar:"String",  
            password:"String",  
            fullname:"String",  
            email:"String",  
            preferredLanguage:"String",  
            bio:"Text",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "user",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"user": {
		"id": "ID",
		"email": "String",
		"password": "String",
		"fullname": "String",
		"avatar": "String",
		"roleId": "String",
		"emailVerified": "Boolean",
		"preferredLanguage": "String",
		"bio": "Text",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Create Usergroup API

This route is used by admin roles to create a new usergroup manually from admin panels

Rest Route

The createUserGroup API REST controller can be triggered via the following route:

/v1/usergroups

Rest Request Parameters

The createUserGroup api has got 2 regular request parameters

Parameter Type Required Population
avatar String false request.body?.[“avatar”]
groupName String true request.body?.[“groupName”]
avatar : A string value to represent the groups icon.
groupName : A string value to represent the group name.

REST Request To access the api you can use the REST controller with the path POST /v1/usergroups

  axios({
    method: 'POST',
    url: '/v1/usergroups',
    data: {
            avatar:"String",  
            groupName:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "userGroup",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"userGroup": {
		"id": "ID",
		"groupName": "String",
		"avatar": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Usergroup API

This route is used by admin to update user groups.

Rest Route

The updateUserGroup API REST controller can be triggered via the following route:

/v1/usergroups/:userGroupId

Rest Request Parameters

The updateUserGroup api has got 3 regular request parameters

Parameter Type Required Population
userGroupId ID true request.params?.[“userGroupId”]
groupName String false request.body?.[“groupName”]
avatar String false request.body?.[“avatar”]
userGroupId : This id paremeter is used to select the required data object that will be updated
groupName : A string value to represent the group name.
avatar : A string value to represent the groups icon.

REST Request To access the api you can use the REST controller with the path PATCH /v1/usergroups/:userGroupId

  axios({
    method: 'PATCH',
    url: `/v1/usergroups/${userGroupId}`,
    data: {
            groupName:"String",  
            avatar:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "userGroup",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"userGroup": {
		"id": "ID",
		"groupName": "String",
		"avatar": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete Usergroup API

This route is used by admin to delete a user group.

Rest Route

The deleteUserGroup API REST controller can be triggered via the following route:

/v1/usergroups/:userGroupId

Rest Request Parameters

The deleteUserGroup api has got 1 regular request parameter

Parameter Type Required Population
userGroupId ID true request.params?.[“userGroupId”]
userGroupId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/usergroups/:userGroupId

  axios({
    method: 'DELETE',
    url: `/v1/usergroups/${userGroupId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "userGroup",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"userGroup": {
		"id": "ID",
		"groupName": "String",
		"avatar": "String",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Usergroup API

This is a public route to get the user group information.

Rest Route

The getUserGroup API REST controller can be triggered via the following route:

/v1/usergroups/:userGroupId

Rest Request Parameters

The getUserGroup api has got 1 regular request parameter

Parameter Type Required Population
userGroupId ID true request.params?.[“userGroupId”]
userGroupId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/usergroups/:userGroupId

  axios({
    method: 'GET',
    url: `/v1/usergroups/${userGroupId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "userGroup",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"userGroup": {
		"id": "ID",
		"groupName": "String",
		"avatar": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Usergroups API

This is a public route to get the list of groups.

Rest Route

The listUserGroups API REST controller can be triggered via the following route:

/v1/usergroups

Rest Request Parameters

Filter Parameters

The listUserGroups api supports 2 optional filter parameters for filtering list results:

groupName (String): A string value to represent the group name.

avatar (String): A string value to represent the groups icon.

REST Request To access the api you can use the REST controller with the path GET /v1/usergroups

  axios({
    method: 'GET',
    url: '/v1/usergroups',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // groupName: '<value>' // Filter by groupName
        // avatar: '<value>' // Filter by avatar
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "userGroups",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"userGroups": [
		{
			"id": "ID",
			"groupName": "String",
			"avatar": "String",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Get Usergroupmember API

This is a public route to get the user group member information.

Rest Route

The getUserGroupMember API REST controller can be triggered via the following route:

/v1/usergroupmembers/:userGroupMemberId

Rest Request Parameters

The getUserGroupMember api has got 1 regular request parameter

Parameter Type Required Population
userGroupMemberId ID true request.params?.[“userGroupMemberId”]
userGroupMemberId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/usergroupmembers/:userGroupMemberId

  axios({
    method: 'GET',
    url: `/v1/usergroupmembers/${userGroupMemberId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "userGroupMember",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"userGroupMember": {
		"id": "ID",
		"groupId": "ID",
		"userId": "ID",
		"ownerId": "ID",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Create Usergroupmember API

This route is used by admin roles to add a user to a group.

Rest Route

The createUserGroupMember API REST controller can be triggered via the following route:

/v1/usergroupmembers

Rest Request Parameters

The createUserGroupMember api has got 2 regular request parameters

Parameter Type Required Population
groupId ID true request.body?.[“groupId”]
userId ID true request.body?.[“userId”]
groupId : An ID value to represent the group that the user is asssigned as a memeber to.
userId : An ID value to represent the user that is assgined as a member to the group.

REST Request To access the api you can use the REST controller with the path POST /v1/usergroupmembers

  axios({
    method: 'POST',
    url: '/v1/usergroupmembers',
    data: {
            groupId:"ID",  
            userId:"ID",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "userGroupMember",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"userGroupMember": {
		"id": "ID",
		"groupId": "ID",
		"userId": "ID",
		"ownerId": "ID",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete Usergroupmember API

This route is used by admin to delete a member from a group.

Rest Route

The deleteUserGroupMember API REST controller can be triggered via the following route:

/v1/usergroupmembers/:userGroupMemberId

Rest Request Parameters

The deleteUserGroupMember api has got 1 regular request parameter

Parameter Type Required Population
userGroupMemberId ID true request.params?.[“userGroupMemberId”]
userGroupMemberId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/usergroupmembers/:userGroupMemberId

  axios({
    method: 'DELETE',
    url: `/v1/usergroupmembers/${userGroupMemberId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "userGroupMember",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"userGroupMember": {
		"id": "ID",
		"groupId": "ID",
		"userId": "ID",
		"ownerId": "ID",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Usergroupmembers API

This is a public route to get the list of group members of a group.

Rest Route

The listUserGroupMembers API REST controller can be triggered via the following route:

/v1/listusergroupmembers/:groupId

Rest Request Parameters

The listUserGroupMembers api has got 1 regular request parameter

Parameter Type Required Population
groupId ID true request.params?.[“groupId”]
groupId : An ID value to represent the group that the user is asssigned as a memeber to… The parameter is used to query data.

Filter Parameters

The listUserGroupMembers api supports 2 optional filter parameters for filtering list results:

userId (ID): An ID value to represent the user that is assgined as a member to the group.

ownerId (ID): An ID value to represent the admin user who assgined the member.

REST Request To access the api you can use the REST controller with the path GET /v1/listusergroupmembers/:groupId

  axios({
    method: 'GET',
    url: `/v1/listusergroupmembers/${groupId}`,
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // userId: '<value>' // Filter by userId
        // ownerId: '<value>' // Filter by ownerId
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "userGroupMembers",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"userGroupMembers": [
		{
			"id": "ID",
			"groupId": "ID",
			"userId": "ID",
			"ownerId": "ID",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"user": [
				{
					"email": "String",
					"fullname": "String",
					"avatar": "String"
				},
				{},
				{}
			]
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Get Useravatarsfile API

[Default get API] — This is the designated default get API for the userAvatarsFile data object. Frontend generators and AI agents should use this API for standard CRUD operations.

Rest Route

The getUserAvatarsFile API REST controller can be triggered via the following route:

/v1/useravatarsfiles/:userAvatarsFileId

Rest Request Parameters

The getUserAvatarsFile api has got 1 regular request parameter

Parameter Type Required Population
userAvatarsFileId ID true request.params?.[“userAvatarsFileId”]
userAvatarsFileId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/useravatarsfiles/:userAvatarsFileId

  axios({
    method: 'GET',
    url: `/v1/useravatarsfiles/${userAvatarsFileId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "userAvatarsFile",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"userAvatarsFile": {
		"id": "ID",
		"fileName": "String",
		"mimeType": "String",
		"fileSize": "Integer",
		"accessKey": "String",
		"ownerId": "ID",
		"fileData": "Blob",
		"metadata": "Object",
		"userId": "ID",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": true
	}
}

List Useravatarsfiles API

[Default list API] — This is the designated default list API for the userAvatarsFile data object. Frontend generators and AI agents should use this API for standard CRUD operations.

Rest Route

The listUserAvatarsFiles API REST controller can be triggered via the following route:

/v1/useravatarsfiles

Rest Request Parameters

Filter Parameters

The listUserAvatarsFiles api supports 3 optional filter parameters for filtering list results:

mimeType (String): MIME type of the uploaded file (e.g., image/png, application/pdf).

ownerId (ID): ID of the user who uploaded the file (from session).

userId (ID): Reference to the owner user record.

REST Request To access the api you can use the REST controller with the path GET /v1/useravatarsfiles

  axios({
    method: 'GET',
    url: '/v1/useravatarsfiles',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // mimeType: '<value>' // Filter by mimeType
        // ownerId: '<value>' // Filter by ownerId
        // userId: '<value>' // Filter by userId
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "userAvatarsFiles",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"userAvatarsFiles": [
		{
			"id": "ID",
			"fileName": "String",
			"mimeType": "String",
			"fileSize": "Integer",
			"accessKey": "String",
			"ownerId": "ID",
			"fileData": "Blob",
			"metadata": "Object",
			"userId": "ID",
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Delete Useravatarsfile API

[Default delete API] — This is the designated default delete API for the userAvatarsFile data object. Frontend generators and AI agents should use this API for standard CRUD operations.

Rest Route

The deleteUserAvatarsFile API REST controller can be triggered via the following route:

/v1/useravatarsfiles/:userAvatarsFileId

Rest Request Parameters

The deleteUserAvatarsFile api has got 1 regular request parameter

Parameter Type Required Population
userAvatarsFileId ID true request.params?.[“userAvatarsFileId”]
userAvatarsFileId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/useravatarsfiles/:userAvatarsFileId

  axios({
    method: 'DELETE',
    url: `/v1/useravatarsfiles/${userAvatarsFileId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "userAvatarsFile",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"userAvatarsFile": {
		"id": "ID",
		"fileName": "String",
		"mimeType": "String",
		"fileSize": "Integer",
		"accessKey": "String",
		"ownerId": "ID",
		"fileData": "Blob",
		"metadata": "Object",
		"userId": "ID",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": false
	}
}

Authentication Specific Routes

Route: login

Route Definition: Handles the login process by verifying user credentials and generating an authenticated session.

Route Type: login

Access Routes:

Parameters

Parameter Type Required Population
username String Yes request.body.username
password String Yes request.body.password

Notes

// Sample POST /login call
axios.post("/login", {
  username: "user@example.com",
  password: "securePassword"
});

Success Response

Returns the authenticated session object with a status code 200 OK.

A secure HTTP-only cookie and an access token header are included in the response.

{
  "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
  "email": "user@example.com",
  "fullname": "John Doe",
  ...
}

Error Responses

Route: logout

Route Definition: Logs the user out by terminating the current session and clearing the access token.

Route Type: logout

Access Route: POST /logout

Parameters

This route does not require any parameters in the body or query.

Behavior

// Sample POST /logout call
axios.post("/logout", {}, {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Notes

Error Responses 00200 OK:** Always returned, regardless of whether a session existed. Logout is treated as idempotent.

Route: publickey

Route Definition: Returns the public RSA key used to verify JWT access tokens issued by the auth service.

Route Type: publicKeyFetch

Access Route: GET /publickey

Parameters

Parameter Type Required Population
keyId String No request.query.keyId

Behavior

// Sample GET /publickey call
axios.get("/publickey", {
  params: {
    keyId: "currentKeyIdOptional"
  }
});

Success Response Returns the active public key and its associated keyId.

{
    "keyId": "a1b2c3d4",
    "keyData": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhki...\n-----END PUBLIC KEY-----"
}

Error Responses 404 Not Found: Public key file could not be found on the server.

Token Key Management

Mindbricks uses RSA key pairs to sign and verify JWT access tokens securely.
While the auth service signs each token with a private key, other services within the system — or external clients — need the corresponding public key to verify the authenticity and integrity of received tokens.

The /publickey endpoint allows services and clients to dynamically fetch the currently active public key, ensuring that token verification remains secure even if key rotation is performed.

Note:
The /publickey route is not intended for direct frontend (browser) consumption.
Instead, it is primarily used by trusted backend services, APIs, or middleware systems that need to independently verify access tokens issued by the auth service — without making verification-dependent API calls to the auth service itself.

Accessing the public key is crucial for validating user sessions efficiently and maintaining a decentralized trust model across your platform.

Route: relogin

Route Definition: Performs a silent login by verifying the current access token, refreshing the session, and returning a new access token along with updated user information.

Route Type: sessionRefresh

Access Route: GET /relogin

Parameters

This route does not require any request parameters.

Behavior

// Example call to refresh session
axios.get("/relogin", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response Returns a new session object, refreshed from database data.

{
  "sessionId": "new-session-uuid",
  "userId": "user-uuid",
  "email": "user@example.com",
  "roleId": "admin",
  "accessToken": "new-jwt-token",
  ...
}

Error Responses

{
  "status": "ERR",
  "message": "Cannot relogin"
}

Notes

Tip: This route is ideal when you want to rebuild a user’s session in the frontend without requiring them to manually log in again.

Verification Services — Email Verification

Email verification is a two-step flow that ensures a user’s email address is verified and trusted by the system.

All verification services, including email verification, are located under the /verification-services base path.

When is Email Verification Triggered?

Email Verification Flow

  1. Frontend calls /verification-services/email-verification/start with the user’s email address.
    • Mindbricks checks if the email is already verified.
    • A secret code is generated and stored in the cache linked to the user.
    • The code is sent to the user’s email or returned in the response (only in development environments for easier testing).
  2. User receives the code and enters it into the frontend application.
  3. Frontend calls /verification-services/email-verification/complete with the email and the received secretCode.
    • Mindbricks checks that the code is valid, not expired, and matches.
    • If valid, the user’s emailVerified flag is set to true, and a success response is returned.

API Endpoints

POST /verification-services/email-verification/start

Purpose
Starts the email verification process by generating and sending a secret verification code.

Request Body

Parameter Type Required Description
email String Yes The email address to verify
{
  "email": "user@example.com"
}

Success Response

Secret code details (in development environment). Confirms that the verification step has been started.

{
  "userId": "user-uuid",
  "email": "user@example.com",
  "secretCode": "123456",
  "expireTime": 86400,
  "date": "2024-04-29T10:00:00.000Z"
}

⚠️ In production, the secret code is only sent via email, not exposed in the API response.

Error Responses


POST /verification-services/email-verification/complete

Purpose
Completes the email verification by validating the secret code.

Request Body

Parameter Type Required Description
email String Yes The user email being verified
secretCode String Yes The secret code received via email
{
  "email": "user@example.com",
  "secretCode": "123456"
}

Success Response

Returns confirmation that the email has been verified.

{
  "userId": "user-uuid",
  "email": "user@example.com",
  "isVerified": true
}

Error Responses


Important Behavioral Notes

Resend Throttling

You can only request a new verification code after a cooldown period (resendTimeWindow, e.g., 60 seconds).

Expiration Handling

Verification codes expire after a configured period (expireTimeWindow, e.g., 1 day).

One Code Per Session

Only one active verification session per user is allowed at a time.

💡 Mindbricks automatically manages spam prevention, session caching, expiration, and event broadcasting (start/complete events) for all verification steps.

Verification Services — Mobile Verification

Mobile verification is a two-step flow that ensures a user’s mobile number is verified and trusted by the system.

All verification services, including mobile verification, are located under the /verification-services base path.

When is Mobile Verification Triggered?

Mobile Verification Flow

  1. Frontend calls /verification-services/mobile-verification/start with the user’s email address (used to locate the user).
    • Mindbricks checks if the mobile number is already verified.
    • A secret code is generated and stored in the cache linked to the user.
    • The code is sent to the user’s mobile via SMS or returned in the response (only in development environments for easier testing).
  2. User receives the code and enters it into the frontend application.
  3. Frontend calls /verification-services/mobile-verification/complete with the email and the received secretCode.
    • Mindbricks checks that the code is valid, not expired, and matches.
    • If valid, the user’s mobileVerified flag is set to true, and a success response is returned.

API Endpoints

POST /verification-services/mobile-verification/start

Purpose:
Starts the mobile verification process by generating and sending a secret verification code.

Request Body

Parameter Type Required Description
email String Yes The email address associated with the mobile number to verify
{
  "email": "user@example.com"
}

Success Response
Secret code details (in development environment). Confirms that the verification step has been started.

{
  "userId": "user-uuid",
  "mobile": "+15551234567",
  "secretCode": "123456",
  "expireTime": 86400,
  "date": "2024-04-29T10:00:00.000Z"
}

⚠️ In production, the secret code is only sent via SMS, not exposed in the API response.

Error Responses


POST /verification-services/mobile-verification/complete

Purpose:
Completes the mobile verification by validating the secret code.

Request Body

Parameter Type Required Description
email String Yes The user’s email being verified
secretCode String Yes The secret code received via SMS
{
  "email": "user@example.com",
  "secretCode": "123456"
}

Success Response
Returns confirmation that the mobile number has been verified.

{
  "userId": "user-uuid",
  "mobile": "+15551234567",
  "isVerified": true
}

Error Responses
403 Forbidden:


Important Behavioral Notes

Resend Throttling:
You can only request a new verification code after a cooldown period (resendTimeWindow, e.g., 60 seconds).

Expiration Handling:
Verification codes expire after a configured period (expireTimeWindow, e.g., 1 day).

One Code Per Session:
Only one active verification session per user is allowed at a time.

💡 Mindbricks automatically manages spam prevention, session caching, expiration, and event broadcasting (start/complete events) for all verification steps.

Verification Services — Email 2FA Verification

Email 2FA (Two-Factor Authentication) provides an additional layer of security by requiring users to confirm their identity using a secret code sent to their email address. This process is used in login flows or sensitive actions that need extra verification.

All verification services, including 2FA, are located under the /verification-services base path.

When is Email 2FA Triggered?

Email 2FA Flow

  1. Frontend calls /verification-services/email-2factor-verification/start with the user’s id, session id, client info, and reason.
    • Mindbricks identifies the user and checks if a cooldown period applies.
    • A new secret code is generated and stored, linked to the current session ID.
    • The code is sent via email or returned in development environments.
  2. User receives the code and enters it into the frontend application.
  3. Frontend calls /verification-services/email-2factor-verification/complete with the userId, sessionId, and the secretCode.
    • Mindbricks verifies the code, validates the session, and updates the session to remove the 2FA requirement.

API Endpoints

POST /verification-services/email-2factor-verification/start

Purpose:
Starts the email-based 2FA process by generating and sending a verification code.

Request Body

Parameter Type Required Description
userId String Yes The user’s ID
sessionId String Yes The current session ID
client String No Optional client tag or context
reason String No Optional reason for triggering 2FA
{
  "userId": "user-uuid",
  "sessionId": "session-uuid",
  "client": "login-page",
  "reason": "Login requires email 2FA"
}

Success Response

{
  "sessionId": "session-uuid",
  "userId": "user-uuid",
  "email": "user@example.com",
  "secretCode": "123456",
  "expireTime": 300,
  "date": "2024-04-29T10:00:00.000Z"
}

⚠️ In production, the secretCode is only sent via email, not exposed in the API response.

Error Responses


POST /verification-services/email-2factor-verification/complete

Purpose:
Completes the email 2FA process by validating the secret code and session.

Request Body

Parameter Type Required Description
userId String Yes The user’s ID
sessionId String Yes The session ID the code is tied to
secretCode String Yes The secret code received via email
{
  "userId": "user-uuid",
  "sessionId": "session-uuid",
  "secretCode": "123456"
}

Success Response

Returns an updated session with 2FA disabled:

{
  "sessionId": "session-uuid",
  "userId": "user-uuid",
  "sessionNeedsEmail2FA": false,
  ...
}

Error Responses


Important Behavioral Notes

Verification Services — Mobile 2FA Verification

Mobile 2FA (Two-Factor Authentication) is a security mechanism that adds an extra layer of authentication using a user’s verified mobile number.

All verification services, including mobile 2FA, are accessible under the /verification-services base path.

When is Mobile 2FA Triggered?

Mobile 2FA Verification Flow

  1. Frontend calls /verification-services/mobile-2factor-verification/start with the user’s id, session id, client info, and reason.
    • Mindbricks finds the user by id.
    • Verifies that the user has a verified mobile number.
    • A secret code is generated and cached against the session.
    • The code is sent to the user’s verified mobile number or returned in the response (only in development environments).
  2. User receives the code and enters it in the frontend app.
  3. Frontend calls /verification-services/mobile-2factor-verification/complete with the userId, sessionId, and secretCode.
    • Mindbricks validates the code for expiration and correctness.
    • If valid, the session flag sessionNeedsMobile2FA is cleared.
    • A refreshed session object is returned.

API Endpoints

POST /verification-services/mobile-2factor-verification/start

Purpose:
Initiates mobile-based 2FA by generating and sending a secret code.

Request Body

Parameter Type Required Description
userId String Yes The user’s ID
sessionId String Yes The current session ID
client String No Optional client tag or context
reason String No Optional reason for triggering 2FA
{
  "userId": "user-uuid",
  "sessionId": "session-uuid",
  "client": "login-page",
  "reason": "Login requires mobile 2FA"
}

Success Response
Returns the generated code (only in development), expiration info, and metadata.

{
  "userId": "user-uuid",
  "sessionId": "session-uuid",
  "mobile": "+15551234567",
  "secretCode": "654321",
  "expireTime": 300,
  "date": "2024-04-29T11:00:00.000Z"
}

⚠️ In production environments, the secret code is not included in the response and is instead delivered via SMS.

Error Responses


POST /verification-services/mobile-2factor-verification/complete

Purpose:
Completes mobile 2FA verification by validating the secret code and updating the session.

Request Body

Parameter Type Required Description
userId String Yes ID of the user
sessionId String Yes ID of the session
secretCode String Yes The 6-digit code received via SMS
{
  "userId": "user-uuid",
  "sessionId": "session-uuid",
  "secretCode": "654321"
}

Success Response
Returns the updated session with sessionNeedsMobile2FA: false.

{
  "sessionId": "session-uuid",
  "userId": "user-uuid",
  "sessionNeedsMobile2FA": false,
  "accessToken": "jwt-token",
  "expiresIn": 86400
}

Error Responses


Behavioral Notes

💡 Mindbricks handles session integrity, rate limiting, and secure code delivery to ensure a robust mobile 2FA process.

Verification Services — Password Reset by Email

Password Reset by Email enables a user to securely reset their password using a secret code sent to their registered email address.

All verification services, including password reset by email, are located under the /verification-services base path.

When is Password Reset by Email Triggered?

Password Reset Flow

  1. Frontend calls /verification-services/password-reset-by-email/start with the user’s email.
    • Mindbricks checks if the user exists and if the email is registered.
    • A secret code is generated and stored in the cache linked to the user.
    • The code is sent to the user’s email, or returned in the response (in development environments only for testing).
  2. User receives the code and enters it into the frontend along with the new password.
  3. Frontend calls /verification-services/password-reset-by-email/complete with the email, the secretCode, and the new password.
    • Mindbricks checks that the code is valid, not expired, and matches.
    • If valid, the user’s password is reset, their emailVerified flag is set to true, and a success response is returned.

API Endpoints

POST /verification-services/password-reset-by-email/start

Purpose:
Starts the password reset process by generating and sending a secret verification code.

Request Body

Parameter Type Required Description
email String Yes The email address of the user
{
  "email": "user@example.com"
}

Success Response

Returns secret code details (only in development environment) and confirmation that the verification step has been started.

{
  "userId": "user-uuid",
  "email": "user@example.com",
  "secretCode": "123456", 
  "expireTime": 86400,
  "date": "2024-04-29T10:00:00.000Z"
}

⚠️ In production, the secret code is only sent via email and not exposed in the API response.

Error Responses


POST /verification-services/password-reset-by-email/complete

Purpose:
Completes the password reset process by validating the secret code and updating the user’s password.

Request Body

Parameter Type Required Description
email String Yes The email address of the user
secretCode String Yes The code received via email
password String Yes The new password the user wants to set
{
  "email": "user@example.com",
  "secretCode": "123456",
  "password": "newSecurePassword123"
}

Success Response

{
  "userId": "user-uuid",
  "email": "user@example.com",
  "isVerified": true
}

Error Responses


Important Behavioral Notes

Resend Throttling:

A new verification code can only be requested after a cooldown period (configured via resendTimeWindow, e.g., 60 seconds).

Expiration Handling:

Verification codes automatically expire after a predefined period (expireTimeWindow, e.g., 1 day).

Session & Event Handling:

Mindbricks manages:

Verification Services — Password Reset by Mobile

Password reset by mobile provides users with a secure mechanism to reset their password using a verification code sent via SMS to their registered mobile number.

All verification services, including password reset by mobile, are located under the /verification-services base path.

When is Password Reset by Mobile Triggered?

Password Reset by Mobile Flow

  1. Frontend calls /verification-services/password-reset-by-mobile/start with the user’s mobile number or associated identifier.
    • Mindbricks checks if a user with the given mobile exists.
    • A secret code is generated and stored in the cache for that user.
    • The code is sent to the user’s mobile (or returned in development environments for testing).
  2. User receives the code via SMS and enters it into the frontend app.
  3. Frontend calls /verification-services/password-reset-by-mobile/complete with the user’s email, the secretCode, and the new password.
    • Mindbricks validates the secret code and its expiration.
    • If valid, it updates the user’s password and returns a success response.

API Endpoints

POST /verification-services/password-reset-by-mobile/start

Purpose:
Initiates the mobile-based password reset by sending a verification code to the user’s mobile.

Request Body

Parameter Type Required Description
mobile String Yes The mobile number to verify
{
  "mobile": "+905551234567"
}

Success Response

Returns the verification context (code returned only in development):

{
  "userId": "user-uuid",
  "mobile": "+905551234567",
  "secretCode": "123456", 
  "expireTime": 86400,
  "date": "2024-04-29T10:00:00.000Z"
}

⚠️ In production, the secretCode is not included in the response and is only sent via SMS.

Error Responses


POST /verification-services/password-reset-by-mobile/complete

Purpose:
Finalizes the password reset process by validating the received verification code and updating the user’s password.

Request Body

Parameter Type Required Description
email String Yes The email address of the user
secretCode String Yes The code received via SMS
password String Yes The new password to assign
{
  "email": "user@example.com",
  "secretCode": "123456",
  "password": "NewSecurePassword123!"
}

Success Response

{
  "userId": "user-uuid",
  "mobile": "+905551234567",
  "isVerified": true
}

Important Behavioral Notes

💡 Mindbricks handles spam protection, session caching, and event-based logging (for both start and complete operations) as part of the verification service base class.

Verification Method Types

🧾 For byCode Verifications

This verification type requires the user to manually enter a 6-digit code.

Frontend Action:
Display a secure input page where the user can enter the code they received via email or SMS. After collecting the code and any required metadata (such as userId or sessionId), make a POST request to the corresponding /complete endpoint.


🔗 For byLink Verifications

This verification type uses a clickable link embedded in an email (or SMS message).

Frontend Action:
The link points to a GET page in your frontend that parses userId and code from the query string and sends them to the backend via a POST request to the corresponding /complete endpoint. This enables one-click verification without requiring the user to type in a code.

Common Routes

Route: currentuser

Route Definition: Retrieves the currently authenticated user’s session information.

Route Type: sessionInfo

Access Route: GET /currentuser

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /currentuser call
axios.get("/currentuser", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response Returns the session object, including user-related data and token information.

{
  "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9",
  "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
  "email": "user@example.com",
  "fullname": "John Doe",
  "roleId": "user",
  "tenantId": "abc123",
  "accessToken": "jwt-token-string",
  ...
}

Error Response 401 Unauthorized: No active session found.

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Route: permissions

*Route Definition*: Retrieves all effective permission records assigned to the currently authenticated user.

*Route Type*: permissionFetch

Access Route: GET /permissions

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /permissions call
axios.get("/permissions", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

Returns an array of permission objects.

[
  {
    "id": "perm1",
    "permissionName": "adminPanel.access",
    "roleId": "admin",
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  },
  {
    "id": "perm2",
    "permissionName": "orders.manage",
    "roleId": null,
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  }
]

Each object reflects a single permission grant, aligned with the givenPermissions model:

Error Responses

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Tip: Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations.

Route: permissions/:permissionName

Route Definition: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions.

Route Type: permissionScopeCheck

Access Route: GET /permissions/:permissionName

Parameters

Parameter Type Required Population
permissionName String Yes request.params.permissionName

Behavior

// Sample GET /permissions/orders.manage
axios.get("/permissions/orders.manage", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

{
  "canDo": true,
  "exceptions": [
    "a1f2e3d4-xxxx-yyyy-zzzz-object1",
    "b2c3d4e5-xxxx-yyyy-zzzz-object2"
  ]
}

Copyright

All sources, documents and other digital materials are copyright of .

About Us

For more information please visit our website: .

. .


REST API GUIDE

airbnb-messaging-service

Version: 1.0.5

Enables secure in-app messaging between guests and hosts. Handles threads, messages (with text/media/system types), abuse flagging, and admin moderation for resolution…

Architectural Design Credit and Contact Information

The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to:

Email:

We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice.

Documentation Scope

Welcome to the official documentation for the Messaging Service’s REST API. This document is designed to provide a comprehensive guide to interfacing with our Messaging Service exclusively through RESTful API endpoints.

Intended Audience

This documentation is intended for developers and integrators who are looking to interact with the Messaging Service via HTTP requests for purposes such as creating, updating, deleting and querying Messaging objects.

Overview

Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases.

Beyond REST It’s important to note that the Messaging Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation.

Authentication And Authorization

To ensure secure access to the Messaging service’s protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it’s important to note that access control varies across different routes:

Protected API: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected.

**Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token.

Token Locations

When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters.

Location Token Name / Param Name
Query access_token
Authorization Header Bearer
Header airbnb3-access-token
Cookie airbnb3-access-token

Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies.

Api Definitions

This section outlines the API endpoints available within the Messaging service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It’s important to understand the flexibility in how parameters can be included in requests to effectively interact with the Messaging service.

This service is configured to listen for HTTP requests on port 3003, serving both the main API interface and default administrative endpoints.

The following routes are available by default:

This service is accessible via the following environment-specific URLs:

Parameter Inclusion Methods: Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests:

Query Parameters: Included directly in the URL’s query string.

Path Parameters: Embedded within the URL’s path.

Body Parameters: Sent within the JSON body of the request.

Session Parameters: Automatically read from the session object. This method is used for parameters that are intrinsic to the user’s session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request.

Note on Session Parameters: Session parameters represent a unique method of parameter inclusion, relying on the context of the user’s session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request.

By adhering to the specified parameter inclusion methods, you can effectively utilize the Messaging service’s API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below.

Common Parameters

The Messaging service’s business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL.

Supported Common Parameters:

By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the Messaging service.

Error Response

If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity:

Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently.

{
  "result": "ERR",
  "status": 400,
  "message": "errMsg_organizationIdisNotAValidID",
  "errCode": 400,
  "date": "2024-03-19T12:13:54.124Z",
  "detail": "String"
}

Object Structure of a Successfull Response

When the Messaging service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client.

Key Characteristics of the Response Envelope:

Design Considerations: The structure of a API’s response data is meticulously crafted during the service’s architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information.

Brief Data: Certain API’s return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect.

API Response Structure

The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response.

HTTP Status Codes:

Success Response Format:

For successful operations, the response includes a "status": "OK" property, signaling the successful execution of the request. The structure of a successful response is outlined below:

{
  "status":"OK",
  "statusCode": 200,   
  "elapsedMs":126,
  "ssoTime":120,
  "source": "db",
  "cacheKey": "hexCode",
  "userId": "ID",
  "sessionId": "ID",
  "requestId": "ID",
  "dataName":"products",
  "method":"GET",
  "action":"list",
  "appVersion":"Version",
  "rowCount":3
  "products":[{},{},{}],
  "paging": {
    "pageNumber":1, 
    "pageRowCount":25, 
    "totalRowCount":3,
    "pageCount":1
  },
  "filters": [],
  "uiPermissions": []
}

Handling Errors:

For details on handling error scenarios and understanding the structure of error responses, please refer to the “Error Response” section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages.

Resources

Messaging service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service.

MessageThread resource

Resource Definition : Thread/conversation between guest and host, optionally linked to a listing/reservation. Tracks participants, context, state, and stats. MessageThread Resource Properties

Name Type Required Default Definition
messageCount Integer **
isOpen Boolean **
guestId ID **
lastMessageAt Date **
listingId ID **
hostId ID **
reservationId ID **

MessageReport resource

Resource Definition : Report/in-app abuse complaint filed for a message by a user. Tracks status, admin handling, and resolution notes. Only visible to involved parties and admins. MessageReport Resource Properties

Name Type Required Default Definition
reportedBy ID **
reportReason String **
moderationStatus Enum **
messageId ID **
adminId ID **
reportedAt Date **
resolutionNotes Text **

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

moderationStatus Enum Property

Enum Options

Name Value Index
pending "pending"" 0
reviewed "reviewed"" 1
closed "closed"" 2

Message resource

Resource Definition : Single message within a thread (text/media/system). Includes metadata for flagging/moderation. Linked to sender, thread, and content type. Message Resource Properties

Name Type Required Default Definition
threadId ID **
content Text **
senderId ID **
sentAt Date **
messageType Enum **
mediaUrl String **
isModerated Boolean **
isFlagged Boolean **
flaggedBy ID **
flagReason String **
isRead Boolean **

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

messageType Enum Property

Enum Options

Name Value Index
text "text"" 0
media "media"" 1
system "system"" 2

Business Api

Delete Message API

Soft-delete (hide) a message. Sender or admin only. Message remains for logs/audit, only hidden for sender/recipient.

Rest Route

The deleteMessage API REST controller can be triggered via the following route:

/v1/messages/:messageId

Rest Request Parameters

The deleteMessage api has got 1 regular request parameter

Parameter Type Required Population
messageId ID true request.params?.[“messageId”]
messageId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/messages/:messageId

  axios({
    method: 'DELETE',
    url: `/v1/messages/${messageId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "message",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"message": {
		"id": "ID",
		"threadId": "ID",
		"content": "Text",
		"senderId": "ID",
		"sentAt": "Date",
		"messageType": "Enum",
		"messageType_idx": "Integer",
		"mediaUrl": "String",
		"isModerated": "Boolean",
		"isFlagged": "Boolean",
		"flaggedBy": "ID",
		"flagReason": "String",
		"isRead": "Boolean",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Create Messagethread API

Create a new message thread between a guest and host (optionally for specific listing/reservation). Users must be sender or recipient. Prevent duplicate open threads on same context with composite index.

Rest Route

The createMessageThread API REST controller can be triggered via the following route:

/v1/messagethreads

Rest Request Parameters

The createMessageThread api has got 7 regular request parameters

Parameter Type Required Population
messageCount Integer true request.body?.[“messageCount”]
isOpen Boolean true request.body?.[“isOpen”]
guestId ID true request.body?.[“guestId”]
lastMessageAt Date true request.body?.[“lastMessageAt”]
listingId ID false request.body?.[“listingId”]
hostId ID true request.body?.[“hostId”]
reservationId ID false request.body?.[“reservationId”]
messageCount :
isOpen :
guestId :
lastMessageAt :
listingId :
hostId :
reservationId :

REST Request To access the api you can use the REST controller with the path POST /v1/messagethreads

  axios({
    method: 'POST',
    url: '/v1/messagethreads',
    data: {
            messageCount:"Integer",  
            isOpen:"Boolean",  
            guestId:"ID",  
            lastMessageAt:"Date",  
            listingId:"ID",  
            hostId:"ID",  
            reservationId:"ID",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageThread",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"messageThread": {
		"id": "ID",
		"messageCount": "Integer",
		"isOpen": "Boolean",
		"guestId": "ID",
		"lastMessageAt": "Date",
		"listingId": "ID",
		"hostId": "ID",
		"reservationId": "ID",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Message API

Allows sender or admin to edit a message (rare; only content/flag fields allowed). Use-case: correct typo, retract flag. Not for full message overwrite.

Rest Route

The updateMessage API REST controller can be triggered via the following route:

/v1/messages/:messageId

Rest Request Parameters

The updateMessage api has got 8 regular request parameters

Parameter Type Required Population
messageId ID true request.params?.[“messageId”]
content Text false request.body?.[“content”]
mediaUrl String false request.body?.[“mediaUrl”]
isModerated Boolean false request.body?.[“isModerated”]
isFlagged Boolean false request.body?.[“isFlagged”]
flaggedBy ID false request.body?.[“flaggedBy”]
flagReason String false request.body?.[“flagReason”]
isRead Boolean false request.body?.[“isRead”]
messageId : This id paremeter is used to select the required data object that will be updated
content :
mediaUrl :
isModerated :
isFlagged :
flaggedBy :
flagReason :
isRead :

REST Request To access the api you can use the REST controller with the path PATCH /v1/messages/:messageId

  axios({
    method: 'PATCH',
    url: `/v1/messages/${messageId}`,
    data: {
            content:"Text",  
            mediaUrl:"String",  
            isModerated:"Boolean",  
            isFlagged:"Boolean",  
            flaggedBy:"ID",  
            flagReason:"String",  
            isRead:"Boolean",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "message",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"message": {
		"id": "ID",
		"threadId": "ID",
		"content": "Text",
		"senderId": "ID",
		"sentAt": "Date",
		"messageType": "Enum",
		"messageType_idx": "Integer",
		"mediaUrl": "String",
		"isModerated": "Boolean",
		"isFlagged": "Boolean",
		"flaggedBy": "ID",
		"flagReason": "String",
		"isRead": "Boolean",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Messagethread API

Update thread state (e.g. isOpen=false to close), only guest, host, or admin can update.

Rest Route

The updateMessageThread API REST controller can be triggered via the following route:

/v1/messagethreads/:messageThreadId

Rest Request Parameters

The updateMessageThread api has got 6 regular request parameters

Parameter Type Required Population
messageThreadId ID true request.params?.[“messageThreadId”]
messageCount Integer false request.body?.[“messageCount”]
isOpen Boolean false request.body?.[“isOpen”]
lastMessageAt Date false request.body?.[“lastMessageAt”]
listingId ID false request.body?.[“listingId”]
reservationId ID false request.body?.[“reservationId”]
messageThreadId : This id paremeter is used to select the required data object that will be updated
messageCount :
isOpen :
lastMessageAt :
listingId :
reservationId :

REST Request To access the api you can use the REST controller with the path PATCH /v1/messagethreads/:messageThreadId

  axios({
    method: 'PATCH',
    url: `/v1/messagethreads/${messageThreadId}`,
    data: {
            messageCount:"Integer",  
            isOpen:"Boolean",  
            lastMessageAt:"Date",  
            listingId:"ID",  
            reservationId:"ID",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageThread",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"messageThread": {
		"id": "ID",
		"messageCount": "Integer",
		"isOpen": "Boolean",
		"guestId": "ID",
		"lastMessageAt": "Date",
		"listingId": "ID",
		"hostId": "ID",
		"reservationId": "ID",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete Messagethread API

Soft-delete (archive/close) a thread. Only allowed for guest/host or admin; marks isActive=false.

Rest Route

The deleteMessageThread API REST controller can be triggered via the following route:

/v1/messagethreads/:messageThreadId

Rest Request Parameters

The deleteMessageThread api has got 1 regular request parameter

Parameter Type Required Population
messageThreadId ID true request.params?.[“messageThreadId”]
messageThreadId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/messagethreads/:messageThreadId

  axios({
    method: 'DELETE',
    url: `/v1/messagethreads/${messageThreadId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageThread",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"messageThread": {
		"id": "ID",
		"messageCount": "Integer",
		"isOpen": "Boolean",
		"guestId": "ID",
		"lastMessageAt": "Date",
		"listingId": "ID",
		"hostId": "ID",
		"reservationId": "ID",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Create Message API

Create/send a message to a thread (guest/host only, must be participant). Sets sentAt, and updates thread.lastMessageAt/messageCount atomically.

Rest Route

The createMessage API REST controller can be triggered via the following route:

/v1/messages

Rest Request Parameters

The createMessage api has got 10 regular request parameters

Parameter Type Required Population
threadId ID true request.body?.[“threadId”]
content Text true request.body?.[“content”]
senderId ID true request.body?.[“senderId”]
sentAt Date true request.body?.[“sentAt”]
messageType Enum true request.body?.[“messageType”]
mediaUrl String false request.body?.[“mediaUrl”]
isModerated Boolean true request.body?.[“isModerated”]
isFlagged Boolean true request.body?.[“isFlagged”]
flaggedBy ID false request.body?.[“flaggedBy”]
flagReason String false request.body?.[“flagReason”]
threadId :
content :
senderId :
sentAt :
messageType :
mediaUrl :
isModerated :
isFlagged :
flaggedBy :
flagReason :

REST Request To access the api you can use the REST controller with the path POST /v1/messages

  axios({
    method: 'POST',
    url: '/v1/messages',
    data: {
            threadId:"ID",  
            content:"Text",  
            senderId:"ID",  
            sentAt:"Date",  
            messageType:"Enum",  
            mediaUrl:"String",  
            isModerated:"Boolean",  
            isFlagged:"Boolean",  
            flaggedBy:"ID",  
            flagReason:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "message",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"message": {
		"id": "ID",
		"threadId": "ID",
		"content": "Text",
		"senderId": "ID",
		"sentAt": "Date",
		"messageType": "Enum",
		"messageType_idx": "Integer",
		"mediaUrl": "String",
		"isModerated": "Boolean",
		"isFlagged": "Boolean",
		"flaggedBy": "ID",
		"flagReason": "String",
		"isRead": "Boolean",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Messagethread API

Get a message thread with participant/context enrichment. Only guest, host, or admin may view.

Rest Route

The getMessageThread API REST controller can be triggered via the following route:

/v1/messagethreads/:messageThreadId

Rest Request Parameters

The getMessageThread api has got 1 regular request parameter

Parameter Type Required Population
messageThreadId ID true request.params?.[“messageThreadId”]
messageThreadId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/messagethreads/:messageThreadId

  axios({
    method: 'GET',
    url: `/v1/messagethreads/${messageThreadId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageThread",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"messageThread": {
		"id": "ID",
		"messageCount": "Integer",
		"isOpen": "Boolean",
		"guestId": "ID",
		"lastMessageAt": "Date",
		"listingId": "ID",
		"hostId": "ID",
		"reservationId": "ID",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Message API

Get a message (guest/host must be in thread, or admin). Enrich with sender info.

Rest Route

The getMessage API REST controller can be triggered via the following route:

/v1/messages/:messageId

Rest Request Parameters

The getMessage api has got 1 regular request parameter

Parameter Type Required Population
messageId ID true request.params?.[“messageId”]
messageId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/messages/:messageId

  axios({
    method: 'GET',
    url: `/v1/messages/${messageId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "message",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"message": {
		"id": "ID",
		"threadId": "ID",
		"content": "Text",
		"senderId": "ID",
		"sentAt": "Date",
		"messageType": "Enum",
		"messageType_idx": "Integer",
		"mediaUrl": "String",
		"isModerated": "Boolean",
		"isFlagged": "Boolean",
		"flaggedBy": "ID",
		"flagReason": "String",
		"isRead": "Boolean",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Messagethreads API

List threads for user; only show where session user is guest or host, or admin role.

Rest Route

The listMessageThreads API REST controller can be triggered via the following route:

/v1/messagethreads

Rest Request Parameters The listMessageThreads api has got no request parameters.

REST Request To access the api you can use the REST controller with the path GET /v1/messagethreads

  axios({
    method: 'GET',
    url: '/v1/messagethreads',
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageThreads",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"messageThreads": [
		{
			"id": "ID",
			"messageCount": "Integer",
			"isOpen": "Boolean",
			"guestId": "ID",
			"lastMessageAt": "Date",
			"listingId": "ID",
			"hostId": "ID",
			"reservationId": "ID",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"listingDets": [
				{
					"title": "String",
					"address": "String",
					"propertyType": "Enum",
					"propertyType_idx": "Integer",
					"location": "Object"
				},
				{},
				{}
			],
			"rezDets": [
				{
					"bookingStatus": "Enum",
					"bookingStatus_idx": "Integer",
					"checkOut": "Date",
					"checkIn": "Date"
				},
				{},
				{}
			]
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Get Threadmessages API

List messages in a thread (participants only, or admin). Sorted by sentAt ASC. Includes sender info for display.

Rest Route

The getThreadMessages API REST controller can be triggered via the following route:

/v1/threadmessages/:threadId

Rest Request Parameters

The getThreadMessages api has got 1 regular request parameter

Parameter Type Required Population
threadId ID true request.params?.[“threadId”]
threadId :

REST Request To access the api you can use the REST controller with the path GET /v1/threadmessages/:threadId

  axios({
    method: 'GET',
    url: `/v1/threadmessages/${threadId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messages",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"messages": [
		{
			"id": "ID",
			"threadId": "ID",
			"content": "Text",
			"senderId": "ID",
			"sentAt": "Date",
			"messageType": "Enum",
			"messageType_idx": "Integer",
			"mediaUrl": "String",
			"isModerated": "Boolean",
			"isFlagged": "Boolean",
			"flaggedBy": "ID",
			"flagReason": "String",
			"isRead": "Boolean",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": [],
	"thread": {
		"listingId": "ID"
	},
	"listing": {},
	"amenities": {}
}

Gotthread Messages API

Rest Route

The gotthreadMessages API REST controller can be triggered via the following route:

/v1/gotthreadmessages/:threadId

Rest Request Parameters

The gotthreadMessages api has got 1 regular request parameter

Parameter Type Required Population
threadId ID true request.params?.[“threadId”]
threadId : undefined. The parameter is used to query data.

REST Request To access the api you can use the REST controller with the path GET /v1/gotthreadmessages/:threadId

  axios({
    method: 'GET',
    url: `/v1/gotthreadmessages/${threadId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messages",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"messages": [
		{
			"id": "ID",
			"threadId": "ID",
			"content": "Text",
			"senderId": "ID",
			"sentAt": "Date",
			"messageType": "Enum",
			"messageType_idx": "Integer",
			"mediaUrl": "String",
			"isModerated": "Boolean",
			"isFlagged": "Boolean",
			"flaggedBy": "ID",
			"flagReason": "String",
			"isRead": "Boolean",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

List Messagereports API

List message reports. Reporter, admin, or (involved) sender may see. Admin sees all, others see those they filed or are involved in. Intended for moderation/admin panel and user reporting history.

Rest Route

The listMessageReports API REST controller can be triggered via the following route:

/v1/messagereports

Rest Request Parameters The listMessageReports api has got no request parameters.

REST Request To access the api you can use the REST controller with the path GET /v1/messagereports

  axios({
    method: 'GET',
    url: '/v1/messagereports',
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageReports",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"messageReports": [
		{
			"id": "ID",
			"reportedBy": "ID",
			"reportReason": "String",
			"moderationStatus": "Enum",
			"moderationStatus_idx": "Integer",
			"messageId": "ID",
			"adminId": "ID",
			"reportedAt": "Date",
			"resolutionNotes": "Text",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Create Messagereport API

User files report on a message for abuse/moderation. Links to message & reporter. Sets status=pending, visible to reporter, admin, and message sender (for defense/appeal).

Rest Route

The createMessageReport API REST controller can be triggered via the following route:

/v1/messagereports

Rest Request Parameters

The createMessageReport api has got 7 regular request parameters

Parameter Type Required Population
reportedBy ID true request.body?.[“reportedBy”]
reportReason String true request.body?.[“reportReason”]
moderationStatus Enum true request.body?.[“moderationStatus”]
messageId ID true request.body?.[“messageId”]
adminId ID false request.body?.[“adminId”]
reportedAt Date true request.body?.[“reportedAt”]
resolutionNotes Text false request.body?.[“resolutionNotes”]
reportedBy :
reportReason :
moderationStatus :
messageId :
adminId :
reportedAt :
resolutionNotes :

REST Request To access the api you can use the REST controller with the path POST /v1/messagereports

  axios({
    method: 'POST',
    url: '/v1/messagereports',
    data: {
            reportedBy:"ID",  
            reportReason:"String",  
            moderationStatus:"Enum",  
            messageId:"ID",  
            adminId:"ID",  
            reportedAt:"Date",  
            resolutionNotes:"Text",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageReport",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"messageReport": {
		"id": "ID",
		"reportedBy": "ID",
		"reportReason": "String",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"messageId": "ID",
		"adminId": "ID",
		"reportedAt": "Date",
		"resolutionNotes": "Text",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Messagereport API

Admin moderator updates report: assign adminId, update status, add resolution notes. Only admin role allowed.

Rest Route

The updateMessageReport API REST controller can be triggered via the following route:

/v1/messagereports/:messageReportId

Rest Request Parameters

The updateMessageReport api has got 4 regular request parameters

Parameter Type Required Population
messageReportId ID true request.params?.[“messageReportId”]
moderationStatus Enum false request.body?.[“moderationStatus”]
adminId ID false request.body?.[“adminId”]
resolutionNotes Text false request.body?.[“resolutionNotes”]
messageReportId : This id paremeter is used to select the required data object that will be updated
moderationStatus :
adminId :
resolutionNotes :

REST Request To access the api you can use the REST controller with the path PATCH /v1/messagereports/:messageReportId

  axios({
    method: 'PATCH',
    url: `/v1/messagereports/${messageReportId}`,
    data: {
            moderationStatus:"Enum",  
            adminId:"ID",  
            resolutionNotes:"Text",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageReport",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"messageReport": {
		"id": "ID",
		"reportedBy": "ID",
		"reportReason": "String",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"messageId": "ID",
		"adminId": "ID",
		"reportedAt": "Date",
		"resolutionNotes": "Text",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Messagereport API

Get a message report. Reporter, admin, or message sender may view report. Includes message, admin, and involved user info via selectJoins for moderation view.

Rest Route

The getMessageReport API REST controller can be triggered via the following route:

/v1/messagereports/:messageReportId

Rest Request Parameters

The getMessageReport api has got 1 regular request parameter

Parameter Type Required Population
messageReportId ID true request.params?.[“messageReportId”]
messageReportId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/messagereports/:messageReportId

  axios({
    method: 'GET',
    url: `/v1/messagereports/${messageReportId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "messageReport",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"messageReport": {
		"id": "ID",
		"reportedBy": "ID",
		"reportReason": "String",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"messageId": "ID",
		"adminId": "ID",
		"reportedAt": "Date",
		"resolutionNotes": "Text",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Authentication Specific Routes

Common Routes

Route: currentuser

Route Definition: Retrieves the currently authenticated user’s session information.

Route Type: sessionInfo

Access Route: GET /currentuser

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /currentuser call
axios.get("/currentuser", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response Returns the session object, including user-related data and token information.

{
  "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9",
  "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
  "email": "user@example.com",
  "fullname": "John Doe",
  "roleId": "user",
  "tenantId": "abc123",
  "accessToken": "jwt-token-string",
  ...
}

Error Response 401 Unauthorized: No active session found.

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Route: permissions

*Route Definition*: Retrieves all effective permission records assigned to the currently authenticated user.

*Route Type*: permissionFetch

Access Route: GET /permissions

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /permissions call
axios.get("/permissions", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

Returns an array of permission objects.

[
  {
    "id": "perm1",
    "permissionName": "adminPanel.access",
    "roleId": "admin",
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  },
  {
    "id": "perm2",
    "permissionName": "orders.manage",
    "roleId": null,
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  }
]

Each object reflects a single permission grant, aligned with the givenPermissions model:

Error Responses

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Tip: Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations.

Route: permissions/:permissionName

Route Definition: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions.

Route Type: permissionScopeCheck

Access Route: GET /permissions/:permissionName

Parameters

Parameter Type Required Population
permissionName String Yes request.params.permissionName

Behavior

// Sample GET /permissions/orders.manage
axios.get("/permissions/orders.manage", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

{
  "canDo": true,
  "exceptions": [
    "a1f2e3d4-xxxx-yyyy-zzzz-object1",
    "b2c3d4e5-xxxx-yyyy-zzzz-object2"
  ]
}

Copyright

All sources, documents and other digital materials are copyright of .

About Us

For more information please visit our website: .

. .


REST API GUIDE

airbnb-propertycatalog-service

Version: 1.0.5

Service for management of property listings, calendars, amenities, and localization for a short-term rental marketplace. Hosts can manage listings, availability, multi-language descriptions, policies, pricing, and attributes, served for global search and discovery…

Architectural Design Credit and Contact Information

The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to:

Email:

We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice.

Documentation Scope

Welcome to the official documentation for the PropertyCatalog Service’s REST API. This document is designed to provide a comprehensive guide to interfacing with our PropertyCatalog Service exclusively through RESTful API endpoints.

Intended Audience

This documentation is intended for developers and integrators who are looking to interact with the PropertyCatalog Service via HTTP requests for purposes such as creating, updating, deleting and querying PropertyCatalog objects.

Overview

Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases.

Beyond REST It’s important to note that the PropertyCatalog Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation.

Authentication And Authorization

To ensure secure access to the PropertyCatalog service’s protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it’s important to note that access control varies across different routes:

Protected API: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected.

**Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token.

Token Locations

When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters.

Location Token Name / Param Name
Query access_token
Authorization Header Bearer
Header airbnb3-access-token
Cookie airbnb3-access-token

Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies.

Api Definitions

This section outlines the API endpoints available within the PropertyCatalog service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It’s important to understand the flexibility in how parameters can be included in requests to effectively interact with the PropertyCatalog service.

This service is configured to listen for HTTP requests on port 3001, serving both the main API interface and default administrative endpoints.

The following routes are available by default:

This service is accessible via the following environment-specific URLs:

Parameter Inclusion Methods: Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests:

Query Parameters: Included directly in the URL’s query string.

Path Parameters: Embedded within the URL’s path.

Body Parameters: Sent within the JSON body of the request.

Session Parameters: Automatically read from the session object. This method is used for parameters that are intrinsic to the user’s session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request.

Note on Session Parameters: Session parameters represent a unique method of parameter inclusion, relying on the context of the user’s session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request.

By adhering to the specified parameter inclusion methods, you can effectively utilize the PropertyCatalog service’s API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below.

Common Parameters

The PropertyCatalog service’s business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL.

Supported Common Parameters:

By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the PropertyCatalog service.

Error Response

If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity:

Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently.

{
  "result": "ERR",
  "status": 400,
  "message": "errMsg_organizationIdisNotAValidID",
  "errCode": 400,
  "date": "2024-03-19T12:13:54.124Z",
  "detail": "String"
}

Object Structure of a Successfull Response

When the PropertyCatalog service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client.

Key Characteristics of the Response Envelope:

Design Considerations: The structure of a API’s response data is meticulously crafted during the service’s architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information.

Brief Data: Certain API’s return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect.

API Response Structure

The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response.

HTTP Status Codes:

Success Response Format:

For successful operations, the response includes a "status": "OK" property, signaling the successful execution of the request. The structure of a successful response is outlined below:

{
  "status":"OK",
  "statusCode": 200,   
  "elapsedMs":126,
  "ssoTime":120,
  "source": "db",
  "cacheKey": "hexCode",
  "userId": "ID",
  "sessionId": "ID",
  "requestId": "ID",
  "dataName":"products",
  "method":"GET",
  "action":"list",
  "appVersion":"Version",
  "rowCount":3
  "products":[{},{},{}],
  "paging": {
    "pageNumber":1, 
    "pageRowCount":25, 
    "totalRowCount":3,
    "pageCount":1
  },
  "filters": [],
  "uiPermissions": []
}

Handling Errors:

For details on handling error scenarios and understanding the structure of error responses, please refer to the “Error Response” section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages.

Resources

PropertyCatalog service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service.

ListingCalendar resource

Resource Definition : Represents daily availability, pricing, and reservation state for a listing (i.e., a property calendar entry). ListingCalendar Resource Properties

Name Type Required Default Definition
priceOverride Double **
date Date **
minStay Integer **
listingId ID **
bookedBy ID **
iCalUrl String **
externalCalendarIds String **
isAvailable Boolean **

ListingAmenity resource

Resource Definition : Dictionary of possible amenities (wifi, pool, etc.) for hosts to reference in their listings. ListingAmenity Resource Properties

Name Type Required Default Definition
iconUrl String **
name String **

Listing resource

Resource Definition : Represents a property or space offered for short-term rental by a host. Includes host ref, core attributes, pricing, location, seasonal pricing, media, and booking/policy properties… Listing Resource Properties

Name Type Required Default Definition
title String **
amenityIds ID **
hostId ID **
mainPhoto String **
photos String **
address String **
pricePerNight Double **
description Text **
propertyType Enum **
location Object **
maxStay Integer **
minStay Integer **
currency String **
seasonalPricing Object **
approvalType Enum **
bookingPolicies Object **
cancellationPolicy Object **
languagesSupported String **
houseRules Text **
isPublished Boolean **
cityTaxPercent Double **

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

propertyType Enum Property

Enum Options

Name Value Index
apartment "apartment"" 0
house "house"" 1
villa "villa"" 2
room "room"" 3
condo "condo"" 4
loft "loft"" 5
studio "studio"" 6
other "other"" 7
approvalType Enum Property

Enum Options

Name Value Index
instant "instant"" 0
manual "manual"" 1

ListingLocaleText resource

Resource Definition : Localized title & description texts for a property listing, per language. ListingLocaleText Resource Properties

Name Type Required Default Definition
localizedDescription Text **
localizedTitle String **
listingId ID **
languageCode String **

Business Api

Update Listing API

Update an existing listing owned by the host or admin.

Rest Route

The updateListing API REST controller can be triggered via the following route:

/v1/listings/:listingId

Rest Request Parameters

The updateListing api has got 21 regular request parameters

Parameter Type Required Population
listingId ID true request.params?.[“listingId”]
title String false request.body?.[“title”]
amenityIds ID false request.body?.[“amenityIds”]
mainPhoto String false request.body?.[“mainPhoto”]
photos String false request.body?.[“photos”]
address String false request.body?.[“address”]
pricePerNight Double false request.body?.[“pricePerNight”]
description Text false request.body?.[“description”]
propertyType Enum false request.body?.[“propertyType”]
location Object false request.body?.[“location”]
maxStay Integer false request.body?.[“maxStay”]
minStay Integer false request.body?.[“minStay”]
currency String false request.body?.[“currency”]
seasonalPricing Object false request.body?.[“seasonalPricing”]
approvalType Enum false request.body?.[“approvalType”]
bookingPolicies Object false request.body?.[“bookingPolicies”]
cancellationPolicy Object false request.body?.[“cancellationPolicy”]
languagesSupported String false request.body?.[“languagesSupported”]
houseRules Text false request.body?.[“houseRules”]
isPublished Boolean false request.body?.[“isPublished”]
cityTaxPercent Double false request.body?.[“cityTaxPercent”]
listingId : This id paremeter is used to select the required data object that will be updated
title :
amenityIds :
mainPhoto :
photos :
address :
pricePerNight :
description :
propertyType :
location :
maxStay :
minStay :
currency :
seasonalPricing :
approvalType :
bookingPolicies :
cancellationPolicy :
languagesSupported :
houseRules :
isPublished :
cityTaxPercent :

REST Request To access the api you can use the REST controller with the path PATCH /v1/listings/:listingId

  axios({
    method: 'PATCH',
    url: `/v1/listings/${listingId}`,
    data: {
            title:"String",  
            amenityIds:"ID",  
            mainPhoto:"String",  
            photos:"String",  
            address:"String",  
            pricePerNight:"Double",  
            description:"Text",  
            propertyType:"Enum",  
            location:"Object",  
            maxStay:"Integer",  
            minStay:"Integer",  
            currency:"String",  
            seasonalPricing:"Object",  
            approvalType:"Enum",  
            bookingPolicies:"Object",  
            cancellationPolicy:"Object",  
            languagesSupported:"String",  
            houseRules:"Text",  
            isPublished:"Boolean",  
            cityTaxPercent:"Double",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listing",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"listing": {
		"id": "ID",
		"title": "String",
		"amenityIds": "ID",
		"hostId": "ID",
		"mainPhoto": "String",
		"photos": "String",
		"address": "String",
		"pricePerNight": "Double",
		"description": "Text",
		"propertyType": "Enum",
		"propertyType_idx": "Integer",
		"location": "Object",
		"maxStay": "Integer",
		"minStay": "Integer",
		"currency": "String",
		"seasonalPricing": "Object",
		"approvalType": "Enum",
		"approvalType_idx": "Integer",
		"bookingPolicies": "Object",
		"cancellationPolicy": "Object",
		"languagesSupported": "String",
		"houseRules": "Text",
		"isPublished": "Boolean",
		"cityTaxPercent": "Double",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Create Listing API

Create a new rental property listing. Host must be the owner (session user).

Rest Route

The createListing API REST controller can be triggered via the following route:

/v1/listings

Rest Request Parameters

The createListing api has got 20 regular request parameters

Parameter Type Required Population
title String true request.body?.[“title”]
amenityIds ID false request.body?.[“amenityIds”]
mainPhoto String false request.body?.[“mainPhoto”]
photos String false request.body?.[“photos”]
address String true request.body?.[“address”]
pricePerNight Double true request.body?.[“pricePerNight”]
description Text true request.body?.[“description”]
propertyType Enum true request.body?.[“propertyType”]
location Object true request.body?.[“location”]
maxStay Integer false request.body?.[“maxStay”]
minStay Integer false request.body?.[“minStay”]
currency String true request.body?.[“currency”]
seasonalPricing Object false request.body?.[“seasonalPricing”]
approvalType Enum true request.body?.[“approvalType”]
bookingPolicies Object false request.body?.[“bookingPolicies”]
cancellationPolicy Object false request.body?.[“cancellationPolicy”]
languagesSupported String false request.body?.[“languagesSupported”]
houseRules Text false request.body?.[“houseRules”]
isPublished Boolean true request.body?.[“isPublished”]
cityTaxPercent Double false request.body?.[“cityTaxPercent”]
title :
amenityIds :
mainPhoto :
photos :
address :
pricePerNight :
description :
propertyType :
location :
maxStay :
minStay :
currency :
seasonalPricing :
approvalType :
bookingPolicies :
cancellationPolicy :
languagesSupported :
houseRules :
isPublished :
cityTaxPercent :

REST Request To access the api you can use the REST controller with the path POST /v1/listings

  axios({
    method: 'POST',
    url: '/v1/listings',
    data: {
            title:"String",  
            amenityIds:"ID",  
            mainPhoto:"String",  
            photos:"String",  
            address:"String",  
            pricePerNight:"Double",  
            description:"Text",  
            propertyType:"Enum",  
            location:"Object",  
            maxStay:"Integer",  
            minStay:"Integer",  
            currency:"String",  
            seasonalPricing:"Object",  
            approvalType:"Enum",  
            bookingPolicies:"Object",  
            cancellationPolicy:"Object",  
            languagesSupported:"String",  
            houseRules:"Text",  
            isPublished:"Boolean",  
            cityTaxPercent:"Double",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listing",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"listing": {
		"id": "ID",
		"title": "String",
		"amenityIds": "ID",
		"hostId": "ID",
		"mainPhoto": "String",
		"photos": "String",
		"address": "String",
		"pricePerNight": "Double",
		"description": "Text",
		"propertyType": "Enum",
		"propertyType_idx": "Integer",
		"location": "Object",
		"maxStay": "Integer",
		"minStay": "Integer",
		"currency": "String",
		"seasonalPricing": "Object",
		"approvalType": "Enum",
		"approvalType_idx": "Integer",
		"bookingPolicies": "Object",
		"cancellationPolicy": "Object",
		"languagesSupported": "String",
		"houseRules": "Text",
		"isPublished": "Boolean",
		"cityTaxPercent": "Double",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete Listing API

Delete (soft-delete) a property listing. Host must be owner or admin.

Rest Route

The deleteListing API REST controller can be triggered via the following route:

/v1/listings/:listingId

Rest Request Parameters

The deleteListing api has got 1 regular request parameter

Parameter Type Required Population
listingId ID true request.params?.[“listingId”]
listingId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/listings/:listingId

  axios({
    method: 'DELETE',
    url: `/v1/listings/${listingId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listing",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"listing": {
		"id": "ID",
		"title": "String",
		"amenityIds": "ID",
		"hostId": "ID",
		"mainPhoto": "String",
		"photos": "String",
		"address": "String",
		"pricePerNight": "Double",
		"description": "Text",
		"propertyType": "Enum",
		"propertyType_idx": "Integer",
		"location": "Object",
		"maxStay": "Integer",
		"minStay": "Integer",
		"currency": "String",
		"seasonalPricing": "Object",
		"approvalType": "Enum",
		"approvalType_idx": "Integer",
		"bookingPolicies": "Object",
		"cancellationPolicy": "Object",
		"languagesSupported": "String",
		"houseRules": "Text",
		"isPublished": "Boolean",
		"cityTaxPercent": "Double",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Listings API

List all property listings (optionally filtered). Includes amenities and locales as joins for display search cards.

Rest Route

The listListings API REST controller can be triggered via the following route:

/v1/listings

Rest Request Parameters

Filter Parameters

The listListings api supports 7 optional filter parameters for filtering list results:

title (String): Filter by title

hostId (ID): Filter by hostId

address (String): Filter by address

pricePerNight (Double): Filter by pricePerNight

propertyType (Enum): Filter by propertyType

currency (String): Filter by currency

isPublished (Boolean): Filter by isPublished

REST Request To access the api you can use the REST controller with the path GET /v1/listings

  axios({
    method: 'GET',
    url: '/v1/listings',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // title: '<value>' // Filter by title
        // hostId: '<value>' // Filter by hostId
        // address: '<value>' // Filter by address
        // pricePerNight: '<value>' // Filter by pricePerNight
        // propertyType: '<value>' // Filter by propertyType
        // currency: '<value>' // Filter by currency
        // isPublished: '<value>' // Filter by isPublished
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listings",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"listings": [
		{
			"id": "ID",
			"title": "String",
			"amenityIds": "ID",
			"hostId": "ID",
			"mainPhoto": "String",
			"photos": "String",
			"address": "String",
			"pricePerNight": "Double",
			"description": "Text",
			"propertyType": "Enum",
			"propertyType_idx": "Integer",
			"location": "Object",
			"maxStay": "Integer",
			"minStay": "Integer",
			"currency": "String",
			"seasonalPricing": "Object",
			"approvalType": "Enum",
			"approvalType_idx": "Integer",
			"bookingPolicies": "Object",
			"cancellationPolicy": "Object",
			"languagesSupported": "String",
			"houseRules": "Text",
			"isPublished": "Boolean",
			"cityTaxPercent": "Double",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"reviews": {
				"rating": "Integer",
				"revieweeId": "ID"
			},
			"amenities": {
				"iconUrl": "String",
				"name": "String"
			}
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Update Listingcalendar API

Update a calendar entry (availablity, pricing, reservation) for a listing date.

Rest Route

The updateListingCalendar API REST controller can be triggered via the following route:

/v1/listingcalendars/:listingCalendarId

Rest Request Parameters

The updateListingCalendar api has got 7 regular request parameters

Parameter Type Required Population
listingCalendarId ID true request.params?.[“listingCalendarId”]
priceOverride Double false request.body?.[“priceOverride”]
minStay Integer false request.body?.[“minStay”]
bookedBy ID false request.body?.[“bookedBy”]
iCalUrl String false request.body?.[“iCalUrl”]
externalCalendarIds String false request.body?.[“externalCalendarIds”]
isAvailable Boolean false request.body?.[“isAvailable”]
listingCalendarId : This id paremeter is used to select the required data object that will be updated
priceOverride :
minStay :
bookedBy :
iCalUrl :
externalCalendarIds :
isAvailable :

REST Request To access the api you can use the REST controller with the path PATCH /v1/listingcalendars/:listingCalendarId

  axios({
    method: 'PATCH',
    url: `/v1/listingcalendars/${listingCalendarId}`,
    data: {
            priceOverride:"Double",  
            minStay:"Integer",  
            bookedBy:"ID",  
            iCalUrl:"String",  
            externalCalendarIds:"String",  
            isAvailable:"Boolean",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingCalendar",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"listingCalendar": {
		"id": "ID",
		"priceOverride": "Double",
		"date": "Date",
		"minStay": "Integer",
		"listingId": "ID",
		"bookedBy": "ID",
		"iCalUrl": "String",
		"externalCalendarIds": "String",
		"isAvailable": "Boolean",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Create Listingcalendar API

Add a calendar entry for a listing/date—controls availability or booking info for that day.

Rest Route

The createListingCalendar API REST controller can be triggered via the following route:

/v1/listingcalendars

Rest Request Parameters

The createListingCalendar api has got 8 regular request parameters

Parameter Type Required Population
priceOverride Double false request.body?.[“priceOverride”]
date Date true request.body?.[“date”]
minStay Integer false request.body?.[“minStay”]
listingId ID true request.body?.[“listingId”]
bookedBy ID false request.body?.[“bookedBy”]
iCalUrl String false request.body?.[“iCalUrl”]
externalCalendarIds String false request.body?.[“externalCalendarIds”]
isAvailable Boolean true request.body?.[“isAvailable”]
priceOverride :
date :
minStay :
listingId :
bookedBy :
iCalUrl :
externalCalendarIds :
isAvailable :

REST Request To access the api you can use the REST controller with the path POST /v1/listingcalendars

  axios({
    method: 'POST',
    url: '/v1/listingcalendars',
    data: {
            priceOverride:"Double",  
            date:"Date",  
            minStay:"Integer",  
            listingId:"ID",  
            bookedBy:"ID",  
            iCalUrl:"String",  
            externalCalendarIds:"String",  
            isAvailable:"Boolean",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingCalendar",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"listingCalendar": {
		"id": "ID",
		"priceOverride": "Double",
		"date": "Date",
		"minStay": "Integer",
		"listingId": "ID",
		"bookedBy": "ID",
		"iCalUrl": "String",
		"externalCalendarIds": "String",
		"isAvailable": "Boolean",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete Listingcalendar API

Delete (soft-delete) a listing calendar entry (by host/admin).

Rest Route

The deleteListingCalendar API REST controller can be triggered via the following route:

/v1/listingcalendars/:listingCalendarId

Rest Request Parameters

The deleteListingCalendar api has got 1 regular request parameter

Parameter Type Required Population
listingCalendarId ID true request.params?.[“listingCalendarId”]
listingCalendarId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/listingcalendars/:listingCalendarId

  axios({
    method: 'DELETE',
    url: `/v1/listingcalendars/${listingCalendarId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingCalendar",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"listingCalendar": {
		"id": "ID",
		"priceOverride": "Double",
		"date": "Date",
		"minStay": "Integer",
		"listingId": "ID",
		"bookedBy": "ID",
		"iCalUrl": "String",
		"externalCalendarIds": "String",
		"isAvailable": "Boolean",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Listingcalendar API

Get a calendar date entry for a listing.

Rest Route

The getListingCalendar API REST controller can be triggered via the following route:

/v1/listingcalendars/:listingCalendarId

Rest Request Parameters

The getListingCalendar api has got 1 regular request parameter

Parameter Type Required Population
listingCalendarId ID true request.params?.[“listingCalendarId”]
listingCalendarId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/listingcalendars/:listingCalendarId

  axios({
    method: 'GET',
    url: `/v1/listingcalendars/${listingCalendarId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingCalendar",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"listingCalendar": {
		"id": "ID",
		"priceOverride": "Double",
		"date": "Date",
		"minStay": "Integer",
		"listingId": "ID",
		"bookedBy": "ID",
		"iCalUrl": "String",
		"externalCalendarIds": "String",
		"isAvailable": "Boolean",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Listingcalendars API

List calendar entries for one or more listings/dates. Used for display and availability search.

Rest Route

The listListingCalendars API REST controller can be triggered via the following route:

/v1/listingcalendars

Rest Request Parameters

Filter Parameters

The listListingCalendars api supports 2 optional filter parameters for filtering list results:

date (Date): Filter by date

listingId (ID): Filter by listingId

REST Request To access the api you can use the REST controller with the path GET /v1/listingcalendars

  axios({
    method: 'GET',
    url: '/v1/listingcalendars',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // date: '<value>' // Filter by date
        // listingId: '<value>' // Filter by listingId
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingCalendars",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"listingCalendars": [
		{
			"id": "ID",
			"priceOverride": "Double",
			"date": "Date",
			"minStay": "Integer",
			"listingId": "ID",
			"bookedBy": "ID",
			"iCalUrl": "String",
			"externalCalendarIds": "String",
			"isAvailable": "Boolean",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Get Listing API

Get a property listing, including enriched amenities and available locales.

Rest Route

The getListing API REST controller can be triggered via the following route:

/v1/listings/:listingId

Rest Request Parameters

The getListing api has got 1 regular request parameter

Parameter Type Required Population
listingId ID true request.params?.[“listingId”]
listingId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/listings/:listingId

  axios({
    method: 'GET',
    url: `/v1/listings/${listingId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listing",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"listing": {
		"id": "ID",
		"title": "String",
		"amenityIds": "ID",
		"hostId": "ID",
		"mainPhoto": "String",
		"photos": "String",
		"address": "String",
		"pricePerNight": "Double",
		"description": "Text",
		"propertyType": "Enum",
		"propertyType_idx": "Integer",
		"location": "Object",
		"maxStay": "Integer",
		"minStay": "Integer",
		"currency": "String",
		"seasonalPricing": "Object",
		"approvalType": "Enum",
		"approvalType_idx": "Integer",
		"bookingPolicies": "Object",
		"cancellationPolicy": "Object",
		"languagesSupported": "String",
		"houseRules": "Text",
		"isPublished": "Boolean",
		"cityTaxPercent": "Double",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"amenities": {
			"iconUrl": "String",
			"name": "String"
		},
		"reviews": {
			"moderationStatus": "Enum",
			"moderationStatus_idx": "Integer",
			"isPublished": "Boolean",
			"reviewText": "Text",
			"rating": "Integer",
			"revieweeId": "ID",
			"reservationId": "ID",
			"reviewerId": "ID",
			"revieweeType": "Enum",
			"revieweeType_idx": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date"
		},
		"rezervations": [
			{
				"bookingStatus": "Enum",
				"bookingStatus_idx": "Integer",
				"guestId": "ID"
			},
			{},
			{}
		]
	}
}

Create Listinglocaletext API

Add a localized title & description for a listing/language pair.

Rest Route

The createListingLocaleText API REST controller can be triggered via the following route:

/v1/listinglocaletexts

Rest Request Parameters

The createListingLocaleText api has got 4 regular request parameters

Parameter Type Required Population
localizedDescription Text true request.body?.[“localizedDescription”]
localizedTitle String true request.body?.[“localizedTitle”]
listingId ID true request.body?.[“listingId”]
languageCode String true request.body?.[“languageCode”]
localizedDescription :
localizedTitle :
listingId :
languageCode :

REST Request To access the api you can use the REST controller with the path POST /v1/listinglocaletexts

  axios({
    method: 'POST',
    url: '/v1/listinglocaletexts',
    data: {
            localizedDescription:"Text",  
            localizedTitle:"String",  
            listingId:"ID",  
            languageCode:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingLocaleText",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"listingLocaleText": {
		"id": "ID",
		"localizedDescription": "Text",
		"localizedTitle": "String",
		"listingId": "ID",
		"languageCode": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Listingamenities API

List all amenity options (public for guests/hosts creating listings).

Rest Route

The listListingAmenities API REST controller can be triggered via the following route:

/v1/listingamenities

Rest Request Parameters

Filter Parameters

The listListingAmenities api supports 1 optional filter parameter for filtering list results:

name (String): Filter by name

REST Request To access the api you can use the REST controller with the path GET /v1/listingamenities

  axios({
    method: 'GET',
    url: '/v1/listingamenities',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // name: '<value>' // Filter by name
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingAmenities",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"listingAmenities": [
		{
			"id": "ID",
			"iconUrl": "String",
			"name": "String",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Delete Listinglocaletext API

Delete (soft-delete) a locale text entry for a listing/language.

Rest Route

The deleteListingLocaleText API REST controller can be triggered via the following route:

/v1/listinglocaletexts/:listingLocaleTextId

Rest Request Parameters

The deleteListingLocaleText api has got 1 regular request parameter

Parameter Type Required Population
listingLocaleTextId ID true request.params?.[“listingLocaleTextId”]
listingLocaleTextId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/listinglocaletexts/:listingLocaleTextId

  axios({
    method: 'DELETE',
    url: `/v1/listinglocaletexts/${listingLocaleTextId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingLocaleText",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"listingLocaleText": {
		"id": "ID",
		"localizedDescription": "Text",
		"localizedTitle": "String",
		"listingId": "ID",
		"languageCode": "String",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Listinglocaletexts API

List all localized texts for a given listing (multi-language support).

Rest Route

The listListingLocaleTexts API REST controller can be triggered via the following route:

/v1/listinglocaletexts

Rest Request Parameters

Filter Parameters

The listListingLocaleTexts api supports 2 optional filter parameters for filtering list results:

listingId (ID): Filter by listingId

languageCode (String): Filter by languageCode

REST Request To access the api you can use the REST controller with the path GET /v1/listinglocaletexts

  axios({
    method: 'GET',
    url: '/v1/listinglocaletexts',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // listingId: '<value>' // Filter by listingId
        // languageCode: '<value>' // Filter by languageCode
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingLocaleTexts",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"listingLocaleTexts": [
		{
			"id": "ID",
			"localizedDescription": "Text",
			"localizedTitle": "String",
			"listingId": "ID",
			"languageCode": "String",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Update Listinglocaletext API

Update a localized title/description for a listing/language.

Rest Route

The updateListingLocaleText API REST controller can be triggered via the following route:

/v1/listinglocaletexts/:listingLocaleTextId

Rest Request Parameters

The updateListingLocaleText api has got 3 regular request parameters

Parameter Type Required Population
listingLocaleTextId ID true request.params?.[“listingLocaleTextId”]
localizedDescription Text false request.body?.[“localizedDescription”]
localizedTitle String false request.body?.[“localizedTitle”]
listingLocaleTextId : This id paremeter is used to select the required data object that will be updated
localizedDescription :
localizedTitle :

REST Request To access the api you can use the REST controller with the path PATCH /v1/listinglocaletexts/:listingLocaleTextId

  axios({
    method: 'PATCH',
    url: `/v1/listinglocaletexts/${listingLocaleTextId}`,
    data: {
            localizedDescription:"Text",  
            localizedTitle:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingLocaleText",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"listingLocaleText": {
		"id": "ID",
		"localizedDescription": "Text",
		"localizedTitle": "String",
		"listingId": "ID",
		"languageCode": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Listingamenity API

Update an amenity (admin only).

Rest Route

The updateListingAmenity API REST controller can be triggered via the following route:

/v1/listingamenities/:listingAmenityId

Rest Request Parameters

The updateListingAmenity api has got 2 regular request parameters

Parameter Type Required Population
listingAmenityId ID true request.params?.[“listingAmenityId”]
iconUrl String false request.body?.[“iconUrl”]
listingAmenityId : This id paremeter is used to select the required data object that will be updated
iconUrl :

REST Request To access the api you can use the REST controller with the path PATCH /v1/listingamenities/:listingAmenityId

  axios({
    method: 'PATCH',
    url: `/v1/listingamenities/${listingAmenityId}`,
    data: {
            iconUrl:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingAmenity",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"listingAmenity": {
		"id": "ID",
		"iconUrl": "String",
		"name": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Listingamenity API

Get information for a listed amenity (public).

Rest Route

The getListingAmenity API REST controller can be triggered via the following route:

/v1/listingamenities/:listingAmenityId

Rest Request Parameters

The getListingAmenity api has got 1 regular request parameter

Parameter Type Required Population
listingAmenityId ID true request.params?.[“listingAmenityId”]
listingAmenityId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/listingamenities/:listingAmenityId

  axios({
    method: 'GET',
    url: `/v1/listingamenities/${listingAmenityId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingAmenity",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"listingAmenity": {
		"id": "ID",
		"iconUrl": "String",
		"name": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Listinglocaletext API

Get localized listing title/description (by listing/language).

Rest Route

The getListingLocaleText API REST controller can be triggered via the following route:

/v1/listinglocaletexts/:listingLocaleTextId

Rest Request Parameters

The getListingLocaleText api has got 1 regular request parameter

Parameter Type Required Population
listingLocaleTextId ID true request.params?.[“listingLocaleTextId”]
listingLocaleTextId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/listinglocaletexts/:listingLocaleTextId

  axios({
    method: 'GET',
    url: `/v1/listinglocaletexts/${listingLocaleTextId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingLocaleText",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"listingLocaleText": {
		"id": "ID",
		"localizedDescription": "Text",
		"localizedTitle": "String",
		"listingId": "ID",
		"languageCode": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Create Listingamenity API

Add a new amenity to the master amenity list.

Rest Route

The createListingAmenity API REST controller can be triggered via the following route:

/v1/listingamenities

Rest Request Parameters

The createListingAmenity api has got 2 regular request parameters

Parameter Type Required Population
iconUrl String false request.body?.[“iconUrl”]
name String true request.body?.[“name”]
iconUrl :
name :

REST Request To access the api you can use the REST controller with the path POST /v1/listingamenities

  axios({
    method: 'POST',
    url: '/v1/listingamenities',
    data: {
            iconUrl:"String",  
            name:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingAmenity",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"listingAmenity": {
		"id": "ID",
		"iconUrl": "String",
		"name": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete Listingamenity API

Delete (soft-delete) an amenity (admin only).

Rest Route

The deleteListingAmenity API REST controller can be triggered via the following route:

/v1/listingamenities/:listingAmenityId

Rest Request Parameters

The deleteListingAmenity api has got 1 regular request parameter

Parameter Type Required Population
listingAmenityId ID true request.params?.[“listingAmenityId”]
listingAmenityId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/listingamenities/:listingAmenityId

  axios({
    method: 'DELETE',
    url: `/v1/listingamenities/${listingAmenityId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "listingAmenity",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"listingAmenity": {
		"id": "ID",
		"iconUrl": "String",
		"name": "String",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Authentication Specific Routes

Common Routes

Route: currentuser

Route Definition: Retrieves the currently authenticated user’s session information.

Route Type: sessionInfo

Access Route: GET /currentuser

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /currentuser call
axios.get("/currentuser", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response Returns the session object, including user-related data and token information.

{
  "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9",
  "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
  "email": "user@example.com",
  "fullname": "John Doe",
  "roleId": "user",
  "tenantId": "abc123",
  "accessToken": "jwt-token-string",
  ...
}

Error Response 401 Unauthorized: No active session found.

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Route: permissions

*Route Definition*: Retrieves all effective permission records assigned to the currently authenticated user.

*Route Type*: permissionFetch

Access Route: GET /permissions

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /permissions call
axios.get("/permissions", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

Returns an array of permission objects.

[
  {
    "id": "perm1",
    "permissionName": "adminPanel.access",
    "roleId": "admin",
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  },
  {
    "id": "perm2",
    "permissionName": "orders.manage",
    "roleId": null,
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  }
]

Each object reflects a single permission grant, aligned with the givenPermissions model:

Error Responses

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Tip: Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations.

Route: permissions/:permissionName

Route Definition: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions.

Route Type: permissionScopeCheck

Access Route: GET /permissions/:permissionName

Parameters

Parameter Type Required Population
permissionName String Yes request.params.permissionName

Behavior

// Sample GET /permissions/orders.manage
axios.get("/permissions/orders.manage", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

{
  "canDo": true,
  "exceptions": [
    "a1f2e3d4-xxxx-yyyy-zzzz-object1",
    "b2c3d4e5-xxxx-yyyy-zzzz-object2"
  ]
}

Copyright

All sources, documents and other digital materials are copyright of .

About Us

For more information please visit our website: .

. .


REST API GUIDE

airbnb-bookingmanagement-service

Version: 1.0.5

Orchestrates booking, payment, calendar, changewsand dispute flows for Airbnb-style short-term rental marketplace…test Handles reservations, approval, Stripe payments, iCal sync, payment records, and the dispute/refund lifecycle with host/guest/admin visibility.

Architectural Design Credit and Contact Information

The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to:

Email:

We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice.

Documentation Scope

Welcome to the official documentation for the BookingManagement Service’s REST API. This document is designed to provide a comprehensive guide to interfacing with our BookingManagement Service exclusively through RESTful API endpoints.

Intended Audience

This documentation is intended for developers and integrators who are looking to interact with the BookingManagement Service via HTTP requests for purposes such as creating, updating, deleting and querying BookingManagement objects.

Overview

Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases.

Beyond REST It’s important to note that the BookingManagement Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation.

Authentication And Authorization

To ensure secure access to the BookingManagement service’s protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it’s important to note that access control varies across different routes:

Protected API: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected.

**Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token.

Token Locations

When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters.

Location Token Name / Param Name
Query access_token
Authorization Header Bearer
Header airbnb3-access-token
Cookie airbnb3-access-token

Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies.

Api Definitions

This section outlines the API endpoints available within the BookingManagement service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It’s important to understand the flexibility in how parameters can be included in requests to effectively interact with the BookingManagement service.

This service is configured to listen for HTTP requests on port 3001, serving both the main API interface and default administrative endpoints.

The following routes are available by default:

This service is accessible via the following environment-specific URLs:

Parameter Inclusion Methods: Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests:

Query Parameters: Included directly in the URL’s query string.

Path Parameters: Embedded within the URL’s path.

Body Parameters: Sent within the JSON body of the request.

Session Parameters: Automatically read from the session object. This method is used for parameters that are intrinsic to the user’s session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request.

Note on Session Parameters: Session parameters represent a unique method of parameter inclusion, relying on the context of the user’s session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request.

By adhering to the specified parameter inclusion methods, you can effectively utilize the BookingManagement service’s API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below.

Common Parameters

The BookingManagement service’s business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL.

Supported Common Parameters:

By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the BookingManagement service.

Error Response

If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity:

Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently.

{
  "result": "ERR",
  "status": 400,
  "message": "errMsg_organizationIdisNotAValidID",
  "errCode": 400,
  "date": "2024-03-19T12:13:54.124Z",
  "detail": "String"
}

Object Structure of a Successfull Response

When the BookingManagement service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client.

Key Characteristics of the Response Envelope:

Design Considerations: The structure of a API’s response data is meticulously crafted during the service’s architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information.

Brief Data: Certain API’s return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect.

API Response Structure

The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response.

HTTP Status Codes:

Success Response Format:

For successful operations, the response includes a "status": "OK" property, signaling the successful execution of the request. The structure of a successful response is outlined below:

{
  "status":"OK",
  "statusCode": 200,   
  "elapsedMs":126,
  "ssoTime":120,
  "source": "db",
  "cacheKey": "hexCode",
  "userId": "ID",
  "sessionId": "ID",
  "requestId": "ID",
  "dataName":"products",
  "method":"GET",
  "action":"list",
  "appVersion":"Version",
  "rowCount":3
  "products":[{},{},{}],
  "paging": {
    "pageNumber":1, 
    "pageRowCount":25, 
    "totalRowCount":3,
    "pageCount":1
  },
  "filters": [],
  "uiPermissions": []
}

Handling Errors:

For details on handling error scenarios and understanding the structure of error responses, please refer to the “Error Response” section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages.

Resources

BookingManagement service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service.

Reservation resource

Resource Definition : Represents a guest's booking for a property listing, including dates, participants, approval/payment/dispute status, and iCal sync info… Reservation Resource Properties

Name Type Required Default Definition
listingId ID **
approvalType Enum **
bookingStatus Enum **
hostId ID **
checkOut Date **
guestId ID **
checkIn Date **
currency String **
guestCount Integer **
totalPrice Double **
iCalExportUrl String **
disputeStatus Enum **
bookingPoliciesSnapshot Object **
iCalImportSource String **
cancellationPolicySnapshot Object **
paymentConfirmation Enum An automatic property that is used to check the confirmed status of the payment set by webhooks.

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

approvalType Enum Property

Enum Options

Name Value Index
instant "instant"" 0
manual "manual"" 1
bookingStatus Enum Property

Enum Options

Name Value Index
pending "pending"" 0
confirmed "confirmed"" 1
complete "complete"" 2
cancelled "cancelled"" 3
declined "declined"" 4
disputeStatus Enum Property

Enum Options

Name Value Index
none "none"" 0
requested "requested"" 1
active "active"" 2
resolved "resolved"" 3
paymentConfirmation Enum Property

Property Definition : An automatic property that is used to check the confirmed status of the payment set by webhooks.Enum Options

Name Value Index
pending "pending"" 0
processing "processing"" 1
paid "paid"" 2
canceled "canceled"" 3

PaymentRecord resource

Resource Definition : Stores payment and payout records (Stripe-driven) linked to a reservation (guest booking), including platform fees, taxes, host payouts, and status updates. Immutable after creation, never hard deleted. PaymentRecord Resource Properties

Name Type Required Default Definition
reservationId ID **
stripeChargeId String **
payoutAmountHost Double **
paymentIntentId String **
currency String **
cityTax Double **
refundAmount Double **
amountPaid Double **
paymentStatus Enum **
platformFee Double **
paymentDate Date **

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

paymentStatus Enum Property

Enum Options

Name Value Index
pending "pending"" 0
paid "paid"" 1
refunded "refunded"" 2
failed "failed"" 3

Dispute resource

Resource Definition : Represents a dispute, refund request, or booking issue reported by guest/host/admin for a reservation. Flows to admin for handling, resolves with resolutionStatus and reference to any refund/payment involved. Dispute Resource Properties

Name Type Required Default Definition
reportedAt Date **
reservationId ID **
raisedBy ID **
adminId ID **
issueType String **
description Text **
relatedPaymentId ID **
resolutionStatus Enum **
resolvedAt Date **
refundApproved Boolean **

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

resolutionStatus Enum Property

Enum Options

Name Value Index
pending "pending"" 0
reviewing "reviewing"" 1
resolved "resolved"" 2
rejected "rejected"" 3

Sys_reservationPayment resource

Resource Definition : A payment storage object to store the payment life cyle of orders based on reservation object. It is autocreated based on the source object's checkout config Sys_reservationPayment Resource Properties

Name Type Required Default Definition
ownerId ID * An ID value to represent owner user who created the order*
orderId ID an ID value to represent the orderId which is the ID parameter of the source reservation object
paymentId String A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type
paymentStatus String A string value to represent the payment status which belongs to the lifecyle of a Stripe payment.
statusLiteral String A string value to represent the logical payment status which belongs to the application lifecycle itself.
redirectUrl String A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client.

Sys_paymentCustomer resource

Resource Definition : A payment storage object to store the customer values of the payment platform Sys_paymentCustomer Resource Properties

Name Type Required Default Definition
userId ID * An ID value to represent the user who is created as a stripe customer*
customerId String A string value to represent the customer id which is generated on the Stripe gateway. This id is used to represent the customer in the Stripe gateway
platform String A String value to represent payment platform which is used to make the payment. It is stripe as default. It will be used to distinguesh the payment gateways in the future.

Sys_paymentMethod resource

Resource Definition : A payment storage object to store the payment methods of the platform customers Sys_paymentMethod Resource Properties

Name Type Required Default Definition
paymentMethodId String A string value to represent the id of the payment method on the payment platform.
userId ID * An ID value to represent the user who owns the payment method*
customerId String A string value to represent the customer id which is generated on the payment gateway.
cardHolderName String A string value to represent the name of the card holder. It can be different than the registered customer.
cardHolderZip String A string value to represent the zip code of the card holder. It is used for address verification in specific countries.
platform String A String value to represent payment platform which teh paymentMethod belongs. It is stripe as default. It will be used to distinguesh the payment gateways in the future.
cardInfo Object A Json value to store the card details of the payment method.

Business Api

Update Dispute API

Updates dispute fields like status, admin assignment, resolution notes. Only admin or assigned party can update (enforced by membership/role checks).

Rest Route

The updateDispute API REST controller can be triggered via the following route:

/v1/disputes/:disputeId

Rest Request Parameters

The updateDispute api has got 7 regular request parameters

Parameter Type Required Population
disputeId ID true request.params?.[“disputeId”]
adminId ID false request.body?.[“adminId”]
issueType String false request.body?.[“issueType”]
description Text false request.body?.[“description”]
resolutionStatus Enum false request.body?.[“resolutionStatus”]
resolvedAt Date false request.body?.[“resolvedAt”]
refundApproved Boolean false request.body?.[“refundApproved”]
disputeId : This id paremeter is used to select the required data object that will be updated
adminId :
issueType :
description :
resolutionStatus :
resolvedAt :
refundApproved :

REST Request To access the api you can use the REST controller with the path PATCH /v1/disputes/:disputeId

  axios({
    method: 'PATCH',
    url: `/v1/disputes/${disputeId}`,
    data: {
            adminId:"ID",  
            issueType:"String",  
            description:"Text",  
            resolutionStatus:"Enum",  
            resolvedAt:"Date",  
            refundApproved:"Boolean",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "dispute",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"dispute": {
		"id": "ID",
		"reportedAt": "Date",
		"reservationId": "ID",
		"raisedBy": "ID",
		"adminId": "ID",
		"issueType": "String",
		"description": "Text",
		"relatedPaymentId": "ID",
		"resolutionStatus": "Enum",
		"resolutionStatus_idx": "Integer",
		"resolvedAt": "Date",
		"refundApproved": "Boolean",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Paymentrecord API

Get a payment record by ID (owner or admin only). No selectJoin for privacy. Returned for auditing or user view.

Rest Route

The getPaymentRecord API REST controller can be triggered via the following route:

/v1/paymentrecords/:paymentRecordId

Rest Request Parameters

The getPaymentRecord api has got 1 regular request parameter

Parameter Type Required Population
paymentRecordId ID true request.params?.[“paymentRecordId”]
paymentRecordId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/paymentrecords/:paymentRecordId

  axios({
    method: 'GET',
    url: `/v1/paymentrecords/${paymentRecordId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "paymentRecord",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"paymentRecord": {
		"id": "ID",
		"reservationId": "ID",
		"stripeChargeId": "String",
		"payoutAmountHost": "Double",
		"paymentIntentId": "String",
		"currency": "String",
		"cityTax": "Double",
		"refundAmount": "Double",
		"amountPaid": "Double",
		"paymentStatus": "Enum",
		"paymentStatus_idx": "Integer",
		"platformFee": "Double",
		"paymentDate": "Date",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Reservation API

Fetch a single reservation (for guest, host, or admin). Auto-includes related listing and payments via selectJoin.

Rest Route

The getReservation API REST controller can be triggered via the following route:

/v1/reservations/:reservationId

Rest Request Parameters

The getReservation api has got 1 regular request parameter

Parameter Type Required Population
reservationId ID true request.params?.[“reservationId”]
reservationId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/reservations/:reservationId

  axios({
    method: 'GET',
    url: `/v1/reservations/${reservationId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "reservation",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"reservation": {
		"id": "ID",
		"listingId": "ID",
		"approvalType": "Enum",
		"approvalType_idx": "Integer",
		"bookingStatus": "Enum",
		"bookingStatus_idx": "Integer",
		"hostId": "ID",
		"checkOut": "Date",
		"guestId": "ID",
		"checkIn": "Date",
		"currency": "String",
		"guestCount": "Integer",
		"totalPrice": "Double",
		"iCalExportUrl": "String",
		"disputeStatus": "Enum",
		"disputeStatus_idx": "Integer",
		"bookingPoliciesSnapshot": "Object",
		"iCalImportSource": "String",
		"cancellationPolicySnapshot": "Object",
		"paymentConfirmation": "Enum",
		"paymentConfirmation_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Create Dispute API

Guest/host opens a formal dispute related to a reservation. Admin is only assigned after initial review. Can only be created by guest/host of reservation (enforced in logic).

Rest Route

The createDispute API REST controller can be triggered via the following route:

/v1/disputes

Rest Request Parameters

The createDispute api has got 10 regular request parameters

Parameter Type Required Population
reportedAt Date true request.body?.[“reportedAt”]
reservationId ID true request.body?.[“reservationId”]
raisedBy ID true request.body?.[“raisedBy”]
adminId ID false request.body?.[“adminId”]
issueType String true request.body?.[“issueType”]
description Text true request.body?.[“description”]
relatedPaymentId ID false request.body?.[“relatedPaymentId”]
resolutionStatus Enum true request.body?.[“resolutionStatus”]
resolvedAt Date false request.body?.[“resolvedAt”]
refundApproved Boolean false request.body?.[“refundApproved”]
reportedAt :
reservationId :
raisedBy :
adminId :
issueType :
description :
relatedPaymentId :
resolutionStatus :
resolvedAt :
refundApproved :

REST Request To access the api you can use the REST controller with the path POST /v1/disputes

  axios({
    method: 'POST',
    url: '/v1/disputes',
    data: {
            reportedAt:"Date",  
            reservationId:"ID",  
            raisedBy:"ID",  
            adminId:"ID",  
            issueType:"String",  
            description:"Text",  
            relatedPaymentId:"ID",  
            resolutionStatus:"Enum",  
            resolvedAt:"Date",  
            refundApproved:"Boolean",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "dispute",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"dispute": {
		"id": "ID",
		"reportedAt": "Date",
		"reservationId": "ID",
		"raisedBy": "ID",
		"adminId": "ID",
		"issueType": "String",
		"description": "Text",
		"relatedPaymentId": "ID",
		"resolutionStatus": "Enum",
		"resolutionStatus_idx": "Integer",
		"resolvedAt": "Date",
		"refundApproved": "Boolean",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Reservations API

List reservations (bookings) for guest, host, or admin. Includes selectJoin for listing/guest/host info. Filterable by guestId, hostId, status, etc.

Rest Route

The listReservations API REST controller can be triggered via the following route:

/v1/reservations

Rest Request Parameters

Filter Parameters

The listReservations api supports 7 optional filter parameters for filtering list results:

listingId (ID): Filter by listingId

approvalType (Enum): Filter by approvalType

bookingStatus (Enum): Filter by bookingStatus

hostId (ID): Filter by hostId

guestId (ID): Filter by guestId

checkIn (Date): Filter by checkIn

paymentConfirmation (Enum): An automatic property that is used to check the confirmed status of the payment set by webhooks.

REST Request To access the api you can use the REST controller with the path GET /v1/reservations

  axios({
    method: 'GET',
    url: '/v1/reservations',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // listingId: '<value>' // Filter by listingId
        // approvalType: '<value>' // Filter by approvalType
        // bookingStatus: '<value>' // Filter by bookingStatus
        // hostId: '<value>' // Filter by hostId
        // guestId: '<value>' // Filter by guestId
        // checkIn: '<value>' // Filter by checkIn
        // paymentConfirmation: '<value>' // Filter by paymentConfirmation
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "reservations",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"reservations": [
		{
			"id": "ID",
			"listingId": "ID",
			"approvalType": "Enum",
			"approvalType_idx": "Integer",
			"bookingStatus": "Enum",
			"bookingStatus_idx": "Integer",
			"hostId": "ID",
			"checkOut": "Date",
			"guestId": "ID",
			"checkIn": "Date",
			"currency": "String",
			"guestCount": "Integer",
			"totalPrice": "Double",
			"iCalExportUrl": "String",
			"disputeStatus": "Enum",
			"disputeStatus_idx": "Integer",
			"bookingPoliciesSnapshot": "Object",
			"iCalImportSource": "String",
			"cancellationPolicySnapshot": "Object",
			"paymentConfirmation": "Enum",
			"paymentConfirmation_idx": "Integer",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"listingJoins": [
				{
					"title": "String",
					"amenityIds": "ID",
					"hostId": "ID",
					"mainPhoto": "String",
					"photos": "String",
					"address": "String",
					"propertyType": "Enum",
					"propertyType_idx": "Integer",
					"location": "Object"
				},
				{},
				{}
			],
			"hostDetails": [
				{
					"email": "String",
					"fullname": "String",
					"avatar": "String"
				},
				{},
				{}
			]
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Create Reservation API

Guest initiates a reservation for a listing (instant or manual). Handles calendar check, approvalType, payment intent, and booking policies. Triggers Stripe checkout. Only allowed if dates are available and not conflicting. Guest is current user.

Rest Route

The createReservation API REST controller can be triggered via the following route:

/v1/reservations

Rest Request Parameters

The createReservation api has got 14 regular request parameters

Parameter Type Required Population
listingId ID true request.body?.[“listingId”]
approvalType Enum true request.body?.[“approvalType”]
bookingStatus Enum true request.body?.[“bookingStatus”]
hostId ID true request.body?.[“hostId”]
checkOut Date true request.body?.[“checkOut”]
checkIn Date true request.body?.[“checkIn”]
currency String true request.body?.[“currency”]
guestCount Integer true request.body?.[“guestCount”]
totalPrice Double true request.body?.[“totalPrice”]
iCalExportUrl String false request.body?.[“iCalExportUrl”]
disputeStatus Enum true request.body?.[“disputeStatus”]
bookingPoliciesSnapshot Object true request.body?.[“bookingPoliciesSnapshot”]
iCalImportSource String false request.body?.[“iCalImportSource”]
cancellationPolicySnapshot Object true request.body?.[“cancellationPolicySnapshot”]
listingId :
approvalType :
bookingStatus :
hostId :
checkOut :
checkIn :
currency :
guestCount :
totalPrice :
iCalExportUrl :
disputeStatus :
bookingPoliciesSnapshot :
iCalImportSource :
cancellationPolicySnapshot :

REST Request To access the api you can use the REST controller with the path POST /v1/reservations

  axios({
    method: 'POST',
    url: '/v1/reservations',
    data: {
            listingId:"ID",  
            approvalType:"Enum",  
            bookingStatus:"Enum",  
            hostId:"ID",  
            checkOut:"Date",  
            checkIn:"Date",  
            currency:"String",  
            guestCount:"Integer",  
            totalPrice:"Double",  
            iCalExportUrl:"String",  
            disputeStatus:"Enum",  
            bookingPoliciesSnapshot:"Object",  
            iCalImportSource:"String",  
            cancellationPolicySnapshot:"Object",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "reservation",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"reservation": {
		"id": "ID",
		"listingId": "ID",
		"approvalType": "Enum",
		"approvalType_idx": "Integer",
		"bookingStatus": "Enum",
		"bookingStatus_idx": "Integer",
		"hostId": "ID",
		"checkOut": "Date",
		"guestId": "ID",
		"checkIn": "Date",
		"currency": "String",
		"guestCount": "Integer",
		"totalPrice": "Double",
		"iCalExportUrl": "String",
		"disputeStatus": "Enum",
		"disputeStatus_idx": "Integer",
		"bookingPoliciesSnapshot": "Object",
		"iCalImportSource": "String",
		"cancellationPolicySnapshot": "Object",
		"paymentConfirmation": "Enum",
		"paymentConfirmation_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Create Paymentrecord API

Creates or logs payment record for a reservation (from payment success or admin/manual trigger). Populates from Stripe events/webhooks. Only creates; no update/delete (for compliance/audit).

Rest Route

The createPaymentRecord API REST controller can be triggered via the following route:

/v1/paymentrecords

Rest Request Parameters

The createPaymentRecord api has got 11 regular request parameters

Parameter Type Required Population
reservationId ID true request.body?.[“reservationId”]
stripeChargeId String false request.body?.[“stripeChargeId”]
payoutAmountHost Double false request.body?.[“payoutAmountHost”]
paymentIntentId String true request.body?.[“paymentIntentId”]
currency String true request.body?.[“currency”]
cityTax Double false request.body?.[“cityTax”]
refundAmount Double false request.body?.[“refundAmount”]
amountPaid Double true request.body?.[“amountPaid”]
paymentStatus Enum true request.body?.[“paymentStatus”]
platformFee Double false request.body?.[“platformFee”]
paymentDate Date false request.body?.[“paymentDate”]
reservationId :
stripeChargeId :
payoutAmountHost :
paymentIntentId :
currency :
cityTax :
refundAmount :
amountPaid :
paymentStatus :
platformFee :
paymentDate :

REST Request To access the api you can use the REST controller with the path POST /v1/paymentrecords

  axios({
    method: 'POST',
    url: '/v1/paymentrecords',
    data: {
            reservationId:"ID",  
            stripeChargeId:"String",  
            payoutAmountHost:"Double",  
            paymentIntentId:"String",  
            currency:"String",  
            cityTax:"Double",  
            refundAmount:"Double",  
            amountPaid:"Double",  
            paymentStatus:"Enum",  
            platformFee:"Double",  
            paymentDate:"Date",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "paymentRecord",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"paymentRecord": {
		"id": "ID",
		"reservationId": "ID",
		"stripeChargeId": "String",
		"payoutAmountHost": "Double",
		"paymentIntentId": "String",
		"currency": "String",
		"cityTax": "Double",
		"refundAmount": "Double",
		"amountPaid": "Double",
		"paymentStatus": "Enum",
		"paymentStatus_idx": "Integer",
		"platformFee": "Double",
		"paymentDate": "Date",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Paymentrecords API

List payment records (reservation/guest/host or admin, includes filters if needed). Used for financial histories/exports. No selectJoin, for privacy and performance.

Rest Route

The listPaymentRecords API REST controller can be triggered via the following route:

/v1/paymentrecords

Rest Request Parameters The listPaymentRecords api has got no request parameters.

REST Request To access the api you can use the REST controller with the path GET /v1/paymentrecords

  axios({
    method: 'GET',
    url: '/v1/paymentrecords',
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "paymentRecords",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"paymentRecords": [
		{
			"id": "ID",
			"reservationId": "ID",
			"stripeChargeId": "String",
			"payoutAmountHost": "Double",
			"paymentIntentId": "String",
			"currency": "String",
			"cityTax": "Double",
			"refundAmount": "Double",
			"amountPaid": "Double",
			"paymentStatus": "Enum",
			"paymentStatus_idx": "Integer",
			"platformFee": "Double",
			"paymentDate": "Date",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Delete Reservation API

Cancels or removes a reservation (soft-delete). Guest, host or admin may delete (ownership enforced). Used for cancellations before stay begins or admin moderation.

Rest Route

The deleteReservation API REST controller can be triggered via the following route:

/v1/reservations/:reservationId

Rest Request Parameters

The deleteReservation api has got 1 regular request parameter

Parameter Type Required Population
reservationId ID true request.params?.[“reservationId”]
reservationId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/reservations/:reservationId

  axios({
    method: 'DELETE',
    url: `/v1/reservations/${reservationId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "reservation",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"reservation": {
		"id": "ID",
		"listingId": "ID",
		"approvalType": "Enum",
		"approvalType_idx": "Integer",
		"bookingStatus": "Enum",
		"bookingStatus_idx": "Integer",
		"hostId": "ID",
		"checkOut": "Date",
		"guestId": "ID",
		"checkIn": "Date",
		"currency": "String",
		"guestCount": "Integer",
		"totalPrice": "Double",
		"iCalExportUrl": "String",
		"disputeStatus": "Enum",
		"disputeStatus_idx": "Integer",
		"bookingPoliciesSnapshot": "Object",
		"iCalImportSource": "String",
		"cancellationPolicySnapshot": "Object",
		"paymentConfirmation": "Enum",
		"paymentConfirmation_idx": "Integer",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Reservation API

Update an existing reservation (allowed fields: only those which do not affect core identity/relations—e.g., guestCount if update allowed, NOT dates/listingId). Used for confirming cancellation, updating status by host/guest, or marking as completed. Permission: must be guest, host, or admin.

Rest Route

The updateReservation API REST controller can be triggered via the following route:

/v1/reservations/:reservationId

Rest Request Parameters

The updateReservation api has got 5 regular request parameters

Parameter Type Required Population
reservationId ID true request.params?.[“reservationId”]
bookingStatus Enum false request.body?.[“bookingStatus”]
iCalExportUrl String false request.body?.[“iCalExportUrl”]
disputeStatus Enum false request.body?.[“disputeStatus”]
iCalImportSource String false request.body?.[“iCalImportSource”]
reservationId : This id paremeter is used to select the required data object that will be updated
bookingStatus :
iCalExportUrl :
disputeStatus :
iCalImportSource :

REST Request To access the api you can use the REST controller with the path PATCH /v1/reservations/:reservationId

  axios({
    method: 'PATCH',
    url: `/v1/reservations/${reservationId}`,
    data: {
            bookingStatus:"Enum",  
            iCalExportUrl:"String",  
            disputeStatus:"Enum",  
            iCalImportSource:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "reservation",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"reservation": {
		"id": "ID",
		"listingId": "ID",
		"approvalType": "Enum",
		"approvalType_idx": "Integer",
		"bookingStatus": "Enum",
		"bookingStatus_idx": "Integer",
		"hostId": "ID",
		"checkOut": "Date",
		"guestId": "ID",
		"checkIn": "Date",
		"currency": "String",
		"guestCount": "Integer",
		"totalPrice": "Double",
		"iCalExportUrl": "String",
		"disputeStatus": "Enum",
		"disputeStatus_idx": "Integer",
		"bookingPoliciesSnapshot": "Object",
		"iCalImportSource": "String",
		"cancellationPolicySnapshot": "Object",
		"paymentConfirmation": "Enum",
		"paymentConfirmation_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Disputes API

List disputes visible to the user (as guest, host, or admin). Used for admin screening and user support view. No joins for privacy. Filterable by reservationId, raisedBy, status, etc.

Rest Route

The listDisputes API REST controller can be triggered via the following route:

/v1/disputes

Rest Request Parameters The listDisputes api has got no request parameters.

REST Request To access the api you can use the REST controller with the path GET /v1/disputes

  axios({
    method: 'GET',
    url: '/v1/disputes',
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "disputes",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"disputes": [
		{
			"id": "ID",
			"reportedAt": "Date",
			"reservationId": "ID",
			"raisedBy": "ID",
			"adminId": "ID",
			"issueType": "String",
			"description": "Text",
			"relatedPaymentId": "ID",
			"resolutionStatus": "Enum",
			"resolutionStatus_idx": "Integer",
			"resolvedAt": "Date",
			"refundApproved": "Boolean",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Get Dispute API

Fetch a dispute by ID (guest, host, assigned admin, or admin role). No joins for privacy. Used for support/moderation flows.

Rest Route

The getDispute API REST controller can be triggered via the following route:

/v1/disputes/:disputeId

Rest Request Parameters

The getDispute api has got 1 regular request parameter

Parameter Type Required Population
disputeId ID true request.params?.[“disputeId”]
disputeId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/disputes/:disputeId

  axios({
    method: 'GET',
    url: `/v1/disputes/${disputeId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "dispute",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"dispute": {
		"id": "ID",
		"reportedAt": "Date",
		"reservationId": "ID",
		"raisedBy": "ID",
		"adminId": "ID",
		"issueType": "String",
		"description": "Text",
		"relatedPaymentId": "ID",
		"resolutionStatus": "Enum",
		"resolutionStatus_idx": "Integer",
		"resolvedAt": "Date",
		"refundApproved": "Boolean",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Reservationpayment API

This route is used to get the payment information by ID.

Rest Route

The getReservationPayment API REST controller can be triggered via the following route:

/v1/reservationpayment/:sys_reservationPaymentId

Rest Request Parameters

The getReservationPayment api has got 1 regular request parameter

Parameter Type Required Population
sys_reservationPaymentId ID true request.params?.[“sys_reservationPaymentId”]
sys_reservationPaymentId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/reservationpayment/:sys_reservationPaymentId

  axios({
    method: 'GET',
    url: `/v1/reservationpayment/${sys_reservationPaymentId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_reservationPayment",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_reservationPayment": {
		"id": "ID",
		"ownerId": "ID",
		"orderId": "ID",
		"paymentId": "String",
		"paymentStatus": "String",
		"statusLiteral": "String",
		"redirectUrl": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Reservationpayments API

This route is used to list all payments.

Rest Route

The listReservationPayments API REST controller can be triggered via the following route:

/v1/reservationpayments

Rest Request Parameters

Filter Parameters

The listReservationPayments api supports 6 optional filter parameters for filtering list results:

ownerId (ID): An ID value to represent owner user who created the order

orderId (ID): an ID value to represent the orderId which is the ID parameter of the source reservation object

paymentId (String): A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type

paymentStatus (String): A string value to represent the payment status which belongs to the lifecyle of a Stripe payment.

statusLiteral (String): A string value to represent the logical payment status which belongs to the application lifecycle itself.

redirectUrl (String): A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client.

REST Request To access the api you can use the REST controller with the path GET /v1/reservationpayments

  axios({
    method: 'GET',
    url: '/v1/reservationpayments',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // ownerId: '<value>' // Filter by ownerId
        // orderId: '<value>' // Filter by orderId
        // paymentId: '<value>' // Filter by paymentId
        // paymentStatus: '<value>' // Filter by paymentStatus
        // statusLiteral: '<value>' // Filter by statusLiteral
        // redirectUrl: '<value>' // Filter by redirectUrl
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_reservationPayments",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"sys_reservationPayments": [
		{
			"id": "ID",
			"ownerId": "ID",
			"orderId": "ID",
			"paymentId": "String",
			"paymentStatus": "String",
			"statusLiteral": "String",
			"redirectUrl": "String",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Create Reservationpayment API

This route is used to create a new payment.

Rest Route

The createReservationPayment API REST controller can be triggered via the following route:

/v1/reservationpayment

Rest Request Parameters

The createReservationPayment api has got 5 regular request parameters

Parameter Type Required Population
orderId ID true request.body?.[“orderId”]
paymentId String true request.body?.[“paymentId”]
paymentStatus String true request.body?.[“paymentStatus”]
statusLiteral String true request.body?.[“statusLiteral”]
redirectUrl String false request.body?.[“redirectUrl”]
orderId : an ID value to represent the orderId which is the ID parameter of the source reservation object
paymentId : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type
paymentStatus : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment.
statusLiteral : A string value to represent the logical payment status which belongs to the application lifecycle itself.
redirectUrl : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client.

REST Request To access the api you can use the REST controller with the path POST /v1/reservationpayment

  axios({
    method: 'POST',
    url: '/v1/reservationpayment',
    data: {
            orderId:"ID",  
            paymentId:"String",  
            paymentStatus:"String",  
            statusLiteral:"String",  
            redirectUrl:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_reservationPayment",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_reservationPayment": {
		"id": "ID",
		"ownerId": "ID",
		"orderId": "ID",
		"paymentId": "String",
		"paymentStatus": "String",
		"statusLiteral": "String",
		"redirectUrl": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Reservationpayment API

This route is used to update an existing payment.

Rest Route

The updateReservationPayment API REST controller can be triggered via the following route:

/v1/reservationpayment/:sys_reservationPaymentId

Rest Request Parameters

The updateReservationPayment api has got 5 regular request parameters

Parameter Type Required Population
sys_reservationPaymentId ID true request.params?.[“sys_reservationPaymentId”]
paymentId String false request.body?.[“paymentId”]
paymentStatus String false request.body?.[“paymentStatus”]
statusLiteral String false request.body?.[“statusLiteral”]
redirectUrl String false request.body?.[“redirectUrl”]
sys_reservationPaymentId : This id paremeter is used to select the required data object that will be updated
paymentId : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type
paymentStatus : A string value to represent the payment status which belongs to the lifecyle of a Stripe payment.
statusLiteral : A string value to represent the logical payment status which belongs to the application lifecycle itself.
redirectUrl : A string value to represent return page of the frontend to show the result of the payment, this is used when the callback is made to server not the client.

REST Request To access the api you can use the REST controller with the path PATCH /v1/reservationpayment/:sys_reservationPaymentId

  axios({
    method: 'PATCH',
    url: `/v1/reservationpayment/${sys_reservationPaymentId}`,
    data: {
            paymentId:"String",  
            paymentStatus:"String",  
            statusLiteral:"String",  
            redirectUrl:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_reservationPayment",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_reservationPayment": {
		"id": "ID",
		"ownerId": "ID",
		"orderId": "ID",
		"paymentId": "String",
		"paymentStatus": "String",
		"statusLiteral": "String",
		"redirectUrl": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete Reservationpayment API

This route is used to delete a payment.

Rest Route

The deleteReservationPayment API REST controller can be triggered via the following route:

/v1/reservationpayment/:sys_reservationPaymentId

Rest Request Parameters

The deleteReservationPayment api has got 1 regular request parameter

Parameter Type Required Population
sys_reservationPaymentId ID true request.params?.[“sys_reservationPaymentId”]
sys_reservationPaymentId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/reservationpayment/:sys_reservationPaymentId

  axios({
    method: 'DELETE',
    url: `/v1/reservationpayment/${sys_reservationPaymentId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_reservationPayment",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_reservationPayment": {
		"id": "ID",
		"ownerId": "ID",
		"orderId": "ID",
		"paymentId": "String",
		"paymentStatus": "String",
		"statusLiteral": "String",
		"redirectUrl": "String",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Reservationpaymentbyorderid API

This route is used to get the payment information by order id.

Rest Route

The getReservationPaymentByOrderId API REST controller can be triggered via the following route:

/v1/reservationpaymentbyorderid/:orderId

Rest Request Parameters

The getReservationPaymentByOrderId api has got 1 regular request parameter

Parameter Type Required Population
orderId ID true request.params?.[“orderId”]
orderId : an ID value to represent the orderId which is the ID parameter of the source reservation object. The parameter is used to query data.

REST Request To access the api you can use the REST controller with the path GET /v1/reservationpaymentbyorderid/:orderId

  axios({
    method: 'GET',
    url: `/v1/reservationpaymentbyorderid/${orderId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_reservationPayment",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_reservationPayment": {
		"id": "ID",
		"ownerId": "ID",
		"orderId": "ID",
		"paymentId": "String",
		"paymentStatus": "String",
		"statusLiteral": "String",
		"redirectUrl": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Reservationpaymentbypaymentid API

This route is used to get the payment information by payment id.

Rest Route

The getReservationPaymentByPaymentId API REST controller can be triggered via the following route:

/v1/reservationpaymentbypaymentid/:paymentId

Rest Request Parameters

The getReservationPaymentByPaymentId api has got 1 regular request parameter

Parameter Type Required Population
paymentId String true request.params?.[“paymentId”]
paymentId : A String value to represent the paymentId which is generated on the Stripe gateway. This id may represent different objects due to the payment gateway and the chosen flow type. The parameter is used to query data.

REST Request To access the api you can use the REST controller with the path GET /v1/reservationpaymentbypaymentid/:paymentId

  axios({
    method: 'GET',
    url: `/v1/reservationpaymentbypaymentid/${paymentId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_reservationPayment",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_reservationPayment": {
		"id": "ID",
		"ownerId": "ID",
		"orderId": "ID",
		"paymentId": "String",
		"paymentStatus": "String",
		"statusLiteral": "String",
		"redirectUrl": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Start Reservationpayment API

Start payment for reservation

Rest Route

The startReservationPayment API REST controller can be triggered via the following route:

/v1/startreservationpayment/:reservationId

Rest Request Parameters

The startReservationPayment api has got 2 regular request parameters

Parameter Type Required Population
reservationId ID true request.params?.[“reservationId”]
paymentUserParams Object true request.body?.[“paymentUserParams”]
reservationId : This id paremeter is used to select the required data object that will be updated
paymentUserParams : The user parameters that should be defined to start a stripe payment process. Must include paymentMethodId.

REST Request To access the api you can use the REST controller with the path PATCH /v1/startreservationpayment/:reservationId

  axios({
    method: 'PATCH',
    url: `/v1/startreservationpayment/${reservationId}`,
    data: {
            paymentUserParams:"Object",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "reservation",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"reservation": {
		"id": "ID",
		"listingId": "ID",
		"approvalType": "Enum",
		"approvalType_idx": "Integer",
		"bookingStatus": "Enum",
		"bookingStatus_idx": "Integer",
		"hostId": "ID",
		"checkOut": "Date",
		"guestId": "ID",
		"checkIn": "Date",
		"currency": "String",
		"guestCount": "Integer",
		"totalPrice": "Double",
		"iCalExportUrl": "String",
		"disputeStatus": "Enum",
		"disputeStatus_idx": "Integer",
		"bookingPoliciesSnapshot": "Object",
		"iCalImportSource": "String",
		"cancellationPolicySnapshot": "Object",
		"paymentConfirmation": "Enum",
		"paymentConfirmation_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	},
	"paymentResult": {
		"paymentTicketId": "ID",
		"orderId": "ID",
		"paymentId": "String",
		"paymentStatus": "Enum",
		"paymentIntentInfo": "Object",
		"statusLiteral": "String",
		"amount": "Double",
		"currency": "String",
		"success": true,
		"description": "String",
		"metadata": "Object",
		"paymentUserParams": "Object"
	}
}

Refresh Reservationpayment API

Refresh payment info for reservation from Stripe

Rest Route

The refreshReservationPayment API REST controller can be triggered via the following route:

/v1/refreshreservationpayment/:reservationId

Rest Request Parameters

The refreshReservationPayment api has got 2 regular request parameters

Parameter Type Required Population
reservationId ID true request.params?.[“reservationId”]
paymentUserParams Object false request.body?.[“paymentUserParams”]
reservationId : This id paremeter is used to select the required data object that will be updated
paymentUserParams : The user parameters that should be defined to refresh a stripe payment process

REST Request To access the api you can use the REST controller with the path PATCH /v1/refreshreservationpayment/:reservationId

  axios({
    method: 'PATCH',
    url: `/v1/refreshreservationpayment/${reservationId}`,
    data: {
            paymentUserParams:"Object",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "reservation",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"reservation": {
		"id": "ID",
		"listingId": "ID",
		"approvalType": "Enum",
		"approvalType_idx": "Integer",
		"bookingStatus": "Enum",
		"bookingStatus_idx": "Integer",
		"hostId": "ID",
		"checkOut": "Date",
		"guestId": "ID",
		"checkIn": "Date",
		"currency": "String",
		"guestCount": "Integer",
		"totalPrice": "Double",
		"iCalExportUrl": "String",
		"disputeStatus": "Enum",
		"disputeStatus_idx": "Integer",
		"bookingPoliciesSnapshot": "Object",
		"iCalImportSource": "String",
		"cancellationPolicySnapshot": "Object",
		"paymentConfirmation": "Enum",
		"paymentConfirmation_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	},
	"paymentResult": {
		"paymentTicketId": "ID",
		"orderId": "ID",
		"paymentId": "String",
		"paymentStatus": "Enum",
		"paymentIntentInfo": "Object",
		"statusLiteral": "String",
		"amount": "Double",
		"currency": "String",
		"success": true,
		"description": "String",
		"metadata": "Object",
		"paymentUserParams": "Object"
	}
}

Callback Reservationpayment API

Refresh payment values by gateway webhook call for reservation

Rest Route

The callbackReservationPayment API REST controller can be triggered via the following route:

/v1/callbackreservationpayment

Rest Request Parameters

The callbackReservationPayment api has got 1 regular request parameter

Parameter Type Required Population
reservationId ID false request.body?.[“reservationId”]
reservationId : The order id parameter that will be read from webhook callback params

REST Request To access the api you can use the REST controller with the path POST /v1/callbackreservationpayment

  axios({
    method: 'POST',
    url: '/v1/callbackreservationpayment',
    data: {
            reservationId:"ID",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "reservation",
	"method": "POST",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"reservation": {
		"id": "ID",
		"listingId": "ID",
		"approvalType": "Enum",
		"approvalType_idx": "Integer",
		"bookingStatus": "Enum",
		"bookingStatus_idx": "Integer",
		"hostId": "ID",
		"checkOut": "Date",
		"guestId": "ID",
		"checkIn": "Date",
		"currency": "String",
		"guestCount": "Integer",
		"totalPrice": "Double",
		"iCalExportUrl": "String",
		"disputeStatus": "Enum",
		"disputeStatus_idx": "Integer",
		"bookingPoliciesSnapshot": "Object",
		"iCalImportSource": "String",
		"cancellationPolicySnapshot": "Object",
		"paymentConfirmation": "Enum",
		"paymentConfirmation_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	},
	"paymentResult": {
		"paymentTicketId": "ID",
		"orderId": "ID",
		"paymentId": "String",
		"paymentStatus": "Enum",
		"paymentIntentInfo": "Object",
		"statusLiteral": "String",
		"amount": "Double",
		"currency": "String",
		"success": true,
		"description": "String",
		"metadata": "Object",
		"paymentUserParams": "Object"
	}
}

Get Paymentcustomerbyuserid API

This route is used to get the payment customer information by user id.

Rest Route

The getPaymentCustomerByUserId API REST controller can be triggered via the following route:

/v1/paymentcustomers/:userId

Rest Request Parameters

The getPaymentCustomerByUserId api has got 1 regular request parameter

Parameter Type Required Population
userId ID true request.params?.[“userId”]
userId : An ID value to represent the user who is created as a stripe customer. The parameter is used to query data.

REST Request To access the api you can use the REST controller with the path GET /v1/paymentcustomers/:userId

  axios({
    method: 'GET',
    url: `/v1/paymentcustomers/${userId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_paymentCustomer",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_paymentCustomer": {
		"id": "ID",
		"userId": "ID",
		"customerId": "String",
		"platform": "String",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Paymentcustomers API

This route is used to list all payment customers.

Rest Route

The listPaymentCustomers API REST controller can be triggered via the following route:

/v1/paymentcustomers

Rest Request Parameters

Filter Parameters

The listPaymentCustomers api supports 3 optional filter parameters for filtering list results:

userId (ID): An ID value to represent the user who is created as a stripe customer

customerId (String): A string value to represent the customer id which is generated on the Stripe gateway. This id is used to represent the customer in the Stripe gateway

platform (String): A String value to represent payment platform which is used to make the payment. It is stripe as default. It will be used to distinguesh the payment gateways in the future.

REST Request To access the api you can use the REST controller with the path GET /v1/paymentcustomers

  axios({
    method: 'GET',
    url: '/v1/paymentcustomers',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // userId: '<value>' // Filter by userId
        // customerId: '<value>' // Filter by customerId
        // platform: '<value>' // Filter by platform
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_paymentCustomers",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"sys_paymentCustomers": [
		{
			"id": "ID",
			"userId": "ID",
			"customerId": "String",
			"platform": "String",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

List Paymentcustomermethods API

This route is used to list all payment customer methods.

Rest Route

The listPaymentCustomerMethods API REST controller can be triggered via the following route:

/v1/paymentcustomermethods/:userId

Rest Request Parameters

The listPaymentCustomerMethods api has got 1 regular request parameter

Parameter Type Required Population
userId ID true request.params?.[“userId”]
userId : An ID value to represent the user who owns the payment method. The parameter is used to query data.

Filter Parameters

The listPaymentCustomerMethods api supports 6 optional filter parameters for filtering list results:

paymentMethodId (String): A string value to represent the id of the payment method on the payment platform.

customerId (String): A string value to represent the customer id which is generated on the payment gateway.

cardHolderName (String): A string value to represent the name of the card holder. It can be different than the registered customer.

cardHolderZip (String): A string value to represent the zip code of the card holder. It is used for address verification in specific countries.

platform (String): A String value to represent payment platform which teh paymentMethod belongs. It is stripe as default. It will be used to distinguesh the payment gateways in the future.

cardInfo (Object): A Json value to store the card details of the payment method.

REST Request To access the api you can use the REST controller with the path GET /v1/paymentcustomermethods/:userId

  axios({
    method: 'GET',
    url: `/v1/paymentcustomermethods/${userId}`,
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // paymentMethodId: '<value>' // Filter by paymentMethodId
        // customerId: '<value>' // Filter by customerId
        // cardHolderName: '<value>' // Filter by cardHolderName
        // cardHolderZip: '<value>' // Filter by cardHolderZip
        // platform: '<value>' // Filter by platform
        // cardInfo: '<value>' // Filter by cardInfo
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_paymentMethods",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"sys_paymentMethods": [
		{
			"id": "ID",
			"paymentMethodId": "String",
			"userId": "ID",
			"customerId": "String",
			"cardHolderName": "String",
			"cardHolderZip": "String",
			"platform": "String",
			"cardInfo": "Object",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Authentication Specific Routes

Common Routes

Route: currentuser

Route Definition: Retrieves the currently authenticated user’s session information.

Route Type: sessionInfo

Access Route: GET /currentuser

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /currentuser call
axios.get("/currentuser", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response Returns the session object, including user-related data and token information.

{
  "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9",
  "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
  "email": "user@example.com",
  "fullname": "John Doe",
  "roleId": "user",
  "tenantId": "abc123",
  "accessToken": "jwt-token-string",
  ...
}

Error Response 401 Unauthorized: No active session found.

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Route: permissions

*Route Definition*: Retrieves all effective permission records assigned to the currently authenticated user.

*Route Type*: permissionFetch

Access Route: GET /permissions

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /permissions call
axios.get("/permissions", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

Returns an array of permission objects.

[
  {
    "id": "perm1",
    "permissionName": "adminPanel.access",
    "roleId": "admin",
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  },
  {
    "id": "perm2",
    "permissionName": "orders.manage",
    "roleId": null,
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  }
]

Each object reflects a single permission grant, aligned with the givenPermissions model:

Error Responses

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Tip: Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations.

Route: permissions/:permissionName

Route Definition: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions.

Route Type: permissionScopeCheck

Access Route: GET /permissions/:permissionName

Parameters

Parameter Type Required Population
permissionName String Yes request.params.permissionName

Behavior

// Sample GET /permissions/orders.manage
axios.get("/permissions/orders.manage", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

{
  "canDo": true,
  "exceptions": [
    "a1f2e3d4-xxxx-yyyy-zzzz-object1",
    "b2c3d4e5-xxxx-yyyy-zzzz-object2"
  ]
}

Copyright

All sources, documents and other digital materials are copyright of .

About Us

For more information please visit our website: .

. .


REST API GUIDE

airbnb-reviewsystem-service

Version: 1.0.7

Handles double-blind, moderated reviews and rating aggregation for stays. Allows guests/hosts to review each other and listings, supports moderation, and exposes aggregate stats for listings/profiles…

Architectural Design Credit and Contact Information

The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to:

Email:

We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice.

Documentation Scope

Welcome to the official documentation for the ReviewSystem Service’s REST API. This document is designed to provide a comprehensive guide to interfacing with our ReviewSystem Service exclusively through RESTful API endpoints.

Intended Audience

This documentation is intended for developers and integrators who are looking to interact with the ReviewSystem Service via HTTP requests for purposes such as creating, updating, deleting and querying ReviewSystem objects.

Overview

Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases.

Beyond REST It’s important to note that the ReviewSystem Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation.

Authentication And Authorization

To ensure secure access to the ReviewSystem service’s protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it’s important to note that access control varies across different routes:

Protected API: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected.

**Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token.

Token Locations

When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters.

Location Token Name / Param Name
Query access_token
Authorization Header Bearer
Header airbnb3-access-token
Cookie airbnb3-access-token

Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies.

Api Definitions

This section outlines the API endpoints available within the ReviewSystem service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It’s important to understand the flexibility in how parameters can be included in requests to effectively interact with the ReviewSystem service.

This service is configured to listen for HTTP requests on port 3004, serving both the main API interface and default administrative endpoints.

The following routes are available by default:

This service is accessible via the following environment-specific URLs:

Parameter Inclusion Methods: Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests:

Query Parameters: Included directly in the URL’s query string.

Path Parameters: Embedded within the URL’s path.

Body Parameters: Sent within the JSON body of the request.

Session Parameters: Automatically read from the session object. This method is used for parameters that are intrinsic to the user’s session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request.

Note on Session Parameters: Session parameters represent a unique method of parameter inclusion, relying on the context of the user’s session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request.

By adhering to the specified parameter inclusion methods, you can effectively utilize the ReviewSystem service’s API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below.

Common Parameters

The ReviewSystem service’s business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL.

Supported Common Parameters:

By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the ReviewSystem service.

Error Response

If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity:

Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently.

{
  "result": "ERR",
  "status": 400,
  "message": "errMsg_organizationIdisNotAValidID",
  "errCode": 400,
  "date": "2024-03-19T12:13:54.124Z",
  "detail": "String"
}

Object Structure of a Successfull Response

When the ReviewSystem service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client.

Key Characteristics of the Response Envelope:

Design Considerations: The structure of a API’s response data is meticulously crafted during the service’s architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information.

Brief Data: Certain API’s return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect.

API Response Structure

The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response.

HTTP Status Codes:

Success Response Format:

For successful operations, the response includes a "status": "OK" property, signaling the successful execution of the request. The structure of a successful response is outlined below:

{
  "status":"OK",
  "statusCode": 200,   
  "elapsedMs":126,
  "ssoTime":120,
  "source": "db",
  "cacheKey": "hexCode",
  "userId": "ID",
  "sessionId": "ID",
  "requestId": "ID",
  "dataName":"products",
  "method":"GET",
  "action":"list",
  "appVersion":"Version",
  "rowCount":3
  "products":[{},{},{}],
  "paging": {
    "pageNumber":1, 
    "pageRowCount":25, 
    "totalRowCount":3,
    "pageCount":1
  },
  "filters": [],
  "uiPermissions": []
}

Handling Errors:

For details on handling error scenarios and understanding the structure of error responses, please refer to the “Error Response” section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages.

Resources

ReviewSystem service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service.

ReviewAggregate resource

Resource Definition : Cached aggregate rating stats for a listing, host, or guest. Used for fast lookup and display of averages, counts, etc. ReviewAggregate Resource Properties

Name Type Required Default Definition
revieweeId ID **
revieweeType Enum **
averageRating Double **
reviewCount Integer **
visibilityStatus Enum **

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

revieweeType Enum Property

Enum Options

Name Value Index
host "host"" 0
guest "guest"" 1
listing "listing"" 2
visibilityStatus Enum Property

Enum Options

Name Value Index
public "public"" 0
hidden "hidden"" 1

Review resource

Resource Definition : Review submitted by a guest or host after a completed stay. Enables double-blind, supports moderation, and links to reservation/listing and users. Review Resource Properties

Name Type Required Default Definition
moderationStatus Enum **
isPublished Boolean **
reviewText Text **
rating Integer **
blindSubmissionCode String **
revieweeId ID **
reservationId ID **
reviewerId ID **
revieweeType Enum **
submittedAt Date **

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

moderationStatus Enum Property

Enum Options

Name Value Index
pending "pending"" 0
approved "approved"" 1
rejected "rejected"" 2
revieweeType Enum Property

Enum Options

Name Value Index
host "host"" 0
guest "guest"" 1
listing "listing"" 2

Business Api

Get Review API

Retrieve a review and, if double-blind complete, return full info. Enrich with reviewer/reviewee & reservation if allowed by publish and moderation/business rules.

Rest Route

The getReview API REST controller can be triggered via the following route:

/v1/reviews/:reviewId

Rest Request Parameters

The getReview api has got 1 regular request parameter

Parameter Type Required Population
reviewId ID true request.params?.[“reviewId”]
reviewId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/reviews/:reviewId

  axios({
    method: 'GET',
    url: `/v1/reviews/${reviewId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "review",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"review": {
		"id": "ID",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"isPublished": "Boolean",
		"reviewText": "Text",
		"rating": "Integer",
		"blindSubmissionCode": "String",
		"revieweeId": "ID",
		"reservationId": "ID",
		"reviewerId": "ID",
		"revieweeType": "Enum",
		"revieweeType_idx": "Integer",
		"submittedAt": "Date",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Reviewaggregates API

List aggregate rating stats for listings or user profiles (cache-friendly, e.g., for search results or admin export).

Rest Route

The listReviewAggregates API REST controller can be triggered via the following route:

/v1/reviewaggregates

Rest Request Parameters

Filter Parameters

The listReviewAggregates api supports 2 optional filter parameters for filtering list results:

revieweeId (ID): Filter by revieweeId

revieweeType (Enum): Filter by revieweeType

REST Request To access the api you can use the REST controller with the path GET /v1/reviewaggregates

  axios({
    method: 'GET',
    url: '/v1/reviewaggregates',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // revieweeId: '<value>' // Filter by revieweeId
        // revieweeType: '<value>' // Filter by revieweeType
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "reviewAggregates",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"reviewAggregates": [
		{
			"id": "ID",
			"revieweeId": "ID",
			"revieweeType": "Enum",
			"revieweeType_idx": "Integer",
			"averageRating": "Double",
			"reviewCount": "Integer",
			"visibilityStatus": "Enum",
			"visibilityStatus_idx": "Integer",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Create Review API

Guest or host submits review for completed reservation. Double-blind: published after both reviews or expiry. Moderation applies. Only allowed if session.user is guest/host of reservation and not already reviewed.

Rest Route

The createReview API REST controller can be triggered via the following route:

/v1/reviews

Rest Request Parameters

The createReview api has got 7 regular request parameters

Parameter Type Required Population
moderationStatus Enum true request.body?.[“moderationStatus”]
isPublished Boolean true request.body?.[“isPublished”]
reviewText Text true request.body?.[“reviewText”]
rating Integer true request.body?.[“rating”]
revieweeId ID true request.body?.[“revieweeId”]
reservationId ID true request.body?.[“reservationId”]
revieweeType Enum true request.body?.[“revieweeType”]
moderationStatus :
isPublished :
reviewText :
rating :
revieweeId :
reservationId :
revieweeType :

REST Request To access the api you can use the REST controller with the path POST /v1/reviews

  axios({
    method: 'POST',
    url: '/v1/reviews',
    data: {
            moderationStatus:"Enum",  
            isPublished:"Boolean",  
            reviewText:"Text",  
            rating:"Integer",  
            revieweeId:"ID",  
            reservationId:"ID",  
            revieweeType:"Enum",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "review",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"review": {
		"id": "ID",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"isPublished": "Boolean",
		"reviewText": "Text",
		"rating": "Integer",
		"blindSubmissionCode": "String",
		"revieweeId": "ID",
		"reservationId": "ID",
		"reviewerId": "ID",
		"revieweeType": "Enum",
		"revieweeType_idx": "Integer",
		"submittedAt": "Date",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Delete Review API

Allows hard or soft-delete of review pre-publish (reviewer) or at any time (admin/moderator). Deletion triggers aggregate recalc.

Rest Route

The deleteReview API REST controller can be triggered via the following route:

/v1/reviews/:reviewId

Rest Request Parameters

The deleteReview api has got 1 regular request parameter

Parameter Type Required Population
reviewId ID true request.params?.[“reviewId”]
reviewId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/reviews/:reviewId

  axios({
    method: 'DELETE',
    url: `/v1/reviews/${reviewId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "review",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"review": {
		"id": "ID",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"isPublished": "Boolean",
		"reviewText": "Text",
		"rating": "Integer",
		"blindSubmissionCode": "String",
		"revieweeId": "ID",
		"reservationId": "ID",
		"reviewerId": "ID",
		"revieweeType": "Enum",
		"revieweeType_idx": "Integer",
		"submittedAt": "Date",
		"isActive": false,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Get Reviewaggregate API

Get aggregate rating stats for listing or user profile (fast lookup cache for UI display).

Rest Route

The getReviewAggregate API REST controller can be triggered via the following route:

/v1/reviewaggregates/:reviewAggregateId

Rest Request Parameters

The getReviewAggregate api has got 1 regular request parameter

Parameter Type Required Population
reviewAggregateId ID true request.params?.[“reviewAggregateId”]
reviewAggregateId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/reviewaggregates/:reviewAggregateId

  axios({
    method: 'GET',
    url: `/v1/reviewaggregates/${reviewAggregateId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "reviewAggregate",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"reviewAggregate": {
		"id": "ID",
		"revieweeId": "ID",
		"revieweeType": "Enum",
		"revieweeType_idx": "Integer",
		"averageRating": "Double",
		"reviewCount": "Integer",
		"visibilityStatus": "Enum",
		"visibilityStatus_idx": "Integer",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Reviews API

List published/approved reviews for listing, host, or guest profile. Double-blind: only list reviews when available (both submitted or timer expired & published). Optional filters: revieweeId, revieweeType, reservationId.

Rest Route

The listReviews API REST controller can be triggered via the following route:

/v1/reviews

Rest Request Parameters

Filter Parameters

The listReviews api supports 4 optional filter parameters for filtering list results:

revieweeId (ID): Filter by revieweeId

reservationId (ID): Filter by reservationId

reviewerId (ID): Filter by reviewerId

revieweeType (Enum): Filter by revieweeType

REST Request To access the api you can use the REST controller with the path GET /v1/reviews

  axios({
    method: 'GET',
    url: '/v1/reviews',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // revieweeId: '<value>' // Filter by revieweeId
        // reservationId: '<value>' // Filter by reservationId
        // reviewerId: '<value>' // Filter by reviewerId
        // revieweeType: '<value>' // Filter by revieweeType
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "reviews",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"reviews": [
		{
			"id": "ID",
			"moderationStatus": "Enum",
			"moderationStatus_idx": "Integer",
			"isPublished": "Boolean",
			"reviewText": "Text",
			"rating": "Integer",
			"blindSubmissionCode": "String",
			"revieweeId": "ID",
			"reservationId": "ID",
			"reviewerId": "ID",
			"revieweeType": "Enum",
			"revieweeType_idx": "Integer",
			"submittedAt": "Date",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Update Review API

Allows reviewer to edit own review before publish OR admin/mod to update moderation fields. Enforces state business rules.

Rest Route

The updateReview API REST controller can be triggered via the following route:

/v1/reviews/:reviewId

Rest Request Parameters

The updateReview api has got 4 regular request parameters

Parameter Type Required Population
reviewId ID true request.params?.[“reviewId”]
moderationStatus Enum false request.body?.[“moderationStatus”]
isPublished Boolean false request.body?.[“isPublished”]
reviewText Text false request.body?.[“reviewText”]
reviewId : This id paremeter is used to select the required data object that will be updated
moderationStatus :
isPublished :
reviewText :

REST Request To access the api you can use the REST controller with the path PATCH /v1/reviews/:reviewId

  axios({
    method: 'PATCH',
    url: `/v1/reviews/${reviewId}`,
    data: {
            moderationStatus:"Enum",  
            isPublished:"Boolean",  
            reviewText:"Text",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "review",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"review": {
		"id": "ID",
		"moderationStatus": "Enum",
		"moderationStatus_idx": "Integer",
		"isPublished": "Boolean",
		"reviewText": "Text",
		"rating": "Integer",
		"blindSubmissionCode": "String",
		"revieweeId": "ID",
		"reservationId": "ID",
		"reviewerId": "ID",
		"revieweeType": "Enum",
		"revieweeType_idx": "Integer",
		"submittedAt": "Date",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Authentication Specific Routes

Common Routes

Route: currentuser

Route Definition: Retrieves the currently authenticated user’s session information.

Route Type: sessionInfo

Access Route: GET /currentuser

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /currentuser call
axios.get("/currentuser", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response Returns the session object, including user-related data and token information.

{
  "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9",
  "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
  "email": "user@example.com",
  "fullname": "John Doe",
  "roleId": "user",
  "tenantId": "abc123",
  "accessToken": "jwt-token-string",
  ...
}

Error Response 401 Unauthorized: No active session found.

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Route: permissions

*Route Definition*: Retrieves all effective permission records assigned to the currently authenticated user.

*Route Type*: permissionFetch

Access Route: GET /permissions

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /permissions call
axios.get("/permissions", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

Returns an array of permission objects.

[
  {
    "id": "perm1",
    "permissionName": "adminPanel.access",
    "roleId": "admin",
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  },
  {
    "id": "perm2",
    "permissionName": "orders.manage",
    "roleId": null,
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  }
]

Each object reflects a single permission grant, aligned with the givenPermissions model:

Error Responses

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Tip: Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations.

Route: permissions/:permissionName

Route Definition: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions.

Route Type: permissionScopeCheck

Access Route: GET /permissions/:permissionName

Parameters

Parameter Type Required Population
permissionName String Yes request.params.permissionName

Behavior

// Sample GET /permissions/orders.manage
axios.get("/permissions/orders.manage", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

{
  "canDo": true,
  "exceptions": [
    "a1f2e3d4-xxxx-yyyy-zzzz-object1",
    "b2c3d4e5-xxxx-yyyy-zzzz-object2"
  ]
}

Copyright

All sources, documents and other digital materials are copyright of .

About Us

For more information please visit our website: .

. .


REST API GUIDE

airbnb-platformadmin-service

Version: 1.0.69

Administrative and compliance management backend for moderation, audit, dispute, financial oversight, localization, and GDPR in the Airbnb-style rental platform.

Architectural Design Credit and Contact Information

The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to:

Email:

We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice.

Documentation Scope

Welcome to the official documentation for the PlatformAdmin Service’s REST API. This document is designed to provide a comprehensive guide to interfacing with our PlatformAdmin Service exclusively through RESTful API endpoints.

Intended Audience

This documentation is intended for developers and integrators who are looking to interact with the PlatformAdmin Service via HTTP requests for purposes such as creating, updating, deleting and querying PlatformAdmin objects.

Overview

Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases.

Beyond REST It’s important to note that the PlatformAdmin Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation.

Authentication And Authorization

To ensure secure access to the PlatformAdmin service’s protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it’s important to note that access control varies across different routes:

Protected API: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected.

**Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token.

Token Locations

When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters.

Location Token Name / Param Name
Query access_token
Authorization Header Bearer
Header airbnb3-access-token
Cookie airbnb3-access-token

Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies.

Api Definitions

This section outlines the API endpoints available within the PlatformAdmin service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It’s important to understand the flexibility in how parameters can be included in requests to effectively interact with the PlatformAdmin service.

This service is configured to listen for HTTP requests on port 3003, serving both the main API interface and default administrative endpoints.

The following routes are available by default:

This service is accessible via the following environment-specific URLs:

Parameter Inclusion Methods: Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests:

Query Parameters: Included directly in the URL’s query string.

Path Parameters: Embedded within the URL’s path.

Body Parameters: Sent within the JSON body of the request.

Session Parameters: Automatically read from the session object. This method is used for parameters that are intrinsic to the user’s session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request.

Note on Session Parameters: Session parameters represent a unique method of parameter inclusion, relying on the context of the user’s session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request.

By adhering to the specified parameter inclusion methods, you can effectively utilize the PlatformAdmin service’s API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below.

Common Parameters

The PlatformAdmin service’s business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL.

Supported Common Parameters:

By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the PlatformAdmin service.

Error Response

If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity:

Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently.

{
  "result": "ERR",
  "status": 400,
  "message": "errMsg_organizationIdisNotAValidID",
  "errCode": 400,
  "date": "2024-03-19T12:13:54.124Z",
  "detail": "String"
}

Object Structure of a Successfull Response

When the PlatformAdmin service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client.

Key Characteristics of the Response Envelope:

Design Considerations: The structure of a API’s response data is meticulously crafted during the service’s architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information.

Brief Data: Certain API’s return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect.

API Response Structure

The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response.

HTTP Status Codes:

Success Response Format:

For successful operations, the response includes a "status": "OK" property, signaling the successful execution of the request. The structure of a successful response is outlined below:

{
  "status":"OK",
  "statusCode": 200,   
  "elapsedMs":126,
  "ssoTime":120,
  "source": "db",
  "cacheKey": "hexCode",
  "userId": "ID",
  "sessionId": "ID",
  "requestId": "ID",
  "dataName":"products",
  "method":"GET",
  "action":"list",
  "appVersion":"Version",
  "rowCount":3
  "products":[{},{},{}],
  "paging": {
    "pageNumber":1, 
    "pageRowCount":25, 
    "totalRowCount":3,
    "pageCount":1
  },
  "filters": [],
  "uiPermissions": []
}

Handling Errors:

For details on handling error scenarios and understanding the structure of error responses, please refer to the “Error Response” section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages.

Resources

PlatformAdmin service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service.

LocalizationSetting resource

Resource Definition : Admin-configured valid languages/currencies for site usage and preference. LocalizationSetting Resource Properties

Name Type Required Default Definition
languageCode String **
effectiveFrom Date **
effectiveTo Date **
currencyCode String **
isCurrencyActive Boolean **

AdminDisputeAction resource

Resource Definition : Record of an admin's moderation/decision action on a dispute. AdminDisputeAction Resource Properties

Name Type Required Default Definition
disputeId ID **
actionTaken String **
notes Text **
adminId ID **
outcome String **
actionDate Date **

ApiKey resource

Resource Definition : Admin-generated API key for internal/external integration—has revocation, audit trail. ApiKey Resource Properties

Name Type Required Default Definition
key String **
active Boolean **
description String **
revokedAt Date **
createdBy ID **

FinancialReport resource

Resource Definition : System-generated or admin-generated report snapshots of platform financials for a given period (GDPR/tax). FinancialReport Resource Properties

Name Type Required Default Definition
period String **
cityTaxByLocation Object **
totalPayouts Double **
createdBy ID **
totalRefunds Double **
currency String **
generatedAt Date **
totalRevenue Double **

AuditLog resource

Resource Definition : Immutable audit log for recording sensitive admin actions and platform changes. AuditLog Resource Properties

Name Type Required Default Definition
performedBy ID **
objectId ID **
details Object **
ipAddress String **
actionObject String **
occurredAt Date **
actionType String **

GdprAction resource

Resource Definition : Record of individual user GDPR/consent/export/delete request flow. Used for logs, compliance, and controls. GdprAction Resource Properties

Name Type Required Default Definition
requestedAt Date **
status Enum **
actionType String **
userId ID **
processedAt Date **

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

status Enum Property

Enum Options

Name Value Index
pending "pending"" 0
complete "complete"" 1
failed "failed"" 2

Business Api

Get Auditlog API

Fetch audit log entry by ID (admin only).

Rest Route

The getAuditLog API REST controller can be triggered via the following route:

/v1/auditlogs/:auditLogId

Rest Request Parameters

The getAuditLog api has got 1 regular request parameter

Parameter Type Required Population
auditLogId ID true request.params?.[“auditLogId”]
auditLogId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/auditlogs/:auditLogId

  axios({
    method: 'GET',
    url: `/v1/auditlogs/${auditLogId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "auditLog",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"auditLog": {
		"id": "ID",
		"performedBy": "ID",
		"objectId": "ID",
		"details": "Object",
		"ipAddress": "String",
		"actionObject": "String",
		"occurredAt": "Date",
		"actionType": "String",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": true
	}
}

Get Financialreport API

Retrieve financial/tax report snapshot by ID (admin only).

Rest Route

The getFinancialReport API REST controller can be triggered via the following route:

/v1/financialreports/:financialReportId

Rest Request Parameters

The getFinancialReport api has got 1 regular request parameter

Parameter Type Required Population
financialReportId ID true request.params?.[“financialReportId”]
financialReportId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/financialreports/:financialReportId

  axios({
    method: 'GET',
    url: `/v1/financialreports/${financialReportId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "financialReport",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"financialReport": {
		"id": "ID",
		"period": "String",
		"cityTaxByLocation": "Object",
		"totalPayouts": "Double",
		"createdBy": "ID",
		"totalRefunds": "Double",
		"currency": "String",
		"generatedAt": "Date",
		"totalRevenue": "Double",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": true
	}
}

Create Financialreport API

Snapshot financial and tax data for a period. Immutable after creation.

Rest Route

The createFinancialReport API REST controller can be triggered via the following route:

/v1/financialreports

Rest Request Parameters

The createFinancialReport api has got 7 regular request parameters

Parameter Type Required Population
period String true request.body?.[“period”]
cityTaxByLocation Object false request.body?.[“cityTaxByLocation”]
totalPayouts Double true request.body?.[“totalPayouts”]
createdBy ID true request.body?.[“createdBy”]
totalRefunds Double true request.body?.[“totalRefunds”]
currency String true request.body?.[“currency”]
totalRevenue Double true request.body?.[“totalRevenue”]
period :
cityTaxByLocation :
totalPayouts :
createdBy :
totalRefunds :
currency :
totalRevenue :

REST Request To access the api you can use the REST controller with the path POST /v1/financialreports

  axios({
    method: 'POST',
    url: '/v1/financialreports',
    data: {
            period:"String",  
            cityTaxByLocation:"Object",  
            totalPayouts:"Double",  
            createdBy:"ID",  
            totalRefunds:"Double",  
            currency:"String",  
            totalRevenue:"Double",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "financialReport",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"financialReport": {
		"id": "ID",
		"period": "String",
		"cityTaxByLocation": "Object",
		"totalPayouts": "Double",
		"createdBy": "ID",
		"totalRefunds": "Double",
		"currency": "String",
		"generatedAt": "Date",
		"totalRevenue": "Double",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": true
	}
}

List Auditlogs API

List audit log entries (admin only). Filterable by type, performer, object, date.

Rest Route

The listAuditLogs API REST controller can be triggered via the following route:

/v1/auditlogs

Rest Request Parameters

Filter Parameters

The listAuditLogs api supports 5 optional filter parameters for filtering list results:

performedBy (ID): Filter by performedBy

objectId (ID): Filter by objectId

actionObject (String): Filter by actionObject

occurredAt (Date): Filter by occurredAt

actionType (String): Filter by actionType

REST Request To access the api you can use the REST controller with the path GET /v1/auditlogs

  axios({
    method: 'GET',
    url: '/v1/auditlogs',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // performedBy: '<value>' // Filter by performedBy
        // objectId: '<value>' // Filter by objectId
        // actionObject: '<value>' // Filter by actionObject
        // occurredAt: '<value>' // Filter by occurredAt
        // actionType: '<value>' // Filter by actionType
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "auditLogs",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"auditLogs": [
		{
			"id": "ID",
			"performedBy": "ID",
			"objectId": "ID",
			"details": "Object",
			"ipAddress": "String",
			"actionObject": "String",
			"occurredAt": "Date",
			"actionType": "String",
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

List Financialreports API

List period financial/tax reports for admin/AUDIT purposes.

Rest Route

The listFinancialReports API REST controller can be triggered via the following route:

/v1/financialreports

Rest Request Parameters

Filter Parameters

The listFinancialReports api supports 1 optional filter parameter for filtering list results:

period (String): Filter by period

REST Request To access the api you can use the REST controller with the path GET /v1/financialreports

  axios({
    method: 'GET',
    url: '/v1/financialreports',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // period: '<value>' // Filter by period
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "financialReports",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"financialReports": [
		{
			"id": "ID",
			"period": "String",
			"cityTaxByLocation": "Object",
			"totalPayouts": "Double",
			"createdBy": "ID",
			"totalRefunds": "Double",
			"currency": "String",
			"generatedAt": "Date",
			"totalRevenue": "Double",
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Create Auditlog API

Record an admin/platform action/event in the audit log. Called from side-effect flows, not direct user.

Rest Route

The createAuditLog API REST controller can be triggered via the following route:

/v1/auditlogs

Rest Request Parameters

The createAuditLog api has got 6 regular request parameters

Parameter Type Required Population
performedBy ID true request.body?.[“performedBy”]
objectId ID false request.body?.[“objectId”]
details Object false request.body?.[“details”]
ipAddress String false request.body?.[“ipAddress”]
actionObject String true request.body?.[“actionObject”]
actionType String true request.body?.[“actionType”]
performedBy :
objectId :
details :
ipAddress :
actionObject :
actionType :

REST Request To access the api you can use the REST controller with the path POST /v1/auditlogs

  axios({
    method: 'POST',
    url: '/v1/auditlogs',
    data: {
            performedBy:"ID",  
            objectId:"ID",  
            details:"Object",  
            ipAddress:"String",  
            actionObject:"String",  
            actionType:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "auditLog",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"auditLog": {
		"id": "ID",
		"performedBy": "ID",
		"objectId": "ID",
		"details": "Object",
		"ipAddress": "String",
		"actionObject": "String",
		"occurredAt": "Date",
		"actionType": "String",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": true
	}
}

Create Localizationsetting API

Add a supported language/currency for global usage.

Rest Route

The createLocalizationSetting API REST controller can be triggered via the following route:

/v1/localizationsettings

Rest Request Parameters

The createLocalizationSetting api has got 5 regular request parameters

Parameter Type Required Population
languageCode String true request.body?.[“languageCode”]
effectiveFrom Date false request.body?.[“effectiveFrom”]
effectiveTo Date false request.body?.[“effectiveTo”]
currencyCode String true request.body?.[“currencyCode”]
isCurrencyActive Boolean true request.body?.[“isCurrencyActive”]
languageCode :
effectiveFrom :
effectiveTo :
currencyCode :
isCurrencyActive :

REST Request To access the api you can use the REST controller with the path POST /v1/localizationsettings

  axios({
    method: 'POST',
    url: '/v1/localizationsettings',
    data: {
            languageCode:"String",  
            effectiveFrom:"Date",  
            effectiveTo:"Date",  
            currencyCode:"String",  
            isCurrencyActive:"Boolean",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "localizationSetting",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"localizationSetting": {
		"id": "ID",
		"languageCode": "String",
		"effectiveFrom": "Date",
		"effectiveTo": "Date",
		"currencyCode": "String",
		"isCurrencyActive": "Boolean",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Admindisputeactions API

List all moderation/decision records by admins for disputes. Filter by disputeId/adminId.

Rest Route

The listAdminDisputeActions API REST controller can be triggered via the following route:

/v1/admindisputeactions

Rest Request Parameters

Filter Parameters

The listAdminDisputeActions api supports 2 optional filter parameters for filtering list results:

disputeId (ID): Filter by disputeId

adminId (ID): Filter by adminId

REST Request To access the api you can use the REST controller with the path GET /v1/admindisputeactions

  axios({
    method: 'GET',
    url: '/v1/admindisputeactions',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // disputeId: '<value>' // Filter by disputeId
        // adminId: '<value>' // Filter by adminId
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "adminDisputeActions",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"adminDisputeActions": [
		{
			"id": "ID",
			"disputeId": "ID",
			"actionTaken": "String",
			"notes": "Text",
			"adminId": "ID",
			"outcome": "String",
			"actionDate": "Date",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Create Admindisputeaction API

Admin records moderation/decision action on a dispute (creates audit log as side effect).

Rest Route

The createAdminDisputeAction API REST controller can be triggered via the following route:

/v1/admindisputeactions

Rest Request Parameters

The createAdminDisputeAction api has got 5 regular request parameters

Parameter Type Required Population
disputeId ID true request.body?.[“disputeId”]
actionTaken String true request.body?.[“actionTaken”]
notes Text false request.body?.[“notes”]
adminId ID true request.body?.[“adminId”]
outcome String false request.body?.[“outcome”]
disputeId :
actionTaken :
notes :
adminId :
outcome :

REST Request To access the api you can use the REST controller with the path POST /v1/admindisputeactions

  axios({
    method: 'POST',
    url: '/v1/admindisputeactions',
    data: {
            disputeId:"ID",  
            actionTaken:"String",  
            notes:"Text",  
            adminId:"ID",  
            outcome:"String",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "adminDisputeAction",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"adminDisputeAction": {
		"id": "ID",
		"disputeId": "ID",
		"actionTaken": "String",
		"notes": "Text",
		"adminId": "ID",
		"outcome": "String",
		"actionDate": "Date",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Localizationsetting API

Update a localization setting. Admin only.

Rest Route

The updateLocalizationSetting API REST controller can be triggered via the following route:

/v1/localizationsettings/:localizationSettingId

Rest Request Parameters

The updateLocalizationSetting api has got 6 regular request parameters

Parameter Type Required Population
localizationSettingId ID true request.params?.[“localizationSettingId”]
languageCode String false request.body?.[“languageCode”]
effectiveFrom Date false request.body?.[“effectiveFrom”]
effectiveTo Date false request.body?.[“effectiveTo”]
currencyCode String false request.body?.[“currencyCode”]
isCurrencyActive Boolean false request.body?.[“isCurrencyActive”]
localizationSettingId : This id paremeter is used to select the required data object that will be updated
languageCode :
effectiveFrom :
effectiveTo :
currencyCode :
isCurrencyActive :

REST Request To access the api you can use the REST controller with the path PATCH /v1/localizationsettings/:localizationSettingId

  axios({
    method: 'PATCH',
    url: `/v1/localizationsettings/${localizationSettingId}`,
    data: {
            languageCode:"String",  
            effectiveFrom:"Date",  
            effectiveTo:"Date",  
            currencyCode:"String",  
            isCurrencyActive:"Boolean",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "localizationSetting",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"localizationSetting": {
		"id": "ID",
		"languageCode": "String",
		"effectiveFrom": "Date",
		"effectiveTo": "Date",
		"currencyCode": "String",
		"isCurrencyActive": "Boolean",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

Update Gdpraction API

Compliance admin records status of a GDPR request (pending/complete/failed). No delete allowed for compliance records.

Rest Route

The updateGdprAction API REST controller can be triggered via the following route:

/v1/gdpractions/:gdprActionId

Rest Request Parameters

The updateGdprAction api has got 3 regular request parameters

Parameter Type Required Population
gdprActionId ID true request.params?.[“gdprActionId”]
status Enum false request.body?.[“status”]
processedAt Date false request.body?.[“processedAt”]
gdprActionId : This id paremeter is used to select the required data object that will be updated
status :
processedAt :

REST Request To access the api you can use the REST controller with the path PATCH /v1/gdpractions/:gdprActionId

  axios({
    method: 'PATCH',
    url: `/v1/gdpractions/${gdprActionId}`,
    data: {
            status:"Enum",  
            processedAt:"Date",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "gdprAction",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"gdprAction": {
		"id": "ID",
		"requestedAt": "Date",
		"status": "Enum",
		"status_idx": "Integer",
		"actionType": "String",
		"userId": "ID",
		"processedAt": "Date",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": true
	}
}

List Gdpractions API

List all GDPR/compliance records with status for audit/compliance purposes.

Rest Route

The listGdprActions API REST controller can be triggered via the following route:

/v1/gdpractions

Rest Request Parameters The listGdprActions api has got no request parameters.

REST Request To access the api you can use the REST controller with the path GET /v1/gdpractions

  axios({
    method: 'GET',
    url: '/v1/gdpractions',
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "gdprActions",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"gdprActions": [
		{
			"id": "ID",
			"requestedAt": "Date",
			"status": "Enum",
			"status_idx": "Integer",
			"actionType": "String",
			"userId": "ID",
			"processedAt": "Date",
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Create Apikey API

Create/administer an API key (for integrations, partners, automation). Key is hashed at rest.

Rest Route

The createApiKey API REST controller can be triggered via the following route:

/v1/apikeys

Rest Request Parameters

The createApiKey api has got 5 regular request parameters

Parameter Type Required Population
key String true request.body?.[“key”]
active Boolean true request.body?.[“active”]
description String false request.body?.[“description”]
revokedAt Date false request.body?.[“revokedAt”]
createdBy ID true request.body?.[“createdBy”]
key :
active :
description :
revokedAt :
createdBy :

REST Request To access the api you can use the REST controller with the path POST /v1/apikeys

  axios({
    method: 'POST',
    url: '/v1/apikeys',
    data: {
            key:"String",  
            active:"Boolean",  
            description:"String",  
            revokedAt:"Date",  
            createdBy:"ID",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "apiKey",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"apiKey": {
		"id": "ID",
		"key": "String",
		"active": "Boolean",
		"description": "String",
		"revokedAt": "Date",
		"createdBy": "ID",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Apikeys API

Show all API keys with status (hash only, never show the sensitive key string itself).

Rest Route

The listApiKeys API REST controller can be triggered via the following route:

/v1/apikeys

Rest Request Parameters The listApiKeys api has got no request parameters.

REST Request To access the api you can use the REST controller with the path GET /v1/apikeys

  axios({
    method: 'GET',
    url: '/v1/apikeys',
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "apiKeys",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"apiKeys": [
		{
			"id": "ID",
			"key": "String",
			"active": "Boolean",
			"description": "String",
			"revokedAt": "Date",
			"createdBy": "ID",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Update Apikey API

Update API key metadata or deactivate (e.g. revoke). Only admin allowed.

Rest Route

The updateApiKey API REST controller can be triggered via the following route:

/v1/apikeys/:apiKeyId

Rest Request Parameters

The updateApiKey api has got 4 regular request parameters

Parameter Type Required Population
apiKeyId ID true request.params?.[“apiKeyId”]
active Boolean false request.body?.[“active”]
description String false request.body?.[“description”]
revokedAt Date false request.body?.[“revokedAt”]
apiKeyId : This id paremeter is used to select the required data object that will be updated
active :
description :
revokedAt :

REST Request To access the api you can use the REST controller with the path PATCH /v1/apikeys/:apiKeyId

  axios({
    method: 'PATCH',
    url: `/v1/apikeys/${apiKeyId}`,
    data: {
            active:"Boolean",  
            description:"String",  
            revokedAt:"Date",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "apiKey",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"apiKey": {
		"id": "ID",
		"key": "String",
		"active": "Boolean",
		"description": "String",
		"revokedAt": "Date",
		"createdBy": "ID",
		"isActive": true,
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID"
	}
}

List Localizationsettings API

Show all currently configured languages/currencies.

Rest Route

The listLocalizationSettings API REST controller can be triggered via the following route:

/v1/localizationsettings

Rest Request Parameters

Filter Parameters

The listLocalizationSettings api supports 3 optional filter parameters for filtering list results:

languageCode (String): Filter by languageCode

currencyCode (String): Filter by currencyCode

isCurrencyActive (Boolean): Filter by isCurrencyActive

REST Request To access the api you can use the REST controller with the path GET /v1/localizationsettings

  axios({
    method: 'GET',
    url: '/v1/localizationsettings',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // languageCode: '<value>' // Filter by languageCode
        // currencyCode: '<value>' // Filter by currencyCode
        // isCurrencyActive: '<value>' // Filter by isCurrencyActive
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "localizationSettings",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"localizationSettings": [
		{
			"id": "ID",
			"languageCode": "String",
			"effectiveFrom": "Date",
			"effectiveTo": "Date",
			"currencyCode": "String",
			"isCurrencyActive": "Boolean",
			"isActive": true,
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID"
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Create Gdpraction API

User/admin submits GDPR request (export/delete/consent). Logged for compliance; status may be updated by compliance admin only.

Rest Route

The createGdprAction API REST controller can be triggered via the following route:

/v1/gdpractions

Rest Request Parameters

The createGdprAction api has got 3 regular request parameters

Parameter Type Required Population
actionType String true request.body?.[“actionType”]
userId ID true request.body?.[“userId”]
processedAt Date false request.body?.[“processedAt”]
actionType :
userId :
processedAt :

REST Request To access the api you can use the REST controller with the path POST /v1/gdpractions

  axios({
    method: 'POST',
    url: '/v1/gdpractions',
    data: {
            actionType:"String",  
            userId:"ID",  
            processedAt:"Date",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "gdprAction",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"gdprAction": {
		"id": "ID",
		"requestedAt": "Date",
		"status": "Enum",
		"status_idx": "Integer",
		"actionType": "String",
		"userId": "ID",
		"processedAt": "Date",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": true
	}
}

Authentication Specific Routes

Common Routes

Route: currentuser

Route Definition: Retrieves the currently authenticated user’s session information.

Route Type: sessionInfo

Access Route: GET /currentuser

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /currentuser call
axios.get("/currentuser", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response Returns the session object, including user-related data and token information.

{
  "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9",
  "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
  "email": "user@example.com",
  "fullname": "John Doe",
  "roleId": "user",
  "tenantId": "abc123",
  "accessToken": "jwt-token-string",
  ...
}

Error Response 401 Unauthorized: No active session found.

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Route: permissions

*Route Definition*: Retrieves all effective permission records assigned to the currently authenticated user.

*Route Type*: permissionFetch

Access Route: GET /permissions

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /permissions call
axios.get("/permissions", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

Returns an array of permission objects.

[
  {
    "id": "perm1",
    "permissionName": "adminPanel.access",
    "roleId": "admin",
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  },
  {
    "id": "perm2",
    "permissionName": "orders.manage",
    "roleId": null,
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  }
]

Each object reflects a single permission grant, aligned with the givenPermissions model:

Error Responses

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Tip: Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations.

Route: permissions/:permissionName

Route Definition: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions.

Route Type: permissionScopeCheck

Access Route: GET /permissions/:permissionName

Parameters

Parameter Type Required Population
permissionName String Yes request.params.permissionName

Behavior

// Sample GET /permissions/orders.manage
axios.get("/permissions/orders.manage", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

{
  "canDo": true,
  "exceptions": [
    "a1f2e3d4-xxxx-yyyy-zzzz-object1",
    "b2c3d4e5-xxxx-yyyy-zzzz-object2"
  ]
}

Copyright

All sources, documents and other digital materials are copyright of .

About Us

For more information please visit our website: .

. .


REST API GUIDE

airbnb-agenthub-service

Version: 1.0.0

AI Agent Hub

Architectural Design Credit and Contact Information

The architectural design of this microservice is credited to . For inquiries, feedback, or further information regarding the architecture, please direct your communication to:

Email:

We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice.

Documentation Scope

Welcome to the official documentation for the AgentHub Service’s REST API. This document is designed to provide a comprehensive guide to interfacing with our AgentHub Service exclusively through RESTful API endpoints.

Intended Audience

This documentation is intended for developers and integrators who are looking to interact with the AgentHub Service via HTTP requests for purposes such as creating, updating, deleting and querying AgentHub objects.

Overview

Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases.

Beyond REST It’s important to note that the AgentHub Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation.

Authentication And Authorization

To ensure secure access to the AgentHub service’s protected endpoints, a project-wide access token is required. This token serves as the primary method for authenticating requests to our service. However, it’s important to note that access control varies across different routes:

Protected API: Certain API (routes) require specific authorization levels. Access to these routes is contingent upon the possession of a valid access token that meets the route-specific authorization criteria. Unauthorized requests to these routes will be rejected.

**Public API **: The service also includes public API (routes) that are accessible without authentication. These public endpoints are designed for open access and do not require an access token.

Token Locations

When including your access token in a request, ensure it is placed in one of the following specified locations. The service will sequentially search these locations for the token, utilizing the first one it encounters.

Location Token Name / Param Name
Query access_token
Authorization Header Bearer
Header airbnb3-access-token
Cookie airbnb3-access-token

Please ensure the token is correctly placed in one of these locations, using the appropriate label as indicated. The service prioritizes these locations in the order listed, processing the first token it successfully identifies.

Api Definitions

This section outlines the API endpoints available within the AgentHub service. Each endpoint can receive parameters through various methods, meticulously described in the following definitions. It’s important to understand the flexibility in how parameters can be included in requests to effectively interact with the AgentHub service.

This service is configured to listen for HTTP requests on port 3006, serving both the main API interface and default administrative endpoints.

The following routes are available by default:

This service is accessible via the following environment-specific URLs:

Parameter Inclusion Methods: Parameters can be incorporated into API requests in several ways, each with its designated location. Understanding these methods is crucial for correctly constructing your requests:

Query Parameters: Included directly in the URL’s query string.

Path Parameters: Embedded within the URL’s path.

Body Parameters: Sent within the JSON body of the request.

Session Parameters: Automatically read from the session object. This method is used for parameters that are intrinsic to the user’s session, such as userId. When using an API that involves session parameters, you can omit these from your request. The service will automatically bind them to the API layer, provided that a session is associated with your request.

Note on Session Parameters: Session parameters represent a unique method of parameter inclusion, relying on the context of the user’s session. A common example of a session parameter is userId, which the service automatically associates with your request when a session exists. This feature ensures seamless integration of user-specific data without manual input for each request.

By adhering to the specified parameter inclusion methods, you can effectively utilize the AgentHub service’s API endpoints. For detailed information on each endpoint, including required parameters and their accepted locations, refer to the individual API definitions below.

Common Parameters

The AgentHub service’s business API support several common parameters designed to modify and enhance the behavior of API requests. These parameters are not individually listed in the API route definitions to avoid repetition. Instead, refer to this section to understand how to leverage these common behaviors across different routes. Note that all common parameters should be included in the query part of the URL.

Supported Common Parameters:

By utilizing these common parameters, you can tailor the behavior of API requests to suit your specific requirements, ensuring optimal performance and usability of the AgentHub service.

Error Response

If a request encounters an issue, whether due to a logical fault or a technical problem, the service responds with a standardized JSON error structure. The HTTP status code within this response indicates the nature of the error, utilizing commonly recognized codes for clarity:

Each error response is structured to provide meaningful insight into the problem, assisting in diagnosing and resolving issues efficiently.

{
  "result": "ERR",
  "status": 400,
  "message": "errMsg_organizationIdisNotAValidID",
  "errCode": 400,
  "date": "2024-03-19T12:13:54.124Z",
  "detail": "String"
}

Object Structure of a Successfull Response

When the AgentHub service processes requests successfully, it wraps the requested resource(s) within a JSON envelope. This envelope not only contains the data but also includes essential metadata, such as configuration details and pagination information, to enrich the response and provide context to the client.

Key Characteristics of the Response Envelope:

Design Considerations: The structure of a API’s response data is meticulously crafted during the service’s architectural planning. This design ensures that responses adequately reflect the intended data relationships and service logic, providing clients with rich and meaningful information.

Brief Data: Certain API’s return a condensed version of the object data, intentionally selecting only specific fields deemed useful for that request. In such instances, the API documentation will detail the properties included in the response, guiding developers on what to expect.

API Response Structure

The API utilizes a standardized JSON envelope to encapsulate responses. This envelope is designed to consistently deliver both the requested data and essential metadata, ensuring that clients can efficiently interpret and utilize the response.

HTTP Status Codes:

Success Response Format:

For successful operations, the response includes a "status": "OK" property, signaling the successful execution of the request. The structure of a successful response is outlined below:

{
  "status":"OK",
  "statusCode": 200,   
  "elapsedMs":126,
  "ssoTime":120,
  "source": "db",
  "cacheKey": "hexCode",
  "userId": "ID",
  "sessionId": "ID",
  "requestId": "ID",
  "dataName":"products",
  "method":"GET",
  "action":"list",
  "appVersion":"Version",
  "rowCount":3
  "products":[{},{},{}],
  "paging": {
    "pageNumber":1, 
    "pageRowCount":25, 
    "totalRowCount":3,
    "pageCount":1
  },
  "filters": [],
  "uiPermissions": []
}

Handling Errors:

For details on handling error scenarios and understanding the structure of error responses, please refer to the “Error Response” section provided earlier in this documentation. It outlines how error conditions are communicated, including the use of HTTP status codes and standardized JSON structures for error messages.

Resources

AgentHub service provides the following resources which are stored in its own database as a data object. Note that a resource for an api access is a data object for the service.

Sys_agentOverride resource

Resource Definition : Runtime overrides for design-time agents. Null fields use the design default. Sys_agentOverride Resource Properties

Name Type Required Default Definition
agentName String Design-time agent name this override applies to.
provider String Override AI provider (e.g., openai, anthropic).
model String Override model name.
systemPrompt Text Override system prompt.
temperature Double Override temperature (0-2).
maxTokens Integer Override max tokens.
responseFormat String Override response format (text/json).
selectedTools Object Array of tool names from the catalog that this agent can use.
guardrails Object Override guardrails: { maxToolCalls, timeout, maxTokenBudget }.
enabled Boolean Enable or disable this agent.
updatedBy ID User who last updated this override.

Sys_agentExecution resource

Resource Definition : Agent execution log. Records each agent invocation with input, output, and performance metrics. Sys_agentExecution Resource Properties

Name Type Required Default Definition
agentName String Agent that was executed.
agentType Enum Whether this was a design-time or dynamic agent.
source Enum How the agent was triggered.
userId ID User who triggered the execution.
input Object Request input (truncated for large payloads).
output Object Response output (truncated for large payloads).
toolCalls Integer Number of tool calls made during execution.
tokenUsage Object Token usage: { prompt, completion, total }.
durationMs Integer Execution time in milliseconds.
status Enum Execution status.
error Text Error message if execution failed.

Enum Properties

Enum properties are represented as strings in the database. The values are mapped to their corresponding names in the application layer.

agentType Enum Property

Property Definition : Whether this was a design-time or dynamic agent.Enum Options

Name Value Index
design "design"" 0
dynamic "dynamic"" 1
source Enum Property

Property Definition : How the agent was triggered.Enum Options

Name Value Index
rest "rest"" 0
sse "sse"" 1
kafka "kafka"" 2
agent "agent"" 3
status Enum Property

Property Definition : Execution status.Enum Options

Name Value Index
success "success"" 0
error "error"" 1
timeout "timeout"" 2

Sys_toolCatalog resource

Resource Definition : Cached tool catalog discovered from project services. Refreshed periodically. Sys_toolCatalog Resource Properties

Name Type Required Default Definition
toolName String Full tool name (e.g., service:apiName).
serviceName String Source service name.
description Text Tool description.
parameters Object JSON Schema of tool parameters.
lastRefreshed Date When this tool was last discovered/refreshed.

Business Api

Get Agentoverride API

[Default get API] — This is the designated default get API for the sys_agentOverride data object. Frontend generators and AI agents should use this API for standard CRUD operations.

Rest Route

The getAgentOverride API REST controller can be triggered via the following route:

/v1/agentoverride/:sys_agentOverrideId

Rest Request Parameters

The getAgentOverride api has got 1 regular request parameter

Parameter Type Required Population
sys_agentOverrideId ID true request.params?.[“sys_agentOverrideId”]
sys_agentOverrideId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/agentoverride/:sys_agentOverrideId

  axios({
    method: 'GET',
    url: `/v1/agentoverride/${sys_agentOverrideId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_agentOverride",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_agentOverride": {
		"id": "ID",
		"agentName": "String",
		"provider": "String",
		"model": "String",
		"systemPrompt": "Text",
		"temperature": "Double",
		"maxTokens": "Integer",
		"responseFormat": "String",
		"selectedTools": "Object",
		"guardrails": "Object",
		"enabled": "Boolean",
		"updatedBy": "ID",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": true
	}
}

List Agentoverrides API

[Default list API] — This is the designated default list API for the sys_agentOverride data object. Frontend generators and AI agents should use this API for standard CRUD operations.

Rest Route

The listAgentOverrides API REST controller can be triggered via the following route:

/v1/agentoverrides

Rest Request Parameters The listAgentOverrides api has got no request parameters.

REST Request To access the api you can use the REST controller with the path GET /v1/agentoverrides

  axios({
    method: 'GET',
    url: '/v1/agentoverrides',
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_agentOverrides",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"sys_agentOverrides": [
		{
			"id": "ID",
			"agentName": "String",
			"provider": "String",
			"model": "String",
			"systemPrompt": "Text",
			"temperature": "Double",
			"maxTokens": "Integer",
			"responseFormat": "String",
			"selectedTools": "Object",
			"guardrails": "Object",
			"enabled": "Boolean",
			"updatedBy": "ID",
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Update Agentoverride API

[Default update API] — This is the designated default update API for the sys_agentOverride data object. Frontend generators and AI agents should use this API for standard CRUD operations.

Rest Route

The updateAgentOverride API REST controller can be triggered via the following route:

/v1/agentoverride/:sys_agentOverrideId

Rest Request Parameters

The updateAgentOverride api has got 10 regular request parameters

Parameter Type Required Population
sys_agentOverrideId ID true request.params?.[“sys_agentOverrideId”]
provider String request.body?.[“provider”]
model String request.body?.[“model”]
systemPrompt Text request.body?.[“systemPrompt”]
temperature Double request.body?.[“temperature”]
maxTokens Integer request.body?.[“maxTokens”]
responseFormat String request.body?.[“responseFormat”]
selectedTools Object request.body?.[“selectedTools”]
guardrails Object request.body?.[“guardrails”]
enabled Boolean request.body?.[“enabled”]
sys_agentOverrideId : This id paremeter is used to select the required data object that will be updated
provider : Override AI provider (e.g., openai, anthropic).
model : Override model name.
systemPrompt : Override system prompt.
temperature : Override temperature (0-2).
maxTokens : Override max tokens.
responseFormat : Override response format (text/json).
selectedTools : Array of tool names from the catalog that this agent can use.
guardrails : Override guardrails: { maxToolCalls, timeout, maxTokenBudget }.
enabled : Enable or disable this agent.

REST Request To access the api you can use the REST controller with the path PATCH /v1/agentoverride/:sys_agentOverrideId

  axios({
    method: 'PATCH',
    url: `/v1/agentoverride/${sys_agentOverrideId}`,
    data: {
            provider:"String",  
            model:"String",  
            systemPrompt:"Text",  
            temperature:"Double",  
            maxTokens:"Integer",  
            responseFormat:"String",  
            selectedTools:"Object",  
            guardrails:"Object",  
            enabled:"Boolean",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_agentOverride",
	"method": "PATCH",
	"action": "update",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_agentOverride": {
		"id": "ID",
		"agentName": "String",
		"provider": "String",
		"model": "String",
		"systemPrompt": "Text",
		"temperature": "Double",
		"maxTokens": "Integer",
		"responseFormat": "String",
		"selectedTools": "Object",
		"guardrails": "Object",
		"enabled": "Boolean",
		"updatedBy": "ID",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": true
	}
}

Create Agentoverride API

[Default create API] — This is the designated default create API for the sys_agentOverride data object. Frontend generators and AI agents should use this API for standard CRUD operations.

Rest Route

The createAgentOverride API REST controller can be triggered via the following route:

/v1/agentoverride

Rest Request Parameters

The createAgentOverride api has got 9 regular request parameters

Parameter Type Required Population
agentName String true request.body?.[“agentName”]
provider String false request.body?.[“provider”]
model String false request.body?.[“model”]
systemPrompt Text false request.body?.[“systemPrompt”]
temperature Double false request.body?.[“temperature”]
maxTokens Integer false request.body?.[“maxTokens”]
responseFormat String false request.body?.[“responseFormat”]
selectedTools Object false request.body?.[“selectedTools”]
guardrails Object false request.body?.[“guardrails”]
agentName : Design-time agent name this override applies to.
provider : Override AI provider (e.g., openai, anthropic).
model : Override model name.
systemPrompt : Override system prompt.
temperature : Override temperature (0-2).
maxTokens : Override max tokens.
responseFormat : Override response format (text/json).
selectedTools : Array of tool names from the catalog that this agent can use.
guardrails : Override guardrails: { maxToolCalls, timeout, maxTokenBudget }.

REST Request To access the api you can use the REST controller with the path POST /v1/agentoverride

  axios({
    method: 'POST',
    url: '/v1/agentoverride',
    data: {
            agentName:"String",  
            provider:"String",  
            model:"String",  
            systemPrompt:"Text",  
            temperature:"Double",  
            maxTokens:"Integer",  
            responseFormat:"String",  
            selectedTools:"Object",  
            guardrails:"Object",  
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "201",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_agentOverride",
	"method": "POST",
	"action": "create",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_agentOverride": {
		"id": "ID",
		"agentName": "String",
		"provider": "String",
		"model": "String",
		"systemPrompt": "Text",
		"temperature": "Double",
		"maxTokens": "Integer",
		"responseFormat": "String",
		"selectedTools": "Object",
		"guardrails": "Object",
		"enabled": "Boolean",
		"updatedBy": "ID",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": true
	}
}

Delete Agentoverride API

[Default delete API] — This is the designated default delete API for the sys_agentOverride data object. Frontend generators and AI agents should use this API for standard CRUD operations.

Rest Route

The deleteAgentOverride API REST controller can be triggered via the following route:

/v1/agentoverride/:sys_agentOverrideId

Rest Request Parameters

The deleteAgentOverride api has got 1 regular request parameter

Parameter Type Required Population
sys_agentOverrideId ID true request.params?.[“sys_agentOverrideId”]
sys_agentOverrideId : This id paremeter is used to select the required data object that will be deleted

REST Request To access the api you can use the REST controller with the path DELETE /v1/agentoverride/:sys_agentOverrideId

  axios({
    method: 'DELETE',
    url: `/v1/agentoverride/${sys_agentOverrideId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_agentOverride",
	"method": "DELETE",
	"action": "delete",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_agentOverride": {
		"id": "ID",
		"agentName": "String",
		"provider": "String",
		"model": "String",
		"systemPrompt": "Text",
		"temperature": "Double",
		"maxTokens": "Integer",
		"responseFormat": "String",
		"selectedTools": "Object",
		"guardrails": "Object",
		"enabled": "Boolean",
		"updatedBy": "ID",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": false
	}
}

List Toolcatalog API

[Default list API] — This is the designated default list API for the sys_toolCatalog data object. Frontend generators and AI agents should use this API for standard CRUD operations.

Rest Route

The listToolCatalog API REST controller can be triggered via the following route:

/v1/toolcatalog

Rest Request Parameters

Filter Parameters

The listToolCatalog api supports 1 optional filter parameter for filtering list results:

serviceName (String): Source service name.

REST Request To access the api you can use the REST controller with the path GET /v1/toolcatalog

  axios({
    method: 'GET',
    url: '/v1/toolcatalog',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // serviceName: '<value>' // Filter by serviceName
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_toolCatalogs",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"sys_toolCatalogs": [
		{
			"id": "ID",
			"toolName": "String",
			"serviceName": "String",
			"description": "Text",
			"parameters": "Object",
			"lastRefreshed": "Date",
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Get Toolcatalogentry API

[Default get API] — This is the designated default get API for the sys_toolCatalog data object. Frontend generators and AI agents should use this API for standard CRUD operations.

Rest Route

The getToolCatalogEntry API REST controller can be triggered via the following route:

/v1/toolcatalogentry/:sys_toolCatalogId

Rest Request Parameters

The getToolCatalogEntry api has got 1 regular request parameter

Parameter Type Required Population
sys_toolCatalogId ID true request.params?.[“sys_toolCatalogId”]
sys_toolCatalogId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/toolcatalogentry/:sys_toolCatalogId

  axios({
    method: 'GET',
    url: `/v1/toolcatalogentry/${sys_toolCatalogId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_toolCatalog",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_toolCatalog": {
		"id": "ID",
		"toolName": "String",
		"serviceName": "String",
		"description": "Text",
		"parameters": "Object",
		"lastRefreshed": "Date",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": true
	}
}

List Agentexecutions API

[Default list API] — This is the designated default list API for the sys_agentExecution data object. Frontend generators and AI agents should use this API for standard CRUD operations.

Rest Route

The listAgentExecutions API REST controller can be triggered via the following route:

/v1/agentexecutions

Rest Request Parameters

Filter Parameters

The listAgentExecutions api supports 5 optional filter parameters for filtering list results:

agentName (String): Agent that was executed.

agentType (Enum): Whether this was a design-time or dynamic agent.

source (Enum): How the agent was triggered.

userId (ID): User who triggered the execution.

status (Enum): Execution status.

REST Request To access the api you can use the REST controller with the path GET /v1/agentexecutions

  axios({
    method: 'GET',
    url: '/v1/agentexecutions',
    data: {
    
    },
    params: {
    
        // Filter parameters (see Filter Parameters section above)
        // agentName: '<value>' // Filter by agentName
        // agentType: '<value>' // Filter by agentType
        // source: '<value>' // Filter by source
        // userId: '<value>' // Filter by userId
        // status: '<value>' // Filter by status
            }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_agentExecutions",
	"method": "GET",
	"action": "list",
	"appVersion": "Version",
	"rowCount": "\"Number\"",
	"sys_agentExecutions": [
		{
			"id": "ID",
			"agentName": "String",
			"agentType": "Enum",
			"agentType_idx": "Integer",
			"source": "Enum",
			"source_idx": "Integer",
			"userId": "ID",
			"input": "Object",
			"output": "Object",
			"toolCalls": "Integer",
			"tokenUsage": "Object",
			"durationMs": "Integer",
			"status": "Enum",
			"status_idx": "Integer",
			"error": "Text",
			"recordVersion": "Integer",
			"createdAt": "Date",
			"updatedAt": "Date",
			"_owner": "ID",
			"isActive": true
		},
		{},
		{}
	],
	"paging": {
		"pageNumber": "Number",
		"pageRowCount": "NUmber",
		"totalRowCount": "Number",
		"pageCount": "Number"
	},
	"filters": [],
	"uiPermissions": []
}

Get Agentexecution API

[Default get API] — This is the designated default get API for the sys_agentExecution data object. Frontend generators and AI agents should use this API for standard CRUD operations.

Rest Route

The getAgentExecution API REST controller can be triggered via the following route:

/v1/agentexecution/:sys_agentExecutionId

Rest Request Parameters

The getAgentExecution api has got 1 regular request parameter

Parameter Type Required Population
sys_agentExecutionId ID true request.params?.[“sys_agentExecutionId”]
sys_agentExecutionId : This id paremeter is used to query the required data object.

REST Request To access the api you can use the REST controller with the path GET /v1/agentexecution/:sys_agentExecutionId

  axios({
    method: 'GET',
    url: `/v1/agentexecution/${sys_agentExecutionId}`,
    data: {
    
    },
    params: {
    
        }
  });

REST Response

{
	"status": "OK",
	"statusCode": "200",
	"elapsedMs": 126,
	"ssoTime": 120,
	"source": "db",
	"cacheKey": "hexCode",
	"userId": "ID",
	"sessionId": "ID",
	"requestId": "ID",
	"dataName": "sys_agentExecution",
	"method": "GET",
	"action": "get",
	"appVersion": "Version",
	"rowCount": 1,
	"sys_agentExecution": {
		"id": "ID",
		"agentName": "String",
		"agentType": "Enum",
		"agentType_idx": "Integer",
		"source": "Enum",
		"source_idx": "Integer",
		"userId": "ID",
		"input": "Object",
		"output": "Object",
		"toolCalls": "Integer",
		"tokenUsage": "Object",
		"durationMs": "Integer",
		"status": "Enum",
		"status_idx": "Integer",
		"error": "Text",
		"recordVersion": "Integer",
		"createdAt": "Date",
		"updatedAt": "Date",
		"_owner": "ID",
		"isActive": true
	}
}

Authentication Specific Routes

Common Routes

Route: currentuser

Route Definition: Retrieves the currently authenticated user’s session information.

Route Type: sessionInfo

Access Route: GET /currentuser

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /currentuser call
axios.get("/currentuser", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response Returns the session object, including user-related data and token information.

{
  "sessionId": "9cf23fa8-07d4-4e7c-80a6-ec6d6ac96bb9",
  "userId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
  "email": "user@example.com",
  "fullname": "John Doe",
  "roleId": "user",
  "tenantId": "abc123",
  "accessToken": "jwt-token-string",
  ...
}

Error Response 401 Unauthorized: No active session found.

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Route: permissions

*Route Definition*: Retrieves all effective permission records assigned to the currently authenticated user.

*Route Type*: permissionFetch

Access Route: GET /permissions

Parameters

This route does not require any request parameters.

Behavior

// Sample GET /permissions call
axios.get("/permissions", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

Returns an array of permission objects.

[
  {
    "id": "perm1",
    "permissionName": "adminPanel.access",
    "roleId": "admin",
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  },
  {
    "id": "perm2",
    "permissionName": "orders.manage",
    "roleId": null,
    "subjectUserId": "d92b9d4c-9b1e-4e95-842e-3fb9c8c1df38",
    "subjectUserGroupId": null,
    "objectId": null,
    "canDo": true,
    "tenantCodename": "store123"
  }
]

Each object reflects a single permission grant, aligned with the givenPermissions model:

Error Responses

{
  "status": "ERR",
  "message": "No login found"
}

Notes

Tip: Applications can cache permission results client-side or server-side, but should occasionally refresh by calling this endpoint, especially after login or permission-changing operations.

Route: permissions/:permissionName

Route Definition: Checks whether the current user has access to a specific permission, and provides a list of scoped object exceptions or inclusions.

Route Type: permissionScopeCheck

Access Route: GET /permissions/:permissionName

Parameters

Parameter Type Required Population
permissionName String Yes request.params.permissionName

Behavior

// Sample GET /permissions/orders.manage
axios.get("/permissions/orders.manage", {
  headers: {
    "Authorization": "Bearer your-jwt-token"
  }
});

Success Response

{
  "canDo": true,
  "exceptions": [
    "a1f2e3d4-xxxx-yyyy-zzzz-object1",
    "b2c3d4e5-xxxx-yyyy-zzzz-object2"
  ]
}

Copyright

All sources, documents and other digital materials are copyright of .

About Us

For more information please visit our website: .

. .


REST API GUIDE

BFF SERVICE

Version: 1.0.19

BFF service is a microservice that acts as a bridge between the client and the backend services. It provides a unified API for the client to interact with multiple backend services, simplifying the communication process and improving performance.

Architectural Design Credit and Contact Information

The architectural design of this microservice is credited to.
For inquiries, feedback, or further information regarding the architecture, please direct your communication to:

Email:

We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice.

Documentation Scope

Welcome to the official documentation for the BFF Service’s REST API. This document is designed to provide a comprehensive guide to interfacing with our BFF Service exclusively through RESTful API endpoints.

Intended Audience

This documentation is intended for developers and integrators who are looking to interact with the BFF Service via HTTP requests for purposes such as listing, filtering, and searching data.

Overview

Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases.

Beyond REST
It’s important to note that the BFF Service also supports alternative methods of interaction, such as gRPC and messaging via a Message Broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation.


Resources

Elastic Index Resource

Resource Definition: A virtual resource representing dynamic search data from a specified index.


Route: List Records

Route Definition: Returns a paginated list from the elastic index. Route Type: list
Default access route: POST /:indexName/list

Parameters

Parameter Type Required Population
indexName String Yes path.param
page Number No query.page
limit Number No query.limit
sortBy String No query.sortBy
sortOrder String No query.sortOrder
q String No query.q
filters Object Yes body
axios({
  method: "POST",
  url: `/${indexName}/list`,
  data: {
    filters: "Object"
  },
  params: {
    page: "Number",
    limit: "Number",
    sortBy: "String",
    sortOrder: "String",
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property.

---

Default access route: GET /:indexName/list

Parameters

Parameter Type Required Population
indexName String Yes path.param
page Number No query.page
limit Number No query.limit
sortBy String No query.sortBy
sortOrder String No query.sortOrder
q String No query.q
axios({
  method: "GET",
  url: `/${indexName}/list`,
  data:{},
  params: {
    page: "Number",
    limit: "Number",
    sortBy: "String",
    sortOrder: "String",
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Count Records

Route Definition: Counts matching documents in the elastic index. Route Type: count
Default access route: POST /:indexName/count

Parameters

Parameter Type Required Population
indexName String Yes path.param
q String No query.q
filters Object Yes body
axios({
  method: "POST",
  url: `/${indexName}/count`,
  data: {
    filters: "Object"
  },
  params: {
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.


Default access route: GET /:indexName/count

Parameters

Parameter Type Required Population
indexName String Yes path.param
q String No query.q
axios({
  method: "GET",
  url: `/${indexName}/count`,
  data:{},
  params: {
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get Index Schema

Route Definition: Returns the schema for the elastic index. Route Type: get
Default access route: GET /:indexName/schema

Parameters

Parameter Type Required Population
indexName String Yes path.param
axios({
  method: "GET",
  url: `/${indexName}/schema`,
  data:{},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Filters

GET /:indexName/filters

Route Type: get

Parameters

Parameter Type Required Population
indexName String Yes path.param
page Number No query.page
limit Number No query.limit
axios({
  method: "GET",
  url: `/${indexName}/filters`,
  data:{},
  params: {
    page: "Number",
    limit: "Number"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

POST /:indexName/filters

Route Type: create

Parameters

Parameter Type Required Population
indexName String Yes path.param
filters Object Yes body
axios({
  method: "POST",
  url: `/${indexName}/filters`,
  data: {
    filterName: "String",
    conditions: "Object"
  },
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

DELETE /:indexName/filters/:filterId

Route Type: delete

Parameters

Parameter Type Required Population
indexName String Yes path.param
filterId String Yes path.param
axios({
  method: "DELETE",
  url: `/${indexName}/filters/${filterId}`,
  data:{},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get One Record

Route Type: get
Default access route: GET /:indexName/:id

Parameters

Parameter Type Required Population
indexName String Yes path.param
id ID Yes path.param
axios({
  method: "GET",
  url: `/${indexName}/${id}`,
  data:{},
  params: {}

});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get All Aggregated Records

Route Definition: Retrieves a full list of aggregated view data. Route Type: list Default access route: GET /BookingListView

Example:

axios({
  method: "GET",
  url: `/BookingListView`,
  data: {},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get Single Aggregated Record

Route Definition: Retrieves a specific aggregated document by ID. Route Type: get Default access route: GET /BookingListView/:id

Parameters

Parameter Type Required Population
id ID Yes path.param
axios({
  method: "GET",
  url: `/BookingListView/${id}`,
  data: {},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get All Aggregated Records

Route Definition: Retrieves a full list of aggregated view data. Route Type: list Default access route: GET /MessageThreadView

Example:

axios({
  method: "GET",
  url: `/MessageThreadView`,
  data: {},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get Single Aggregated Record

Route Definition: Retrieves a specific aggregated document by ID. Route Type: get Default access route: GET /MessageThreadView/:id

Parameters

Parameter Type Required Population
id ID Yes path.param
axios({
  method: "GET",
  url: `/MessageThreadView/${id}`,
  data: {},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get All Aggregated Records

Route Definition: Retrieves a full list of aggregated view data. Route Type: list Default access route: GET /ReviewDisplayView

Example:

axios({
  method: "GET",
  url: `/ReviewDisplayView`,
  data: {},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get Single Aggregated Record

Route Definition: Retrieves a specific aggregated document by ID. Route Type: get Default access route: GET /ReviewDisplayView/:id

Parameters

Parameter Type Required Population
id ID Yes path.param
axios({
  method: "GET",
  url: `/ReviewDisplayView/${id}`,
  data: {},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get All Aggregated Records

Route Definition: Retrieves a full list of aggregated view data. Route Type: list Default access route: GET /PaymentRecordView

Example:

axios({
  method: "GET",
  url: `/PaymentRecordView`,
  data: {},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get Single Aggregated Record

Route Definition: Retrieves a specific aggregated document by ID. Route Type: get Default access route: GET /PaymentRecordView/:id

Parameters

Parameter Type Required Population
id ID Yes path.param
axios({
  method: "GET",
  url: `/PaymentRecordView/${id}`,
  data: {},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get All Aggregated Records

Route Definition: Retrieves a full list of aggregated view data. Route Type: list Default access route: GET /disputeDetailView

Example:

axios({
  method: "GET",
  url: `/disputeDetailView`,
  data: {},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get Single Aggregated Record

Route Definition: Retrieves a specific aggregated document by ID. Route Type: get Default access route: GET /disputeDetailView/:id

Parameters

Parameter Type Required Population
id ID Yes path.param
axios({
  method: "GET",
  url: `/disputeDetailView/${id}`,
  data: {},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: List Records

Route Definition: Returns a paginated list from the elastic index. Route Type: list
Default access route: POST /ReservationDetailView/list

Parameters

Parameter Type Required Population
page Number No query.page
limit Number No query.limit
sortBy String No query.sortBy
sortOrder String No query.sortOrder
q String No query.q
filters Object Yes body
axios({
  method: "POST",
  url: `/ReservationDetailView/list`,
  data: {
    filters: "Object"
  },
  params: {
    page: "Number",
    limit: "Number",
    sortBy: "String",
    sortOrder: "String",
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Default access route: GET /ReservationDetailView/list

Parameters

Parameter Type Required Population
page Number No query.page
limit Number No query.limit
sortBy String No query.sortBy
sortOrder String No query.sortOrder
q String No query.q
axios({
  method: "GET",
  url: `/ReservationDetailView/list`,
  data:{},
  params: {
    page: "Number",
    limit: "Number",
    sortBy: "String",
    sortOrder: "String",
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Count Records

Route Definition: Counts matching documents in the elastic index. Route Type: count
Default access route: POST /ReservationDetailView/count

Parameters

Parameter Type Required Population
q String No query.q
filters Object Yes body
axios({
  method: "POST",
  url: `/ReservationDetailView/count`,
  data: {
    filters: "Object"
  },
  params: {
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.


Default access route: GET /ReservationDetailView/count

Parameters

Parameter Type Required Population
q String No query.q
axios({
  method: "GET",
  url: `/ReservationDetailView/count`,
  data:{},
  params: {
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get Index Schema

Route Definition: Returns the schema for the elastic index. Route Type: get Default access route: GET /ReservationDetailView/schema

axios({
  method: "GET",
  url: `/ReservationDetailView/schema`,
  data:{},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Filters

GET /ReservationDetailView/filters

Route Type: get

Parameters

Parameter Type Required Population
page Number No query.page
limit Number No query.limit
axios({
  method: "GET",
  url: `/ReservationDetailView/filters`,
  data:{},
  params: {
    page: "Number",
    limit: "Number"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

POST /ReservationDetailView/filters

Route Type: create

Parameters

Parameter Type Required Population
filters Object Yes body
axios({
  method: "POST",
  url: `/ReservationDetailView/filters`,
  data: {
    "filters":"Object"
  },
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

DELETE /ReservationDetailView/filters/:filterId

Route Type: delete

Parameters

Parameter Type Required Population
filterId ID Yes path.param
axios({
  method: "DELETE",
  url: `/ReservationDetailView/filters/${filterId}`,
  data:{},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get One Record

Route Type: get Default access route: GET /ReservationDetailView/:id

Parameters

Parameter Type Required Population
id ID Yes path.param
axios({
  method: "GET",
  url: `/ReservationDetailView/${id}`,
  data:{},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.


Route: List Records

Route Definition: Returns a paginated list from the elastic index. Route Type: list
Default access route: POST /chatContext/list

Parameters

Parameter Type Required Population
page Number No query.page
limit Number No query.limit
sortBy String No query.sortBy
sortOrder String No query.sortOrder
q String No query.q
filters Object Yes body
axios({
  method: "POST",
  url: `/chatContext/list`,
  data: {
    filters: "Object"
  },
  params: {
    page: "Number",
    limit: "Number",
    sortBy: "String",
    sortOrder: "String",
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Default access route: GET /chatContext/list

Parameters

Parameter Type Required Population
page Number No query.page
limit Number No query.limit
sortBy String No query.sortBy
sortOrder String No query.sortOrder
q String No query.q
axios({
  method: "GET",
  url: `/chatContext/list`,
  data:{},
  params: {
    page: "Number",
    limit: "Number",
    sortBy: "String",
    sortOrder: "String",
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Count Records

Route Definition: Counts matching documents in the elastic index. Route Type: count
Default access route: POST /chatContext/count

Parameters

Parameter Type Required Population
q String No query.q
filters Object Yes body
axios({
  method: "POST",
  url: `/chatContext/count`,
  data: {
    filters: "Object"
  },
  params: {
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.


Default access route: GET /chatContext/count

Parameters

Parameter Type Required Population
q String No query.q
axios({
  method: "GET",
  url: `/chatContext/count`,
  data:{},
  params: {
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get Index Schema

Route Definition: Returns the schema for the elastic index. Route Type: get Default access route: GET /chatContext/schema

axios({
  method: "GET",
  url: `/chatContext/schema`,
  data:{},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Filters

GET /chatContext/filters

Route Type: get

Parameters

Parameter Type Required Population
page Number No query.page
limit Number No query.limit
axios({
  method: "GET",
  url: `/chatContext/filters`,
  data:{},
  params: {
    page: "Number",
    limit: "Number"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

POST /chatContext/filters

Route Type: create

Parameters

Parameter Type Required Population
filters Object Yes body
axios({
  method: "POST",
  url: `/chatContext/filters`,
  data: {
    "filters":"Object"
  },
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

DELETE /chatContext/filters/:filterId

Route Type: delete

Parameters

Parameter Type Required Population
filterId ID Yes path.param
axios({
  method: "DELETE",
  url: `/chatContext/filters/${filterId}`,
  data:{},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get One Record

Route Type: get Default access route: GET /chatContext/:id

Parameters

Parameter Type Required Population
id ID Yes path.param
axios({
  method: "GET",
  url: `/chatContext/${id}`,
  data:{},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.


Route: List Records

Route Definition: Returns a paginated list from the elastic index. Route Type: list
Default access route: POST /ListingDetailView/list

Parameters

Parameter Type Required Population
page Number No query.page
limit Number No query.limit
sortBy String No query.sortBy
sortOrder String No query.sortOrder
q String No query.q
filters Object Yes body
axios({
  method: "POST",
  url: `/ListingDetailView/list`,
  data: {
    filters: "Object"
  },
  params: {
    page: "Number",
    limit: "Number",
    sortBy: "String",
    sortOrder: "String",
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Default access route: GET /ListingDetailView/list

Parameters

Parameter Type Required Population
page Number No query.page
limit Number No query.limit
sortBy String No query.sortBy
sortOrder String No query.sortOrder
q String No query.q
axios({
  method: "GET",
  url: `/ListingDetailView/list`,
  data:{},
  params: {
    page: "Number",
    limit: "Number",
    sortBy: "String",
    sortOrder: "String",
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Count Records

Route Definition: Counts matching documents in the elastic index. Route Type: count
Default access route: POST /ListingDetailView/count

Parameters

Parameter Type Required Population
q String No query.q
filters Object Yes body
axios({
  method: "POST",
  url: `/ListingDetailView/count`,
  data: {
    filters: "Object"
  },
  params: {
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.


Default access route: GET /ListingDetailView/count

Parameters

Parameter Type Required Population
q String No query.q
axios({
  method: "GET",
  url: `/ListingDetailView/count`,
  data:{},
  params: {
    q: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get Index Schema

Route Definition: Returns the schema for the elastic index. Route Type: get Default access route: GET /ListingDetailView/schema

axios({
  method: "GET",
  url: `/ListingDetailView/schema`,
  data:{},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Filters

GET /ListingDetailView/filters

Route Type: get

Parameters

Parameter Type Required Population
page Number No query.page
limit Number No query.limit
axios({
  method: "GET",
  url: `/ListingDetailView/filters`,
  data:{},
  params: {
    page: "Number",
    limit: "Number"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

POST /ListingDetailView/filters

Route Type: create

Parameters

Parameter Type Required Population
filters Object Yes body
axios({
  method: "POST",
  url: `/ListingDetailView/filters`,
  data: {
    "filters":"Object"
  },
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

DELETE /ListingDetailView/filters/:filterId

Route Type: delete

Parameters

Parameter Type Required Population
filterId ID Yes path.param
axios({
  method: "DELETE",
  url: `/ListingDetailView/filters/${filterId}`,
  data:{},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.

Route: Get One Record

Route Type: get Default access route: GET /ListingDetailView/:id

Parameters

Parameter Type Required Population
id ID Yes path.param
axios({
  method: "GET",
  url: `/ListingDetailView/${id}`,
  data:{},
  params: {}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a “status”: “OK” property.



REST API GUIDE

NOTIFICATION SERVICE

Version: 1.0.7

The Notification service is a microservice that allows sending notifications through SMS, Email, and Push channels. Providers can be configured dynamically through the .env file.

Architectural Design Credit and Contact Information

The architectural design of this microservice is credited to.
For inquiries, feedback, or further information regarding the architecture, please direct your communication to:

Email:

We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice.

Documentation Scope

Welcome to the official documentation for the Notification Service REST API. This document provides a comprehensive overview of the available endpoints, how they work, and how to use them efficiently.

Intended Audience
This documentation is intended for developers, architects, and system administrators involved in the design, implementation, and maintenance of the Notification Service. It assumes familiarity with microservices architecture and RESTful APIs.

Overview

Within these pages, you will find detailed information on how to effectively utilize the REST API, including authentication methods, request and response formats, endpoint descriptions, and examples of common use cases.

Beyond REST
It’s important to note that the Notification Service also supports alternative methods of interaction, such as messaging via a Kafka message broker. These communication methods are beyond the scope of this document. For information regarding these protocols, please refer to their respective documentation.


Routes

Route: Register Device

Route Definition: Registers a device for a user.
Route Type: create
Default access route: POST /devices/register

Parameters

Parameter Type Required Population
device Object Yes body
userId ID Yes req.userId
axios({
  method: "POST",
  url: `/devices/register`,
  data: {
    device:"Object"
  },
  params:{}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. Any validation errors will return status code 400 with an error message.

Route: Unregister Device

Route Definition: Removes a registered device.
Route Type: delete
Default access route: DELETE /devices/unregister/:deviceId

Parameters

Parameter Type Required Population
deviceId ID Yes path.param
userId ID Yes req.userId
axios({
  method: "DELETE",
  url: `/devices/unregister/${deviceId}`,
  data:{},
  params:{}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. Any validation errors will return status code 400 with an error message.

Route: Get Notifications

Route Definition: Retrieves a paginated list of notifications.
Route Type: get
Default access route: GET /notifications

Parameters

Parameter Type Required Population
page Number No query.page
limit Number No query.limit
sortBy String No query.sortBy
userId ID Yes req.userId
axios({
  method: "GET",
  url: `/notifications`,
  data:{},
  params: {
    page: "Number",
    limit: "Number",
    sortBy: "String"
  }
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. Any validation errors will return status code 400 with an error message.

Route: Send Notification

Route Definition: Sends a notification to specified recipients.
Route Type: create
Default access route: POST /notifications

Parameters

Parameter Type Required Population
notification Object Yes body
axios({
  method: "POST",
  url: `/notifications`,
  data: {
    notification:"Object"
  },
  params:{}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. Any validation errors will return status code 400 with an error message.

Route: Mark Notifications as Seen

Route Definition: Marks selected notifications as seen.
Route Type: update
Default access route: POST /notifications/seen

Parameters

Parameter Type Required Population
notificationIds Array Yes body
userId ID Yes req.userId
axios({
  method: "POST",
  url: `/notifications/seen`,
  data: {
    notificationIds:"Object"
  },
  params:{}
});

The API response is encapsulated within a JSON envelope. Successful operations return an HTTP status code of 200 for get, list, update, or delete requests, and 201 for create requests. Each successful response includes a "status": "OK" property. Any validation errors will return status code 400 with an error message.




Generated by Mindbricks Genesis Engine