List notifications - Spacefast Docs
List notifications
Returns the notifications addressed to the signed-in user, newest first. Page with cursor. Set unread to return only the ones with no readAt. Only a dashboard session can call this.
GET /v1/notifications
Authorization
Authorization Bearer token · header required
Authorization: Bearer <token> with an API key (sfa_ prefix), an OAuth access token, a session token, or a Space machine credential (sfm_ prefix).
Query parameters
limitinteger required
min 1 · max 100 · default: 20cursorstring
min length 1 · max length 4096unreadboolean required
default: false
Responses
200 Response for status 200
$schema string
Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.
data object[] required
Array of object
idstring required
min length 1kindstring required
Allowed:comment.createdcomment.repliedthread.archivedthread.unarchivedmentionteamIdstring | any required
Team owning the Space this came from. Null when that Space has no team.spaceIdstring | any required
Space this came from. Null once that Space is gone.threadIdstring | any required
Comment thread this points at.titlestring required
One line naming what happened, ready to render.bodystring | any required
Text of the comment behind it. Null when the event carried none.actorobject required
The person who acted. Every field is null when the commenter left no profile, as an anonymous one can.namestring | any requiredavatarUrlstring | any requiredcolorstring | any required
pathstring | any required
Path inside the Space the thread is anchored to.versionIdstring | any required
Version the thread was opened against.linkstring | any required
Dashboard URL for the thread. Null when the Space has no team to address it under.readAtstring| any required
ISO 8601 timestamp when the notification was marked read. Null while it is unread.createdAtstringrequired
ISO 8601 timestamp when the notification was raised.
pagination object required
nextCursorstring | any required
Cursor for the next page. Null on the last page.hasMoreboolean required
True when another page exists.
Error Response
$schema string
Canonical JSON Schema URL for this response body.
typestring requiredtitlestring required
Human-readable name of the error type. Derived fromcode.statusinteger required
HTTP status of the response, repeated in the body.detailstring requiredcodestring requiredpointerstring
RFC 6901 JSON Pointer to the request field or batch entry that failed, for example/files/37/path. Present on validation failures.detailsobject
Machine-readable context keyed by the error code.suggestionsstring[]
Recovery steps safe to show to a person.nextstring[]
Commands or API requests to run next, usable as written.requestIdstring required
ID of this request, from theX-Request-Idheader or generated. Quote it when contacting support.
Try it
Server
Base URL https://api.spacefast.com
Authorization
Bearer token
Parameters
limitquery *cursorqueryunreadquery *
Request Examples
cURL
curl -X GET "https://api.spacefast.com/v1/notifications?limit=20&unread=false" \
-H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://api.spacefast.com/v1/notifications?limit=20&unread=false", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});
Python
import requests
response = requests.get(
"https://api.spacefast.com/v1/notifications?limit=20&unread=false",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)
Response 200 default
{
"$schema": "http://example.com",
"data": [
{
"id": "string",
"kind": "comment.created",
"teamId": "string",
"spaceId": "string",
"threadId": "string",
"title": "string",
"body": "string",
"actor": {
"name": "string",
"avatarUrl": "string",
"color": "string"
},
"path": "string",
"versionId": "string",
"link": "string",
"readAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z"
}
],
"pagination": {
"nextCursor": "string",
"hasMore": true
}
}
Error Response Schema
{
"$schema": "http://example.com",
"type": "string",
"title": "string",
"status": -9007199254740991,
"detail": "string",
"code": "string",
"pointer": "string",
"details": {
"property1": null,
"property2": null
},
"suggestions": [
"string"
],
"next": [
"string"
],
"requestId": "string"
}