mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-01 16:04:19 +00:00
2.0 KiB
2.0 KiB
stage, group, info
stage | group | info |
---|---|---|
Plan | Knowledge | To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments |
Markdown API
DETAILS: Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated
Convert Markdown content to HTML.
Available only in APIv4.
Required authentication
- Introduced in GitLab 15.3 with a flag named
authenticate_markdown_api
. Enabled by default.
FLAG:
On self-managed GitLab, by default this feature is enabled and authentication is required.
To remove the requirement to authenticate, an administrator can
disable the feature flag named authenticate_markdown_api
.
On GitLab.com, this feature is available. On GitLab Dedicated, this feature is available.
All API calls to the Markdown API must be authenticated.
Render an arbitrary Markdown document
POST /markdown
Attribute | Type | Required | Description |
---|---|---|---|
text |
string | yes | The Markdown text to render |
gfm |
boolean | no | Render text using GitLab Flavored Markdown. Default is false |
project |
string | no | Use project as a context when creating references using GitLab Flavored Markdown |
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-Type:application/json" \
--data '{"text":"Hello world! :tada:", "gfm":true, "project":"group_example/project_example"}' "https://gitlab.example.com/api/v4/markdown"
Response example:
{ "html": "<p dir=\"auto\">Hello world! <gl-emoji title=\"party popper\" data-name=\"tada\" data-unicode-version=\"6.0\">🎉</gl-emoji></p>" }