MonetizationOS Docs
Workflows Reference

Endpoint Workflows

Handle incoming HTTP requests with custom logic. Endpoint workflows allow you to create custom API endpoints backed by your own business logic, with access to identity, integrations, and offer engine utilities.

Usage

Endpoint Workflow
const :  = async ({  }: ): <> => {
    const  = new (.).;
    return new (`hello, ${}`);
};

export default ;

Invocation

Endpoint workflows are executed when the configured endpoint path receives an HTTP request, find more about Endpoint URLs here.

Arguments

See EndpointWorkflowArgs.

Prop

Type

Return Type

The workflow returns EndpointWorkflowResult, which is a standard Web API Response object.

  • Can return any valid Response with custom status, headers, and body.
  • Use standard Response constructor: new Response(body, { status, headers }).
  • Alternatively, use shorthand static methods like:

Access Levels

Endpoints are configured with access levels:

  • No Key: No authentication required.
  • Public Key: Requires public API key authentication.
  • Secret Key: Requires API key authentication via X-MOS-Key header.

Access level is configured in the endpoint settings, not in the workflow, and determines who can call the endpoint. If you are not using Secret Key authentication, you must handle authentication and authorization within the workflow code as needed.

Common Use Cases

  • Build custom API endpoints for your application
  • Implement webhook listeners to receive external events
  • Create data transformation or proxy endpoints
  • Expose offer redemption or identity lookup APIs
  • Integrate with third-party services requiring custom endpoints

See Also