Back to Help

API examples

April 15, 2026

Copy-paste curl recipes for the most common OmniCon API flows — login, list channels, create an article, upload an image, send a press release.


Working curl recipes for the common flows. Every example below assumes $TOKEN is a valid JWT and $CHANNEL_ID is a channel you have access to.

Log in and stash a token

TOKEN=$(curl -s https://api.omnicon.cloud/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"you@example.com","password":"***"}' \
  | jq -r .token)

See Authentication for how tokens work.

List the channels you can see

curl -s https://api.omnicon.cloud/api/channel/channels \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"organizationId":"$ORG_ID","keyword":"","sort":"","currentPage":1,"itemsPerPage":50}'

Create a draft article

curl -s https://api.omnicon.cloud/api/articles/article/create \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "partitionKey": "'$CHANNEL_ID'",
    "channelId":    "'$CHANNEL_ID'",
    "title":        "Hello from the API",
    "permaName":    "hello-from-the-api",
    "text":         "<p>First paragraph.</p>",
    "culture":      "en",
    "isHtml":       true,
    "isArticle":    true,
    "isSearchable": true,
    "publishSince": "2026-04-15T00:00:00Z",
    "publishUntil": "9999-12-31T00:00:00Z"
  }'

See Permalinks for permalink rules and Publish windows for scheduling.

Search articles with filters

curl -s https://api.omnicon.cloud/api/articles/articles \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "channelId":     "'$CHANNEL_ID'",
    "culture":       "en",
    "keyword":       "launch",
    "tag":           "release-notes",
    "folderName":    "",
    "sort":          "publishdate_desc",
    "currentPage":   1,
    "itemsPerPage":  25
  }'

The response includes facets — the same tag and folder counts that power the public sidebar.

Upload an image (multipart)

curl -s https://api.omnicon.cloud/api/media/upload-image \
  -H "Authorization: Bearer $TOKEN" \
  -F "containerName=$CHANNEL_ID" \
  -F "file=@./hero.jpg"

The response contains originalUrl and thumbnailUrl; use the original in the article body and the thumbnail as mainImageUrl. See Uploading files for other upload modes.

Direct-to-storage upload (pre-signed URL)

For large files, skip streaming through the API and upload straight to storage:

# 1. Ask the API for a pre-signed URL
curl -s "https://api.omnicon.cloud/api/media/upload-url?containerName=$CHANNEL_ID&fileName=video.mp4&contentType=video/mp4" \
  -H "Authorization: Bearer $TOKEN"

# 2. PUT the bytes to the returned uploadUrl
curl -X PUT --data-binary @./video.mp4 \
  -H "Content-Type: video/mp4" \
  "$UPLOAD_URL"

The URL is valid for 30 minutes.

Send a press release

curl -s https://api.omnicon.cloud/api/press/send \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "channelId":      "'$CHANNEL_ID'",
    "articleRowKey":  "'$ARTICLE_ID'",
    "subject":        "Acme ships v2.0",
    "customMessage":  "Hi — wanted to share this ahead of general availability.",
    "contactIds":     ["contact-1","contact-2"]
  }'

See Sending a press release for the full flow and Distribution history for reading back what you sent.

Export a book to Word

curl -s https://api.omnicon.cloud/api/books/$BOOK_ID/export \
  -H "Authorization: Bearer $TOKEN" \
  -o book.docx

Things that trip people up

  • Channel scope. Almost every request takes a channelId. A 404 or 403 usually means the channel is right but your token's user lacks access.
  • POST vs. GET. Several list endpoints use POST with a JSON body instead of query strings because the filter shape is rich. The Swagger UI makes this obvious.
  • HTML encoding. Article bodies are raw HTML — send <p>, not &lt;p&gt;. Most HTTP clients don't encode for you.
  • Publish windows. Articles outside their publishSince/publishUntil window are invisible on public pages even though they show up in the dashboard.

For the full endpoint list see Endpoints, or the live Swagger at https://api.omnicon.cloud/.

api examples curl recipes