Edit News API

Update existing news articles and announcements

Content

Edit News API

Update existing news articles and announcements. Modify content, change targeted roles, or update notification settings.

Update Content

Modify news articles.

Change Targeting

Update role visibility.

Corrections

Fix errors and typos.


Endpoint Overview

MUTATION/graphql

Update an existing news article by ID. Only provided fields will be updated.

Authentication:Bearer Token
Required scopes:admin

Request Parameters

idInt!Required

The unique identifier of the news article to update.

news.titleString

Updated title for the article.

news.descriptionString

Updated content for the article.

news.notifyByEmailBoolean

Whether to resend email notifications.

news.roles[Int]

Updated list of targeted role IDs.


GraphQL Mutation

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

Variables:

{
  "id": 456,
  "news": {
    "title": "Updated: Scheduled Maintenance - January 20th",
    "description": "UPDATED: Maintenance has been rescheduled to January 21st from 2:00 AM to 4:00 AM UTC due to scheduling conflicts."
  }
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -d '{
    "query": "mutation editNews($id: Int!, $news: NewsEdit!) { editNews(id: $id, news: $news) { id title updatedAt } }",
    "variables": {
      "id": 456,
      "news": {
        "title": "Updated: Scheduled Maintenance"
      }
    }
  }'

Response

200News Updated Successfully
{
  "data": {
    "editNews": {
      "id": "456",
      "title": "Updated: Scheduled Maintenance - January 20th",
      "description": "UPDATED: Maintenance has been rescheduled...",
      "notifyByEmail": true,
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-16T09:00:00Z"
    }
  }
}
400News Not Found
{
  "errors": [
    {
      "message": "News article with ID 456 not found",
      "path": ["editNews"],
      "extensions": {
        "code": "NOT_FOUND"
      }
    }
  ],
  "data": null
}

Common Updates

Content Corrections

Fix typos and factual errors.

Date Changes

Update event dates and times.

Expand Audience

Add more roles to see the news.

Add Details

Include additional information.


Best Practices

Mark Updates

Clearly indicate content was updated.

Avoid Re-notify

Don't resend emails for minor edits.

Preserve History

Keep record of original content.

Timely Updates

Update quickly when information changes.



Partial Updates

Only include fields you want to change. Omitted fields retain their current values.

View Current News

Review existing news articles before making updates.

View News