pages

Create a new custom page. Requires site administrative privileges, or organization admin privileges for the specified organization_id (when the organization pages feature is enabled). Successful writes log api_page_create with the actor and target ids in the admin API audit log.

    ### Body Parameter Guidelines:
    - **title**: Heading displayed at the top of the page.
    - **slug**: URL path identifier. Must be unique and URL-safe. For organization pages, scoped under `{org_slug}/{suffix}` (with the first page defaulting to `{org_slug}/readme`).
    - **body_markdown**: Content written in Markdown format.
    - **body_json**: Optional JSON payload for API-consumed/structured data pages.
    - **is_top_level_path**: Set to `true` to serve the page directly at the root (e.g. `/{slug}`) instead of under the default namespace `/page/{slug}`. Use with caution to avoid namespace collisions with core Forem paths.
    - **template**: Layout styling options (`contained` or custom layouts). Organization pages always use `full_within_layout`.
    - **organization_id**: Optional ID of the organization this page belongs to.
    - **position**: Optional display order position for organization pages.
post/api/pages

Request

  • Base URL
    https://dev.to
  • Auth
    • API key in header api-key
    • or HTTP bearer

Request body

titlestring

Title of the page

slugstring

Used to link to this page in URLs, must be unique and URL-safe

descriptionstring

For internal use, helps similar pages from one another

body_markdownstring

The text (in markdown) of the page (required)

body_jsonstring

For JSON pages, the JSON body

is_top_level_pathboolean

If true, the page is available at '/{slug}' instead of '/page/{slug}', use with caution

organization_idinteger

The ID of the organization the page belongs to

positioninteger

Display order position for organization pages

template'contained' | 'full_within_layout' | 'nav_bar_included' | 'json' | 'css' | 'txt'

Controls what kind of layout the page is rendered in

Response

successful

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property

    • breaking

      removed the media type application/json for the response with the status

    • breaking

      removed the media type application/json for the response with the status

    • breaking

      removed the media type application/json for the response with the status