Add a favorite
PUT/api/user/favorites
putUserFavorite
Adds a repository, team, or issue/ticket to the authenticated user's favorites and returns it. Idempotent: favoriting a target twice returns the existing favorite. The caller must be able to read the target; a target that does not exist and one the caller cannot read are the same 404.
Requires authentication using a bearer token or a session cookie — see tokens and scopes.
curl
curl -X PUT 'https://neosource.dev/api/user/favorites' \
-H 'Authorization: Bearer $NEOSOURCE_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"target":"string"}'fetch
fetch("https://neosource.dev/api/user/favorites", {
method: "PUT",
headers: {
Authorization: "Bearer $NEOSOURCE_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({"target":"string"}),
});Request bodyrequired
application/json
Responses
200The favorite
application/json
403Forbidden — one of: forbidden, needs_scope
application/json
Standard errors
Bodies documented once for the whole API — see standard errors.
- 400Bad Request — one of: invalid_input
- 401Authentication required
- 404Not Found — one of: not_found
- 429Rate limited — retry after the `Retry-After` header
- 500Internal server error
- 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
- 504Gateway timeout — the request exceeded the server's handling budget
Schemas
Referenced above. Listed here rather than expanded inline, so the same definition is not repeated at every level.
FavoriteKind
The closed set of things a favorite can point at. The wire form of a favorite's target kind; [`FavoriteTarget`] carries the typed id.
"repo""team""issue"
IssueStatus
"backlog""todo""in_progress""in_review""done""cancelled""duplicate"