API Reference · Account

Set Environment

Switch live/test mode (web session)

POST/v1/me/environment
Account required

cURL example

cURL request
curl -X POST "https://api.verifiedinbox.ai/v1/me/environment" \
  -H "Authorization: Bearer vi_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "environment": "live"
  }'

Parameters

ParameterTypeDescription
VI-Environmentheader
string`live` (default) or `test`. Used for anonymous callers and OAuth access tokens; API keys and web sessions carry their own environment.

Request body

application/json · required
FieldTypeDescription
environmentrequired
string—

Allowed: live, test

Example request payload (EnvironmentRequest)
{
  "environment": "live"
}

Response

200 OKUpdated.
application/json
FieldTypeDescription
authenticatedrequired
boolean—
credentialrequired
string—

Allowed: anonymous, session, api_key, oauth

current_organization_idrequired
string (uuid) | null—
environmentrequired
string—

Allowed: live, test

guestrequired
object—
Nested fields (2)
  • active (boolean)
  • application_ids (string (uuid)[])
is_adminrequired
boolean—
organizationsrequired
object[]—
Nested fields (3)
  • id (string (uuid))
  • name (string)
  • role (string)
scopesrequired
string[]—

Allowed: applications:read, applications:write, billing:write, certificates:write, support:write

userrequired
object | null—
Nested fields (3)
  • email (string)
  • id (string (uuid))
  • name (string)
Example 200 response (Me)
{
  "authenticated": true,
  "credential": "anonymous",
  "current_organization_id": "0192a5e0-1234-7000-8000-000000000001",
  "environment": "live",
  "guest": {
    "active": true,
    "application_ids": []
  },
  "is_admin": true,
  "organizations": [
    {
      "id": "0192a5e0-1234-7000-8000-000000000001",
      "name": "Acme Inc.",
      "role": "owner"
    }
  ],
  "scopes": [
    "applications:read"
  ],
  "user": {
    "email": "alex@acme.com",
    "id": "0192a5e0-1234-7000-8000-000000000001",
    "name": "Acme Inc."
  }
}

Other responses & possible errors

Expand a status code below to see the error code, description, and example error payload.

400 (invalid_request)`invalid_request` — the request is malformed.

`invalid_request` — the request is malformed.

Example 400 error response
{
  "error": {
    "code": "invalid_request",
    "message": "Please provide a valid domain name."
  }
}
401 (unauthenticated)`unauthenticated` — sign in / send a valid credential. `next_action.kind = sign_in`.

`unauthenticated` — sign in / send a valid credential. `next_action.kind = sign_in`.

Example 401 error response
{
  "error": {
    "code": "unauthenticated",
    "message": "Sign in or provide an API key to continue.",
    "next_action": {
      "kind": "sign_in",
      "title": "Sign in or create an account",
      "url": "/login"
    }
  }
}
422 (unprocessable)`unprocessable` / `blocked_provider` — understood but can't be done (plain-English reason).

`unprocessable` / `blocked_provider` — understood but can't be done (plain-English reason).

Example 422 error response
{
  "error": {
    "code": "unprocessable",
    "message": "Shared mailbox providers like gmail.com cannot be verified."
  }
}
429 (rate_limited)`rate_limited` — retry after `Retry-After` seconds (`details.retry_after_seconds`). `limit_reached` — a quota is used up; `details.limit` names it and `next_action` offers support.

`rate_limited` — retry after `Retry-After` seconds (`details.retry_after_seconds`). `limit_reached` — a quota is used up; `details.limit` names it and `next_action` offers support.

Example 429 error response
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests. Please wait a moment and try again."
  }
}
Was it helpful?