Skip to content

Last updated on 2026-10-04

Payload CMS and webhooks ​

auto-post.io publishes generated articles to a Payload CMS project through its REST API. Native inbound webhooks in the product are used for billing (Stripe). Custom content webhooks are not an active destination type in the app catalog; the example below is for your own external pipeline only.

Payload CMS integration ​

What you need ​

Before connecting Payload CMS, prepare:

  • A public Payload REST API base URL
  • A Payload user account that can access the configured collections
  • The authentication collection slug, usually users
  • A posts collection slug
  • Optional category and media collection slugs

Connect Payload CMS ​

  1. Open Websites, then choose Add website.
  2. Select Payload CMS as the platform.
  3. Enter the website name and public URL.
  4. Enter the Payload API URL, login email, password, authentication collection slug, and posts collection slug.
  5. Add category and media collection slugs when your project uses them.
  6. Select Continue. auto-post.io logs in, reads a sample post, and suggests a field mapping.
  7. Review the suggested mapping and submit the connection.

The connection stores the credentials needed to obtain a Payload JWT. Tokens are refreshed or recreated when required for later requests.

Field mapping ​

The mapping connects auto-post.io fields to fields in your Payload posts collection:

  • Title
  • slug
  • Content
  • Publication date
  • Categories
  • Featured image
  • Open Graph image
  • SEO title, description, and keywords
  • Public post URL

Nested fields are supported with dot paths such as seo.title. You can use the AI suggestion step as a starting point, then review every field before saving.

Payload rich text is sent as Lexical JSON by default. Choose the plain HTML format only when your collection expects HTML content.

Payload collections and endpoints ​

The following example shows the minimum collection shape expected by the integration. Field names can differ when you configure the corresponding mapping in auto-post.io.

js
// payload/collections/Posts.js
import { lexicalEditor } from '@payloadcms/richtext-lexical';

export const Posts = {
  slug: 'posts',
  access: {
    create: ({ req }) => Boolean(req.user),
    read: () => true,
    update: ({ req }) => Boolean(req.user),
  },
  fields: [
    { name: 'title', type: 'text', required: true },
    { name: 'slug', type: 'text', required: true, unique: true },
    { name: 'content', type: 'richText', editor: lexicalEditor() },
    { name: 'publishedAt', type: 'date' },
    { name: 'categories', type: 'relationship', relationTo: 'categories', hasMany: true },
    { name: 'featuredImage', type: 'upload', relationTo: 'media' },
  ],
};

auto-post.io uses these Payload REST endpoints. Replace https://cms.example.com/api and collection slugs with your values:

bash
# Login and receive a JWT
curl -X POST "https://cms.example.com/api/users/login" \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"YOUR_PASSWORD"}'

# Create a post
curl -X POST "https://cms.example.com/api/posts" \
  -H "Authorization: JWT YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"title":"A generated article","slug":"a-generated-article","content":{"root":{"type":"root","children":[],"direction":null,"format":"","indent":0,"version":1}},"_status":"draft"}'

# Update an existing post
curl -X PATCH "https://cms.example.com/api/posts/123" \
  -H "Authorization: JWT YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"title":"An updated article","_status":"published"}'

For featured images, configure a media collection and make sure its upload field accepts the multipart field name configured in auto-post.io (file by default):

bash
curl -X POST "https://cms.example.com/api/media" \
  -H "Authorization: JWT YOUR_JWT" \
  -F "[email protected]"

Publishing behavior ​

When a campaign generates an article for a Payload website:

  • Draft content is sent with Payload _status set to draft
  • Published content is sent with _status set to published
  • Existing Payload documents are updated instead of duplicated when their document ID is known
  • Categories are synchronized from the configured categories collection
  • Featured images are uploaded to the configured media collection when a media field is mapped
  • The generated article public URL is taken from the configured URL field, a returned URL, or the configured path template

See Campaign management to configure campaigns that publish to Payload CMS.

Webhooks (billing and external examples) ​

Active native webhook: Stripe ​

The product webhook endpoint used in production is Stripe billing at /webhook/stripe. It handles subscription and payment events for your auto-post.io account. You do not configure this for content publishing.

Custom content webhooks (external example only) ​

There is no active in-app catalog or custom route for sending generated articles to arbitrary webhook URLs. If you need a custom delivery step, build it outside auto-post.io (for example by reading published content from Payload, WordPress, or another connected CMS).

The JSON shape below is an example contract you can implement on your own server. It is not a guaranteed auto-post.io outbound payload today.

json
{
  "event": "article.published",
  "idempotencyKey": "article-123-published",
  "article": {
    "title": "A generated article",
    "slug": "a-generated-article",
    "content": "<p>Article content</p>",
    "status": "published",
    "publishedAt": "2026-09-10T19:20:00Z",
    "featuredImage": "https://cdn.example.com/articles/a-generated-article.jpg"
  }
}

If you adopt a similar contract on your side:

  • Authenticate and validate every request
  • Reject malformed payloads with 4xx
  • Make idempotencyKey unique before writing content
  • Return 2xx only after accepting the request

Troubleshooting ​

Connection fails ​

  • Confirm that the API URL points to the Payload REST API, not only to the public frontend
  • Check the authentication collection slug and login credentials
  • Confirm that the posts collection exists and is readable by the user
  • Check that the API is reachable from the internet

Articles are rejected ​

  • Verify that the mapped field names match the Payload collection
  • Confirm the content field type and the selected rich text format
  • Check required fields, relationship formats, and media permissions
  • Review the collection access rules for create and update operations

Images are missing ​

  • Configure a media collection slug
  • Check the mapped featured image or Open Graph field
  • Confirm that the media collection accepts the configured upload field

Last updated on 2026-10-04