Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: NextGen Catalog Announcements API
version: 0.2.0
description: This is the NextGen Catalog API application made with Express and documented with Swagger.
servers:
- url: https://catalog.archives.gov/api/v2/
tags:
- name: Announcements
description: For important announcements
paths:
/announcements/latest:
get:
summary: Get a list of active announcements
description: Retrieve a paginated list of announcements.
tags:
- Announcements
responses:
'200':
description: A list of announcements.
content:
application/json:
schema:
type: object
properties:
announcements:
type: array
items:
$ref: '#/components/schemas/Announcement'
operationId: getAnnouncementsLatest
x-operation-id-source: derived
/announcements:
get:
summary: Get a list of announcements
description: Retrieve a paginated list of announcements.
tags:
- Announcements
parameters:
- in: query
name: page
schema:
type: integer
default: 1
description: The page number of announcements to retrieve.
- in: query
name: limit
schema:
type: integer
default: 10
description: The number of announcements to display per page.
- in: query
name: status
schema:
type: string
enum:
- ACTIVE
- DRAFT
- INACTIVE
description: The status of the announcements to filter by.
- in: query
name: sortCol
schema:
type: string
enum:
- status
- created_at
- updated_at
- user_name
description: The column to sort the announcements by.
- in: query
name: sortOrder
schema:
type: string
enum:
- asc
- desc
default: desc
description: The order of sorting (ascending or descending).
responses:
'200':
description: A list of announcements.
content:
application/json:
schema:
type: object
properties:
metadata:
type: object
properties:
totalCount:
type: integer
description: The total number of announcements.
activeCount:
type: integer
description: The number of active announcements.
draftCount:
type: integer
description: The number of draft announcements.
inactiveCount:
type: integer
description: The number of inactive announcements.
announcements:
type: array
items:
$ref: '#/components/schemas/Announcement'
operationId: getAnnouncements
x-operation-id-source: derived
post:
summary: Create a new announcement
description: Allows a moderator to create a new announcement. The announcement is initially created with a status of 'DRAFT'.
tags:
- Announcements
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- announcement_text
properties:
announcement_text:
type: string
description: The content of the announcement.
notes:
type: string
description: Optional notes about the announcement.
user_id:
type: integer
description: The ID of the user who is creating the announcement.
responses:
'201':
description: Announcement created successfully. The response includes the created announcement details.
content:
application/json:
schema:
type: object
properties:
announcement_id:
type: integer
description: The unique identifier of the announcement.
created_at:
type: string
format: date-time
description: The timestamp when the announcement was created.
announcement_text:
type: string
description: The content of the announcement.
notes:
type: string
description: Optional notes about the announcement.
user_id:
type: string
description: The ID of the user who created the announcement.
status:
type: string
description: The status of the announcement.
'400':
description: Validation error. This can occur if the request body does not match the expected format.
'500':
description: Internal server error.
security:
- ApiKeyAuth: []
operationId: postAnnouncements
x-operation-id-source: derived
/announcements/{announcement_id}:
put:
summary: Update an existing announcement
description: Allows a moderator to update an existing announcement.
tags:
- Announcements
parameters:
- in: path
name: announcement_id
required: true
schema:
type: integer
description: The unique identifier of the announcement to update.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
announcement_text:
type: string
description: Updated content of the announcement.
status:
type: string
enum:
- DRAFT
- ACTIVE
- INACTIVE
description: Updated status of the announcement.
user_id:
type: string
format: uuid
description: The ID of the user who is updating the announcement.
notes:
type: string
description: Optional notes about the announcement.
responses:
'200':
description: Announcement updated successfully. Returns the updated announcement object.
content:
application/json:
schema:
type: object
properties:
announcement_id:
type: integer
description: The unique identifier of the announcement.
announcement_text:
type: string
description: Content of the announcement.
status:
type: string
description: Current status of the announcement.
user_id:
type: string
format: uuid
description: The ID of the user who updated the announcement.
user_name:
type: string
description: The name of the user who updated the announcement.
notes:
type: string
description: Optional notes about the announcement.
created_at:
type: string
format: date-time
description: Timestamp when the announcement was created.
updated_at:
type: string
format: date-time
description: Timestamp when the announcement was last updated.
'400':
description: Validation error.
'404':
description: Announcement not found.
'500':
description: Internal server error.
security:
- ApiKeyAuth: []
operationId: putAnnouncementsByAnnouncementId
x-operation-id-source: derived