Reelspan publishes articles to your Dev.to account from Markdown. Dev.to takes text posts only: send them with Post text.
What you can post
| Post | How it appears |
|---|---|
| Text | An article: a title, a Markdown body, up to 4 tags and an optional canonical URL |
The title is devto_title, else the first line of the caption, up to 250 characters. The body is devto_description, else description, else the whole caption (its first line included).
The cleanest request sends the article's title as
titleand the Markdown body asdescription. If you senddevto_title, the caption becomes that title too, so the body must come fromdevto_descriptionordescription.
Videos and photos can't be sent: Dev.to's API takes no uploads, and the request is refused with UNSUPPORTED_POST_TYPE. To show an image, link one already online in the Markdown.
The result's url is the article on dev.to and post_id its id.
Connect your account
You need an API key. Setup takes about a minute.
- On dev.to, open Settings → Extensions and scroll to DEV Community API Keys.
- Describe it as Reelspan and click Generate API Key.
- In the Reelspan dashboard, open Accounts → Connect account, choose the profile and Dev.to, and paste the key.
Reelspan checks the key with Dev.to before saving it, encrypted.
With the API
curl -X POST https://api.reelspan.com/v1/accounts/devto \
-H "Authorization: Bearer $REELSPAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"profile_username": "my-brand", "api_key": "..."}'import { Reelspan } from 'reelspan';
const reelspan = new Reelspan();
await reelspan.accounts.connect('my-brand', 'devto', { api_key: process.env.DEVTO_API_KEY });import os
from reelspan import Reelspan
reelspan = Reelspan()
reelspan.accounts.connect("my-brand", "devto", api_key=os.environ["DEVTO_API_KEY"]){ "success": true, "platform": "devto", "account": "@yourname", "reconnected": false }| Field | Required | Also accepted (Upload-Post) |
|---|---|---|
api_key |
Yes | The same name |
Connecting again replaces the Dev.to account on that profile. See Connect with credentials.
Example post
An article with tags and a canonical URL:
curl -X POST https://api.reelspan.com/v1/posts/text \
-H "Authorization: Bearer $REELSPAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"user": "my-brand",
"platform": ["devto"],
"title": "How we cut our build time in half",
"description": "## The problem\n\nOur CI took 14 minutes...\n\n## What we changed\n\n...",
"devto_tags": "devops, ci, webdev",
"devto_canonical_url": "https://example.com/blog/faster-builds"
}'import { Reelspan } from 'reelspan';
import { readFile } from 'node:fs/promises';
const reelspan = new Reelspan();
const post = await reelspan.posts.text({
user: 'my-brand',
platforms: ['devto'],
title: 'How we cut our build time in half',
description: await readFile('faster-builds.md', 'utf8'),
extra: { devto_tags: 'devops, ci, webdev', devto_canonical_url: 'https://example.com/blog/faster-builds' },
});from pathlib import Path
from reelspan import Reelspan
reelspan = Reelspan()
post = reelspan.posts.text(
"my-brand", ["devto"], "How we cut our build time in half",
description=Path("faster-builds.md").read_text(),
extra={"devto_tags": "devops, ci, webdev", "devto_canonical_url": "https://example.com/blog/faster-builds"},
)Fields
| Field | Meaning |
|---|---|
devto_title |
The article's title. Falls back to the caption's first line. |
devto_description |
The article's Markdown body. Falls back to description. |
description |
The body, when devto_description isn't sent. |
title |
The caption: its first line is the title and the whole of it the body, when the fields above aren't sent. |
devto_tags |
Tags, separated by commas. Each is lowercased and keeps only letters, digits and -. The first 4 are used. |
devto_canonical_url |
Where the article was first published, for search engines. |
devto_published |
false saves the article as a draft on Dev.to. Default: published. |
In the dashboard composer, the Dev.to tab has Tags, Canonical URL and Save as a draft.
Limits and behaviour
- Tags: 4 per article. With more, the first 4 are used and the result carries a warning.
- Title: up to 250 characters; longer is cut.
- Drafts: a draft answers with a warning, "Saved as a draft on Dev.to".
- No first comment: a
first_commentisn't posted; the result says"first_comment": "unsupported"with a warning. - Analytics: reactions, comments and, when Dev.to returns them, page views per article. See Analytics.
Common errors
| Code | When | Fix |
|---|---|---|
INVALID_TOKEN |
Connecting: Dev.to didn't accept the key | Generate a new key under Settings → Extensions. |
UNSUPPORTED_POST_TYPE |
The request is a video or photo post | Send articles with POST /v1/posts/text. |
title_required |
The title came out empty | Send a title (or devto_title) with text on its first line. |
reauth_required |
Dev.to answered 401: the key was revoked | Generate a new key and connect again. |
devto_error |
Dev.to refused the article. Retried automatically on 429 and 5xx | Read error for Dev.to's reason. |
MISSING_FIELD |
Connecting without api_key |
Send it. |
Errors when connecting come back as a 400 with the code in error_code. UNSUPPORTED_POST_TYPE refuses the whole request with a 400. Errors when posting are in that network's result. See Errors.