> ## Documentation Index
> Fetch the complete documentation index at: https://memberpulseptyltd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# REST API

> Build custom integrations with our REST API

## Overview

The MemberPulse REST API provides full access to all platform resources, enabling you to build custom integrations and automate workflows.

## Authentication

All API requests require authentication using an API key.

```bash theme={null}
curl -X GET "https://api.memberpulse.com/api/members" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
```

## Base URL

```
Production: https://api.memberpulse.com/api
Sandbox:    https://sandbox.memberpulse.com/api
```

## Rate Limiting

| Plan         | Requests/Hour |
| ------------ | ------------- |
| Standard     | 1,000         |
| Professional | 5,000         |
| Enterprise   | 25,000        |

## Resources

### Members

```
GET    /api/members              # List members
GET    /api/members/{id}         # Get member
POST   /api/members              # Create member
PUT    /api/members/{id}         # Update member
DELETE /api/members/{id}         # Delete member
```

#### Acceptance Criteria

##### Frontend

* [ ] Members workflow is implemented in the UI as described.

##### Backend / API

* [ ] Backend behavior supports Members as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

### Events

```
GET    /api/events               # List events
GET    /api/events/{id}          # Get event
POST   /api/events               # Create event
PUT    /api/events/{id}          # Update event
DELETE /api/events/{id}          # Delete event
```

#### Acceptance Criteria

##### Frontend

* [ ] Events workflow is implemented in the UI as described.

##### Backend / API

* [ ] Backend behavior supports Events as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

### Courses

```
GET    /api/courses              # List courses
GET    /api/courses/{id}         # Get course
POST   /api/courses              # Create course
PUT    /api/courses/{id}         # Update course
DELETE /api/courses/{id}         # Delete course
```

#### Acceptance Criteria

##### Frontend

* [ ] Courses workflow is implemented in the UI as described.

##### Backend / API

* [ ] Backend behavior supports Courses as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

## Pagination

All list endpoints support pagination:

```
GET /api/members?page=1&itemsPerPage=25
```

## Filtering

Filter results using query parameters:

```
GET /api/members?email=john@example.com
GET /api/events?status=published
GET /api/members?createdAt[after]=2024-01-01
```

## Error Responses

Errors follow RFC 7807 Problem Details format:

```json theme={null}
{
  "type": "https://api.memberpulse.com/errors/validation-error",
  "title": "Validation Failed",
  "status": 400,
  "detail": "One or more fields failed validation"
}
```

## Webhooks

Configure webhooks to receive real-time notifications:

```
POST /api/webhooks
{
  "url": "https://your-app.com/webhook",
  "events": ["member.created", "member.updated"]
}
```

## API Keys

Generate and manage API keys in **Client Portal > Settings > API Keys**.

## Features

### REST API

#### Acceptance Criteria

##### Frontend

* [ ] UI provides configuration controls and status/health indicators for this integration.

##### Backend / API

* [ ] Integration can be connected, configured, and exercised end-to-end (auth + sync/webhooks).

##### Permissions

* [ ] Only `ROLE_CLIENT_ADMIN` (or equivalent) can configure the integration.

##### Business Rules

* [ ] Data sync respects tenant isolation and mapping rules.

##### Error Handling

* [ ] Auth and sync failures are surfaced with actionable messages and retry behavior.
