Topolo Docs Topolo Platform
Open workspace

Set invoice email sender

Create or update the invoice sending profile for this Books workspace on a verified organization domain. Requires organization email-management permission as well as Books settings permission.

Outcome

Create or update the invoice sending profile for this Books workspace on a verified organization domain. Requires organization email-management permission as well as Books settings permission.

Before you start

  • Verify the intended environment, authenticated identity and specifically approved organization context.
  • The published application permission is settings:write. Discover the exact granted canonical Books workspace and bind it separately from action input.
  • Approve the actual mutation, accounting inputs and any provider/recipient effects before CLI --confirm or MCP confirm:true. Fixture identifiers and simulated provider responses authorize no live operation.

Discover the target

topolo whoami --json
topolo actions get app_topolo_books.settings.invoice_email.update --detail --json
topolo resources topolo-books --json
topolo workspaces list topolo-books --json
  • Set BOOKS_WORKSPACE_ID to the exact granted workspace returned by discovery.
  • connectionId: Exact connection id from the provider/settings discovery specified by this action; identifiers from different integrations are not interchangeable.

Request

PUT /api/settings/invoice-email

Inspect and test this action. Save the reviewed input as payload.json; supply credential/resource context separately.

Input fields

FieldRequiredMeaningSchema and constraints
connectionIdRequiredExact connection id from the provider/settings discovery specified by this action; identifiers from different integrations are not interchangeable.{"type":"string","minLength":1}
fromNameRequiredfrom Name{"type":"string","minLength":1,"maxLength":120}
fromEmailRequiredfrom Email{"type":"string","format":"email","pattern":"^(?!\.)(?!.\.\.)([A-Za-z0-9_'+\-\.])[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$"}
replyToRequiredreply To{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\.)(?!.\.\.)([A-Za-z0-9_'+\-\.])[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$"},{"type":"null"}]}

Inspect nested fields and the complete input schema.

Effects

  • Writes a Nexus sender profile scoped to this Books app and workspace; other app and workspace profiles are unchanged.

Interpret the response

Read $.workspaceId for the returned workspace identifier. Empty collections and nullable fields do not discover a target.

Call app_topolo_books.settings.invoice_email.get and confirm the exact From and Reply-To.

Inspect the success schema. CLI/MCP add their own transport envelope; CLI --detail requests the full result.

Worked examples

Actual Books route handlers and the exported Worker were exercised against five local SQLite D1 concern databases with all committed migrations, the real posting Durable Object and local R2. Route captures use synthetic verified Auth; Worker captures use synthetic Auth transports. Nexus, Brand, Notify, Pay, Mercury and Xero responses are explicitly simulated at the provider transport boundary. Captures prove local request/response behavior and canonical SDK projection, not live bank access, payment movement, email delivery, provider eligibility, tax compliance, encrypted custody, scheduled execution, deployment or production completion. Fixture identities, credentials, addresses and records authorize no live operation.

Run a reviewed request

Save the input from the selected worked example as payload.json. Validate and inspect the plan before calling the action; refused examples demonstrate errors and are not instructions to execute.

CLI:

topolo actions validate app_topolo_books.settings.invoice_email.update --data @payload.json --json
topolo actions plan app_topolo_books.settings.invoice_email.update --resource-type workspace --resource-id "$BOOKS_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_books.settings.invoice_email.update --resource-type workspace --resource-id "$BOOKS_WORKSPACE_ID" --data @payload.json --confirm --detail --json

MCP tool and arguments for the first successful example:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_books.settings.invoice_email.update",
    "input": {
      "connectionId": "fixture-domain",
      "fromName": "Fixture Accounts",
      "fromEmail": "accounts@example.com",
      "replyTo": null
    },
    "resourceType": "workspace",
    "resourceId": "<exact granted workspace id>",
    "confirm": true,
    "detail": true
  }
}

Refused response · invoice_email_domain_unverified

Input · payload.json:

{
  "connectionId": "fixture-domain",
  "fromName": "Fixture Accounts",
  "fromEmail": "accounts@example.com",
  "replyTo": null
}

Captured response · HTTP 409

{
  "error": "invoice_email_domain_unverified",
  "message": "Choose an active, verified sending domain"
}

HTTP 409. SDK error code invoice_email_domain_unverified. Read the active Nexus-backed sender domains, publish the actual requested DNS records and verify the intended domain before selecting it. The local DNS fixture does not establish live verification.

Refused response · invoice_email_request_failed

Input · payload.json:

{
  "connectionId": "fixture-domain",
  "fromName": "Fixture Accounts",
  "fromEmail": "accounts@example.com",
  "replyTo": null
}

Captured response · HTTP 403

{
  "error": "invoice_email_request_failed",
  "message": "Fixture Nexus email-management refusal"
}

HTTP 403. SDK error code invoice_email_request_failed. Nexus separately authorizes the unchanged caller token. Obtain the required organization email-management authorization; Books settings permission alone does not grant it. Preserve the request id and current profile state.

Successful response · HTTP 200

Input · payload.json:

{
  "connectionId": "fixture-domain",
  "fromName": "Fixture Accounts",
  "fromEmail": "accounts@example.com",
  "replyTo": null
}

Captured response · HTTP 200

{
  "workspaceId": "ws_documentation-email_muvnprk21",
  "sender": {
    "from": "Fixture Accounts <accounts@example.com>",
    "replyTo": null,
    "source": "workspace",
    "profileId": "fixture-profile"
  },
  "domains": [
    {
      "id": "fixture-domain",
      "sending_domain": "example.com",
      "is_active": true,
      "sendable": true,
      "verification_status": "verified",
      "verification_error": null,
      "dns_records": []
    }
  ],
  "workspaceSender": {
    "profile_name": "Books invoices · ws_documentation-email_muvnprk21",
    "from_name": "Fixture Accounts",
    "from_email": "accounts@example.com",
    "reply_to_email": null,
    "app_id": "app_topolo_books",
    "resource_type": "workspace",
    "resource_id": "ws_documentation-email_muvnprk21",
    "is_default": false,
    "connection_id": "fixture-domain",
    "id": "fixture-profile",
    "is_active": 1
  }
}

HTTP 200. Call app_topolo_books.settings.invoice_email.get and confirm the exact From and Reply-To.

Refused response · auth_error

Input · payload.json:

{
  "connectionId": "emailconn_example",
  "fromName": "Example Accounts",
  "fromEmail": "accounts@example.com",
  "replyTo": "accounts@example.com"
}

Captured response · HTTP 401

{
  "error": "API key validation failed"
}

HTTP 401. SDK error code auth_error. Authenticate in the intended organization again. Verify whoami and the exact Books application/workspace binding before retrying; do not switch identity to work around a refusal.

Verify the result

  • Call app_topolo_books.settings.invoice_email.get and confirm the exact From and Reply-To.

Errors and recovery

  • invoice_email_domain_unverified (HTTP 409): Read the active Nexus-backed sender domains, publish the actual requested DNS records and verify the intended domain before selecting it. The local DNS fixture does not establish live verification.
  • invoice_email_request_failed (HTTP 403): Nexus separately authorizes the unchanged caller token. Obtain the required organization email-management authorization; Books settings permission alone does not grant it. Preserve the request id and current profile state.
  • auth_error (HTTP 401): Authenticate in the intended organization again. Verify whoami and the exact Books application/workspace binding before retrying; do not switch identity to work around a refusal.

These are observed local refusals. Shared authentication, schema validation and resource authorization can also refuse before the route. Preserve the actual error, details and request id.

Recovery boundary

Remove the workspace sender, or update it again with the previous settings.

  • Get workspace settings: Read the workspace accounting, invoice identity and invoice approval-automation settings.
  • Remove workspace invoice sender: Deactivate only this Books workspace sender profiles and resume inherited organization or platform sender resolution.

Evidence

Actual Books route handlers and the exported Worker were exercised against five local SQLite D1 concern databases with all committed migrations, the real posting Durable Object and local R2. Route captures use synthetic verified Auth; Worker captures use synthetic Auth transports. Nexus, Brand, Notify, Pay, Mercury and Xero responses are explicitly simulated at the provider transport boundary. Captures prove local request/response behavior and canonical SDK projection, not live bank access, payment movement, email delivery, provider eligibility, tax compliance, encrypted custody, scheduled execution, deployment or production completion. Fixture identities, credentials, addresses and records authorize no live operation.