Integration

Connect Sanity to Blog Automation

Articles become documents in your Sanity dataset - with title, slug, Portable Text, cover image, tags and date. Drafts show up in Sanity Studio as drafts.

Tested with a real account

What you need for Sanity

  • A Sanity project with Studio and a document type for articles (e.g. post).
  • At least one document of that type - Blog Automation reads the fields from an existing document.
  • Permission to create API tokens in the project.

Step by step: connect Sanity

  1. In Sanity Studio create a document of your article type (e.g. a test post with title, slug, text and image) and publish it.
  2. Open sanity.io/manage → your project → API → Tokens → Add API token with Editor permissions and copy the token.
  3. The project ID is shown at the top of the project; the dataset is usually called production.
  4. In Blog Automation: Websites & blogs → Connect website → Sanity. Enter project ID, dataset and token, then click Check connection.
  5. Choose the document type, check the field names, choose status and language and click Save.

Where do I find what in Sanity?

Field in Blog AutomationWhere to find it in Sanity
Project IDsanity.io/manage → project, shown at the top. Lower-case letters and digits, e.g. abc12345.
DatasetUsually production.
API token (Editor)sanity.io/manage → API → Tokens, "Editor" permissions. Shown only once.

What is transferred to Sanity?

Field names come from an existing document and can be edited by hand. Article text goes as Portable Text into a block field (or as HTML/Markdown into a string field), slug into a slug field, cover image into an image field (uploaded as an asset), tags into an array of strings.

Tips for Sanity

  • Fields that are empty in the sample document are not detected - fill in the sample completely or type the names by hand.

Good to know about Sanity

  • The schema lives in your Studio’s code; Blog Automation does not validate field names against it.
  • Drafts are stored as drafts. documents and published in Studio.

More in the official Sanity documentation (external link).

Frequently asked questions about Sanity

My document type is not offered.

There is no document of that type in the dataset yet. Create one in Studio and check again.

The check reports missing write permission.

The token needs the "Editor" role (not "Viewer"). Create a new token.

Ready for your first post?

Try Blog Automation with sample data

The demo opens at once, no sign-up needed. You see the dashboard, editor, calendar and approval just the way your team will use them.

Try the demo - no sign-upStart free

The demo shows sample texts. The Free plan includes 200 tokens a month.

Try the demo