Announcements
Super admin announcements: the scrolling bar and popup in the app, the public route superlabs.co reads for its own bar, and managing them.
Super admin announcements: the scrolling bar and popup in the app, the public route superlabs.co reads for its own bar, and managing them.
Generated from the OpenAPI spec by
npm run docs:api -w api. Do not edit this page — change the decorators inapps/api/src/and regenerate.
Conventions
- Auth — a session on every route: the cookie on web, the bearer token on mobile. See Authentication.
- Errors — every non-2xx response has the body described in Errors.
- Types — a
?after a field name means it is optional;| nullmeans it is present but may be null. - Guide — Announcements.
Endpoints
GET /api/v1/announcements/active — Announcements live for you right now
Those sent to everyone and those naming you, within their dates. Newest first. Which you have closed is kept by the client, not here.
Returns 200 → ActiveAnnouncementResponse[]
| Error | When |
|---|---|
401 | No valid session. Clear the stored token and sign in again. |
403 | Signed in, but not allowed to do this. |
GET /api/v1/public/announcements — Announcements live on the website
Public. Only those a super admin put on the website.
Returns 200 → ActiveAnnouncementResponse[]
GET /api/v1/admin/announcements — Every announcement
Super admins only. Live first, then scheduled, then ended.
Returns 200 → AdminAnnouncementResponse[]
| Error | When |
|---|---|
401 | No valid session. Clear the stored token and sign in again. |
403 | Signed in, but not allowed to do this. |
POST /api/v1/admin/announcements — Put up an announcement
Super admins only. Up to 200 characters, emoji welcome. It needs somebody to show to: the website, everyone, or named people.
Body — AnnouncementDto
Returns 201 → AdminAnnouncementResponse
| Error | When |
|---|---|
400 | The request was rejected. message is an array of field errors when validation failed. |
401 | No valid session. Clear the stored token and sign in again. |
403 | Signed in, but not allowed to do this. |
PUT /api/v1/admin/announcements/{announcementId} — Rewrite an announcement
Super admins only. Replaces every field. Anybody who closed it sees it again, since the words may have changed.
| Path parameter | Type | Notes |
|---|---|---|
announcementId | string |
Body — AnnouncementDto
Returns 200 → AdminAnnouncementResponse
| Error | When |
|---|---|
400 | The request was rejected. message is an array of field errors when validation failed. |
401 | No valid session. Clear the stored token and sign in again. |
403 | Signed in, but not allowed to do this. |
404 | No such announcement. |
DELETE /api/v1/admin/announcements/{announcementId} — Delete an announcement
Super admins only.
| Path parameter | Type | Notes |
|---|---|---|
announcementId | string |
Returns 204 → no body
| Error | When |
|---|---|
401 | No valid session. Clear the stored token and sign in again. |
403 | Signed in, but not allowed to do this. |
404 | No such announcement. |
POST /api/v1/admin/announcements/{announcementId}/end — Take an announcement down now
Super admins only. Sets its end to now and keeps it in the list.
| Path parameter | Type | Notes |
|---|---|---|
announcementId | string |
Returns 200 → AdminAnnouncementResponse
| Error | When |
|---|---|
401 | No valid session. Clear the stored token and sign in again. |
403 | Signed in, but not allowed to do this. |
404 | No such announcement. |
Data models
ActiveAnnouncementResponse
| Field | Type | Notes |
|---|---|---|
id | string | |
message | string | |
linkUrl | string | null | |
linkLabel | string | null | What the link reads, e.g. "Know more". Null when there is no link. |
display | bar | popup | both | |
endsAt | string ISO 8601 | null | |
updatedAt | string ISO 8601 | Key a dismissal on this along with id: an edit shows it again. |
AdminAnnouncementResponse
| Field | Type | Notes |
|---|---|---|
id | string | |
message | string | |
linkUrl | string | null | |
linkLabel | string | null | What the link reads, e.g. "Know more". Null when there is no link. |
display | bar | popup | both | |
endsAt | string ISO 8601 | null | |
updatedAt | string ISO 8601 | Key a dismissal on this along with id: an edit shows it again. |
onWebsite | boolean | |
toEveryone | boolean | |
important | boolean | Also sent as a notification when it goes live. |
notifiedAt | string ISO 8601 | null | When that notification went out; null until it has. |
recipients | MentionResponse[] | |
startsAt | string ISO 8601 | |
status | scheduled | live | ended | |
author | MentionResponse | null | |
createdAt | string ISO 8601 |
MentionResponse
| Field | Type | Notes |
|---|---|---|
id | string | |
name | string | |
image | string | null |
AnnouncementDto
| Field | Type | Notes |
|---|---|---|
message | string | The words, emoji welcome. Counted in characters as a person sees them, so an emoji is one. · ≤ 200 chars |
linkUrl? | string | null | Where "Know more" goes. Empty or null for no link. |
linkLabel? | string | null | What the link reads. Defaults to "Know more". · ≤ 40 chars |
display | bar | popup | both | |
onWebsite | boolean | Also on the public superlabs.co website. |
toEveryone | boolean | Every signed-in member. |
important? | boolean | Also send it as a notification — the bell and a push — to the people it is for, once, when it goes live. Website visitors are not notified. |
recipientIds | string[] | Particular people, on top of — or instead of — everyone. |
startsAt? | string | null | When it starts showing. Omitted: now on create, unchanged on edit. |
endsAt? | string | null | The "date till". Null runs until it is ended by hand. |