Create News API

Publish news articles and announcements to users by role

Content

Create News API

Publish news articles and announcements to your users. Target specific user roles and optionally send email notifications for important updates.

Publish News

Create announcements and updates.

Role Targeting

Show to specific user groups.

Email Notify

Send email notifications.


Endpoint Overview

MUTATION/graphql

Create a new news article or announcement. Optionally target specific user roles and send email notifications.

Authentication:Bearer Token
Required scopes:admin

Request Parameters

news.titleString!Required

The title/headline of the news article.

news.descriptionString!Required

The content/body of the news article.

news.notifyByEmailBoolean

Whether to send email notifications to targeted users.

news.roles[Int]

Array of role IDs to target. If empty, visible to all.


GraphQL Mutation

mutation createNews($news: NewsEdit!) {
  createNews(news: $news) {
    id
    title
    description
    notifyByEmail
    createdAt
    updatedAt
  }
}

Variables:

{
  "news": {
    "title": "Scheduled Maintenance - January 20th",
    "description": "We will be performing scheduled maintenance on January 20th from 2:00 AM to 4:00 AM UTC. Some services may be temporarily unavailable during this time.",
    "notifyByEmail": true,
    "roles": [1, 2, 3]
  }
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -d '{
    "query": "mutation createNews($news: NewsEdit!) { createNews(news: $news) { id title createdAt } }",
    "variables": {
      "news": {
        "title": "Scheduled Maintenance",
        "description": "Maintenance on January 20th...",
        "notifyByEmail": true
      }
    }
  }'

Response

200News Created Successfully
{
  "data": {
    "createNews": {
      "id": "news_456",
      "title": "Scheduled Maintenance - January 20th",
      "description": "We will be performing scheduled maintenance...",
      "notifyByEmail": true,
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-15T10:30:00Z"
    }
  }
}
400Invalid Role
{
  "errors": [
    {
      "message": "Invalid role ID: 999",
      "path": ["createNews"],
      "extensions": {
        "code": "INVALID_ROLE"
      }
    }
  ],
  "data": null
}

News Types

Announcements

General platform announcements.

Maintenance

Scheduled downtime notices.

Features

New feature announcements.

Security

Security updates and advisories.


Best Practices

Clear Titles

Use descriptive, actionable headlines.

Concise Content

Keep announcements brief and clear.

Target Appropriately

Only notify relevant user groups.

Email Sparingly

Reserve email for important news.



Email Notifications

When notifyByEmail is enabled, emails are sent asynchronously. Large user bases may take time to fully deliver.

View Published News

See all published news articles and their engagement.

View News