Upsert per-space SMTP configuration

Creates or replaces the SMTP configuration for a space. The pass field is encrypted at rest and never returned in any response. Requires space-settings:write in THIS space (preset admin) — a caller who is not in the space gets 403 not_a_space_member, or 404 when the space is private.

PUT/api/spaces/{id}/smtp-config

Authorization

better-auth.session_token<token>

Cookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.

In: cookie

Path Parameters

id*string

Request Body

application/json

curl -X PUT "https://your-instance/api/spaces/string/smtp-config" \  -H "Content-Type: application/json" \  -d '{    "host": "string",    "port": 1,    "username": "string",    "pass": "string",    "from_address": "[email protected]"  }'
{
  "spaceId": "string",
  "host": "string",
  "port": 1,
  "username": "string",
  "from_address": "[email protected]",
  "from_name": "string",
  "secure_mode": "auto",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}

{
  "type": "https://docs.appstrate.dev/errors/validation-failed",
  "title": "Validation Failed",
  "status": 400,
  "detail": "name: Invalid input: expected string, received undefined (+2 more)",
  "code": "validation_failed",
  "request_id": "req_abc123",
  "errors": [
    {
      "field": "name",
      "code": "required",
      "message": "Invalid input: expected string, received undefined"
    },
    {
      "field": "email",
      "code": "invalid_format",
      "message": "Invalid email address"
    },
    {
      "field": "age",
      "code": "invalid_type",
      "message": "Invalid input: expected number, received string"
    }
  ]
}

{
  "type": "https://docs.appstrate.dev/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Insufficient permissions",
  "code": "forbidden",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/not-found",
  "title": "Not Found",
  "status": 404,
  "detail": "Resource not found",
  "code": "not_found",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/rate-limited",
  "title": "Rate Limited",
  "status": 429,
  "detail": "Too many requests. Please try again shortly.",
  "code": "rate_limited",
  "request_id": "req_abc123",
  "retry_after": 30
}