Revoke sessions
- Sandbox: available
- Staging: available
- Production: unknown
Signs the caller out of one or more sessions. Use it for "sign out everywhere" and "sign out other devices" actions.
Auth: bearer token. Scope: the signed-in user's own sessions. A session ID that is not one of the caller's sessions revokes nothing.
Behaviour
optionin the path is one of:current: the session of the token you call with.other: every session except the current one.all: every session, including the current one.- a session ID (UUID) from
GET /auth/session: that one session.
- Ovok rejects the access tokens of the revoked sessions on their next request, and marks each Login as revoked in Medplum so the session cannot be renewed.
- Revoking
currentorallalso ends the token you called with. - The response echoes the revoked sessions with
revoked: true: one object forcurrentor a session ID, a list forotherandall. - To end only the token you hold, without the session, use
POST /v1/auth/logout.
Example
curl -X DELETE 'https://api.sandbox.ovok.com/auth/session/other' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'bearerAuthorizationBearer <JWT>option*|application/json- response
sessions*array<>curl -X DELETE 'https://api.sandbox.ovok.com/auth/session/current'{ "sessions": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "lastUpdated": "2019-08-24T14:15:22Z", "authMethod": "string", "remoteAddress": "string", "browser": "string", "os": "string" } ]}Get all sessions GET
Lists the caller's live sessions (one per sign-in). Use it to build a "where you are signed in" screen. **Auth:** bearer token. **Scope:** the signed-in user's own sessions. ## Behaviour - A session is listed when its Login belongs to the user, has a project membership and is not revoked. Sessions that have been idle for a long time are listed as long as they are not revoked. - The list is ordered newest first. - `browser` and `os` are `null` for sessions that Medplum does not report them for. - The call only reads. It does not change any session. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/auth/session' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```
Execute a bot POST
Runs a Medplum Bot of your project, found by its identifier, and returns its output. Use it to call custom server-side logic without knowing the Bot's id. **Auth:** bearer token. The Bot is searched and run with your token, so you need read access to the Bot and permission to execute it. ## Behaviour - `identifier` uses FHIR token search syntax: `system|value`, `system|`, or just `value`. Exactly one Bot must match. - The JSON request body is passed to the Bot as its input, unchanged. The body is optional. - The response is whatever the Bot returns. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/bots?identifier=https://example.com|get-users' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "parameter1": "value1" }' ```