Back to KB
Difficulty
Intermediate
Read Time
4 min

`/api/newsletter/subscribe`

By Codcompass TeamΒ·Β·4 min read

/api/newsletter/subscribe

Overview

The /api/newsletter/subscribe endpoint provides a public, unauthenticated interface for managing newsletter subscription records. It serves two primary functions: registering new email addresses into the platform's subscriber database and retrieving aggregate subscription metrics. This endpoint is designed for frontend applications, marketing automation workflows, and internal dashboards that need to sync user opt-in events with the backend data layer.

Developers should call this endpoint when a user explicitly consents to receive email communications, or when an administrative interface requires real-time visibility into subscription volume and active status distribution. The endpoint handles duplicate prevention automatically, ensuring database integrity without requiring additional client-side checks.

Endpoint Reference

PropertyValue
Path/api/newsletter/subscribe
HTTP MethodsPOST, GET
AuthenticationPublic (No authentication required)
Content-Typeapplication/json
Base URLhttps://api.codcompass.com (replace with your deployment domain)

Request Format

Headers

All requests must include the standard Content-Type header when sending or expecting JSON payloads.

Content-Type: application/json

Query Parameters (GET only)

ParameterTypeRequiredDescription
actionstringYesSpec

πŸŽ‰ Mid-Year Sale β€” Unlock Full Article

Base plan from just $4.99/mo or $49/yr

Sign in to read the full article and unlock all 635+ tutorials.

Sign In / Register β€” Start Free Trial

7-day free trial Β· Cancel anytime Β· 30-day money-back

Sources

  • β€’ api-reference