Prerequisites
- Drupal 8.7 or newer, served over HTTPS and reachable from the public internet.
- The JSON:API core module enabled.
- The HTTP Basic Authentication (
basic_auth) core module enabled. - For publishing and updating: JSON:API set to read-write — check “Accept
all JSON:API create, read, update, and delete operations” under
/admin/config/services/jsonapi. JSON:API ships read-only by default; this is the most common blocker. - A dedicated Drupal user account for Semji, with the permissions listed in Permissions for the API account. A plain editor role is not enough — see that section for why.
- To let agents write meta descriptions: the Metatag module, plus a Meta tags field on each content type concerned. See Meta descriptions.
- If a firewall, WAF, or anti-bot protection (Cloudflare, Akamai, Sucuri, …) sits in front of your site, it must allow Semji’s IP addresses — see Firewalls and IP allowlisting.
- You are a workspace owner in Semji. The connection is shared with the whole workspace.
Step 1 — Prepare your Drupal site
Enable the required modules
Allow write operations
/admin/config/services/jsonapi) and select “Accept all JSON:API
create, read, update, and delete operations”.Create a dedicated role and user for Semji
semji-api) with a strong
password and assign it that role.Do not reuse a plain editor role: it lacks the permission Semji needs to
set the publication status, and every write fails with a 403.Add a Meta tags field, if you want meta descriptions
Permissions for the API account
Grant these to the role you created for Semji. Replacearticle with each
content type agents will work on.
About administer node fields
This one is optional but recommended. With it, Semji reads your content
types’ field definitions directly and knows exactly which field holds what.
Without it, Semji falls back to inspecting an existing piece of content to
infer the structure — which works, but is less precise and needs at least one
existing item per content type.
Drupal flags this permission as restricted, because the same permission also
allows adding and deleting fields through the admin UI. If your security
policy rules that out, leave it off: the integration works without it.
Meta descriptions
Drupal core has no meta description field. Semji writes meta descriptions through the Metatag contributed module, which most Drupal SEO setups already use.Install and enable Metatag
Add a Meta tags field to each content type
Step 2 — Connect from Semji
Open the CMS integrations
Enter your credentials
- Site URL — the canonical HTTPS base URL of your site, e.g.
https://your-site.com. Semji does not follow redirects, so use the exact URL your site resolves to (wwwvs non-wwwmatters). - Username — the Drupal login of the API account created in step 1.
- Password — that account’s password.
GET /jsonapi on your site and verifying that Drupal authenticates the
account.Pick the Drupal tools
- Read — browse, read, and inspect the site’s content and structure.
- Write — create and update content on the site.
- Delete — delete content from the site (destructive).
Activate
What Semji can do once connected
Content defaults
Out of the box, Semji targets thearticle content type with the
basic_html text format. On sites using Content Moderation, Semji
writes the published / draft moderation states instead of the raw status
field. Contact Semji support if your site needs different defaults (another
content type, text format, or custom moderation state names).
Manage or disconnect
From Settings → Integrations → CMS, the Drupal row offers:- Manage tools — enable or disable each tool group.
- Disconnect — remove the integration for the whole workspace.
Firewalls and IP allowlisting
Semji’s servers call your Drupal JSON:API directly. If your site sits behind Cloudflare or another WAF, you must allow those calls or the connection will fail. Semji’s servers reach the internet through a fixed set of outbound IP addresses. If a firewall, WAF, or anti-bot protection (Cloudflare, Akamai, Sucuri, …) sits in front of your site, it can block Semji’s requests — typically with a403 Forbidden — before they ever reach your CMS, even when your credentials are correct.
Allow the following Semji IP addresses:
/jsonapi/.
Troubleshooting
"Invalid Drupal credentials. Check the username and the password."
"Invalid Drupal credentials. Check the username and the password."
basic_auth module is not enabled (Drupal then treats
the request as anonymous), or a WAF is blocking the request with a 403
before it reaches Drupal."Could not connect to the Drupal site. Check the credentials, the site URL, and that the JSON:API and Basic Auth modules are enabled."
"Could not connect to the Drupal site. Check the credentials, the site URL, and that the JSON:API and Basic Auth modules are enabled."
- JSON:API module disabled —
/jsonapireturns 404. - The URL redirects. Semji follows no redirects: if
https://example.comredirects tohttps://www.example.com, enter thewwwURL. - The site is unreachable — DNS failure, host down, or the domain resolves to a private network address.
- A WAF challenge page — an HTML anti-bot response is not valid JSON:API and fails the connection.
- The site is too slow — responses must arrive within 10 seconds.
Publishing fails with a JSON:API read-only error
Publishing fails with a JSON:API read-only error
/admin/config/services/jsonapi.An agent reports a permission error
An agent reports a permission error
Every write fails, but the credentials and JSON:API settings are correct
Every write fails, but the credentials and JSON:API settings are correct
administer nodes. Drupal reserves
writing the status field to that permission, and Semji always states
the publication status explicitly, so an account without it fails on
every create and update — even though reading works fine and the
connection test passes. See
Permissions for the API account.The connection test fails while the site looks fine in a browser
The connection test fails while the site looks fine in a browser
503 on
/jsonapi for every account without the “Use the site in maintenance
mode” permission — which the API account normally does not have. You can
browse the site yourself because your admin session bypasses it. Turn
maintenance mode off under Configuration → Development → Maintenance
mode, or grant that permission to the Semji role.An agent says the meta description was not saved
An agent says the meta description was not saved
- No meta description field on this content type — install Metatag and add a Meta tags field, as described in Meta descriptions.
- Drupal accepted the write but stored nothing — Semji could not read
your field definitions and guessed the wrong format. Grant
administer node fieldsto the API account, or set that one meta description by hand.
URL validation errors before submitting
URL validation errors before submitting
- “Please enter a valid URL.” — the value does not parse as a URL.
- “The site URL must start with https://.” — HTTP sites cannot be connected.
- “The site URL points to a private or reserved address, which is not allowed.” — localhost and private-network hosts are rejected; the site must be publicly reachable.
Related
- Sync drafts to your CMS — API-based publishing flow, if you prefer to drive the sync yourself.