REST API overview

API · v1.4.0

Me

5 endpoints. Paths are relative to /api/v1 on your own instance; authentication is described on the overview page.

GET /me

Responses

  • 200
  • 401 Unauthenticated

PUT /me/password

Change the password

Needs the current password. The browser that makes the change stays signed in; every other session and remember cookie of the user ends, and all of the user's API tokens are revoked, as with a password reset: whoever knew the old password may hold any of them. API tokens get a 403.

Request body

NameTypeDescription
current_passwordrequiredstring
passwordrequiredstring

The new password: at least 10 characters, as for a password reset, and not the current one.

password_confirmationrequiredstring

Responses

  • 204 No content
  • 422 Validation error
  • 401 Unauthenticated

GET /me/sessions

List my sessions

The sessions of the signed-in user that have not expired, the current one first. id is an opaque handle, never the session cookie value. Without the database session driver only the current session is listed. API tokens get a 403.

Responses

  • 200
  • 401 Unauthenticated

POST /me/sessions/sign-out-others

Sign out all other sessions

Needs the current password. Ends every session and remember cookie of the user except the one making the request. API tokens are not revoked, and cannot call this endpoint (403).

Request body

NameType
passwordrequiredstring

Responses

  • 204 No content
  • 422 Validation error
  • 401 Unauthenticated

DELETE /me/sessions/{id}

Sign out one session

Ends one of the user's other sessions, by the id the list returned; a raw session id is never accepted. Unlike signing out all other sessions it needs no password: it can only end the user's own sessions and is easy to undo by signing in again, so a prompt would be friction without much gain. It has its own limiter (session-sign-out, 10 a minute per user) instead of sharing the password-guessing budget. Because the remember token is per user, every other browser's remember cookie stops working too; the other sessions themselves keep working, and this browser gets a fresh remember cookie if it had one.

The current session is refused with a 422 on id: sign out instead. An id that matches none of the user's unexpired stored sessions is a 404, whoever else it may belong to. Without the database session driver no other session is stored, so every other id is a 404. API tokens get a 403.

Parameters

NameInTypeDescription
idrequiredpathstring

The session's id from the list: 32 lowercase hex characters.

Responses

  • 204 No content
  • 404 Not found
  • 422 Validation error
  • 401 Unauthenticated