Skip to content
Orvanov0.2.0

users.block

POST
/v1/users/{userId}/block
import { Client, Orvano } from '@orvano/js/server'
const orvano = new Orvano(
new Client({ endpoint: 'https://orvano.example.com', apiKey: process.env.ORVANO_API_KEY }),
)
const user = await orvano.users.block('<userId>')
console.log(user)

Blocks a user: ends every session and refuses sign in. Blocking a blocked user changes nothing.

Server SDKs: JavaScript on a server, Dart, and .NET call it with an API key. API key scope: users.write. A failure answers with a problem details body; its code has a page under Errors.

userId
required
string

The user ID.

The request has succeeded.

Media typeapplication/json

A user of a project.

object
id
required

The user ID.

string
email
required
Any of:
string
emailVerified
required

Whether the email has been verified. Also the access token’s email_verified claim.

boolean
emailVerifiedAt
required
Any of:
string format: date-time
name
required
Any of:
string
status
required

Whether the user may sign in.

string
Allowed values: active blocked
metadata
required

Your own data about the user: a JSON object of at most 16 KB.

object
createdAt
required

When the user signed up.

string format: date-time
lastSignInAt
required
Any of:
string format: date-time
Example
{
"id": "01924f5e-8d2b-7c4d-8e21-3d5e6f7a8b9c",
"email": "ada@example.com",
"emailVerified": false,
"name": "Ada Lovelace",
"status": "active"
}

An unexpected error response.

Media typeapplication/problem+json

An RFC 9457 problem details body. Every operation declares it as its default response, sent as application/problem+json.

object
type
required

Identifies the error: https://orvano.dev/errors/<code>.

string
title
required

The standard HTTP reason phrase for the status.

string
status
required

The HTTP status code.

integer format: int32
detail

A short, safe sentence about this occurrence, when the server has one.

string
code
required

Orvano’s stable error code, from the ErrorCode catalog. SDKs treat it as a plain string.

string
requestId
required

The request ID to quote when reporting a problem; also sent as X-Request-Id.

string
Example
{
"type": "https://orvano.dev/errors/not_found",
"title": "Not Found",
"status": 404,
"code": "not_found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}