Page MenuHomeSealhub

endpoints.remarkup
No OneTemporary

endpoints.remarkup

Built-in endpoints

Sealious automatically creates endpoints for all the collections defined within
your app. All endpoins automatically take care of policy enforcement, so you
don't have to worry about implementing logic of who can do what. Just make sure
that the policies are set up properly for each collection and they will be
enforced.

NOTE: Some query params are expected to have complex, sometimes even nested structure. When the documentation refers to key/value-formatted query params, use [] syntax, so to send {filter: {name: "Reksio", age: 34}}, use filter[name]=Reksio&filter[age]=34. See the qs module for more details.

User/Session management

Register:

POST /api/v1/collections/registration-intents

params: email

Starts user registration flow. THe user needs to confirm the email first, and
then is redirected to a form that lets them choose their username.

Log in:

POST /api/v1/sessions/

params: username, password

Attempts to log the user in. If the login is successfull, a cookie with session
ID is set. Otherwise, an error message in JSON form is returned.

Why isn't it just POST /api/v1/login? It's simply to mainain the REST-ful
semantics. When you log in, you actually want to create (POST) a new session
(/api/v1/sessions).

Log out:

DELETE /api/v1/collections/sessions/current

Deletes the current session from DB. No params needed

Request a password reset:

POST /api/v1/collections/password-reset-intents

params: email

Begins the password reset flow. If the email exists in the database, a message
with reset link is sent to the user.

Static forms

There routes set up for some static forms, including:

  • GET /account-creation-details asks for user data when creating an account
  • POST /finalize-registration-intent finishes user creation. /account-creation-details contains a form that POSTs to this endpoint.
  • POST /finalize-password-reset
  • GET /confirm-password-reset

Collection endpoints

Each collection gets a full REST-ful API endpoint. These endpoints work for both the collections created by you, as well as for all built-in collections:

  • users
  • sessions
  • password-reset-intents
  • registration-intents
  • user-roles
  • formatted-images

List all elements within the collection

GET /api/v1/collections/:collection_name

Query Params:
  • filter - key/value. Maps field names to the desired values. Example: ?filter[name]=Hoover&filter[age][gt]=18
  • sort - key/value. Forces the output to be sorted by given field. Example: ?sort[favorite_number]=desc. Sort order is desc or asc
  • pagination -
  1. Examples

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 28, 15:04 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1083266
Default Alt Text
endpoints.remarkup (2 KB)

Event Timeline