RedPlanetHQ / RedPlanetHQ/core
New Integration: Payload CMS
Open
@AggManik is already working on this.
Since Mar 30, 2026.
enhancement
integration
new-feature
new-integration
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 194
- Avg merge
- 12m
- Merged PRs (30d)
- 2
Description
Description
Add Payload CMS integration to sync collections, documents, media, and content changes into CORE.
Reference Implementations
Existing Integrations (use as templates)
integrations/github/- REST API + OAuth patternintegrations/intercom/- Schedule-based sync with cursor paginationintegrations/linear/- Content/project data sync reference
Required Files Structure
integrations/payload-cms/
├── src/
│ ├── index.ts # Main entry, auth spec
│ ├── schedule.ts # Sync logic
│ ├── utils.ts # Payload API utilities
│ ├── account-create.ts # Auth setup (API key or OAuth)
│ └── create-activity.ts # Activity formatting
├── package.json
├── tsup.config.ts
└── README.md
Payload CMS API Integration
Auth Setup
- Payload supports both API Key and email/password (JWT) authentication
- Prefer API Key auth for integrations (simpler, no expiry management)
- Auth header:
Authorization: <api-key>orBearer <jwt> - Base URL: user-configurable (self-hosted), e.g.
https://your-payload-instance.com
Key Endpoints
GET /api/{collection-slug}- List documents in a collectionGET /api/{collection-slug}/{id}- Get a specific documentPOST /api/{collection-slug}- Create a documentGET /api/globals/{global-slug}- Get global dataGET /api/{collection-slug}/versions- List document versionsGET /api/media- List media files
Data to Sync
- Collections - All configured collections and their documents
- Globals - Global singleton data (site config, settings)
- Media - Uploaded files and media metadata
- Versions - Document version history and draft states
- Changes - Create, update, delete events across collections
Implementation Tasks
- Set up basic integration structure following existing integration patterns
- Implement API Key auth flow in
account-create.tswith configurable base URL - Create API utilities in
utils.tswith Payload REST client - Implement sync logic in
schedule.tsto poll collections for changes - Convert Payload document events to CORE activity format
- Handle dynamic collection schemas (fetch schema at runtime)
- Add error handling and pagination (Payload uses
limit/pageparams) - Create integration documentation
- Add to
integrations/README.md
Technical Notes
- Use
IntegrationDefinitionV2registration pattern — no v1 auth fields - Base URL is user-defined (self-hosted); must be stored in account config
- Payload REST API is auto-generated from collection configs — schema is dynamic
- Pagination:
?limit=100&page=1withtotalDocs,totalPagesin response - Versions endpoint available only if
versions: truein collection config - Webhooks available in Payload for real-time events (optional enhancement)
- Depth parameter
?depth=2controls relationship population
Resources
Labels
enhancement, integration, new-feature, new-integration
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.