{"schema_version":"1.0","publisher":"Primitive SDKs","canonical_url":"https://test.abhinandan.one/node-sdk-api-client/node-sdk-account-resource","markdown_url":"https://test.abhinandan.one/node-sdk-api-client/node-sdk-account-resource.md","article":{"id":"ca96bcff-5fd7-43cf-b137-efbece0a8cbe","article_slug":"node-sdk-account-resource","parent_article_slug":"node-sdk-api-client","parent_article_title":"Generated API Client and Primitive Memories","kind":"guide","published_at":"2026-08-11T18:54:50.245531+00:00","keywords":["client.account","AccountResource","InboxResource","client.inbox","rotate webhook secret","PrimitiveApiClient account"],"meta_description":"client.account (AccountResource) reads and updates org account details and storage stats, and rotates the webhook secret; client.inbox reports inbox readiness.","og_image_url":null,"source_file_paths":["sdk-node/src/api/index.ts"],"recording_id":null,"replayable":false,"task_name":"Agent Accounts and Account Management API","category":"Node.js SDK","summary":null,"description":"Use client.account and client.inbox to read and update org-level account settings, storage stats, and the webhook secret, and to check inbox readiness, the account-management surface beyond client.agent's create/upgrade lifecycle.","content_kind":"repo_page","content_markdown":"Use the generated account operations to read your org's account record and fetch the webhook signing secret, alongside the `client.agent` lifecycle. Reach for this page when you need account-level data that the high-level `send`/`reply`/`forward` client doesn't expose.\n\nThe account operations are part of the [generated API client](python-generated-api-client), the OpenAPI-codegenerated surface exported from `@primitivedotdev/sdk/api`. Creating a zero-touch account and upgrading it is covered separately in [Agent Accounts](node-sdk-agent-accounts).\n\n## Fetch account details\n\nCall the generated `getAccount` operation with a `PrimitiveApiClient`, the host-aware authenticated request client, to read your org's account record.\n\n```typescript\nimport { PrimitiveApiClient, getAccount } from \"@primitivedotdev/sdk/api\";\n\nconst api = new PrimitiveApiClient({ apiKey: process.env.PRIMITIVE_API_KEY });\nconst result = await getAccount({ client: api.client });\n\nconsole.log(result.data);\n```\n\nEvery operation returns the server's `{ success, data }` envelope. On a non-2xx response the generated client surfaces the error rather than throwing a plain `Error`; see [Node.js SDK Errors](node-sdk-errors) for the `PrimitiveApiError` shape and how to read `code`, `status`, and `requestId`.\n\n<Tip>\n\nUse `createPrimitiveClient({ apiKey })` from `@primitivedotdev/sdk/api` instead when you also want the higher-level helpers on the same client, such as [Primitive Memories](node-sdk-api-client) under `client.memories`.\n\n</Tip>\n\n## Fetch the webhook signing secret\n\nThe secret used to verify the `Primitive-Signature` header comes from `GET /account/webhook-secret`, and it is a UTF-8 string you use as-is.\n\n```typescript\nimport { PrimitiveApiClient } from \"@primitivedotdev/sdk/api\";\n\nconst api = new PrimitiveApiClient({ apiKey: process.env.PRIMITIVE_API_KEY });\nconst response = await api.request(\"GET\", \"/account/webhook-secret\");\n\nconsole.log(response);\n```\n\n<Warning>\n\nThe secret's output looks base64-shaped (for example `XNHBBW8VqoBjRfNs1tkZj11jTk...`) but it is not base64. Use it verbatim as a UTF-8 string for the HMAC key; base64-decoding it first silently produces mismatched signatures.\n\n</Warning>\n\nOnce you have the secret, [Webhook Signature Verification](node-sdk-webhook-signing) covers how it verifies the `Primitive-Signature: t=<unix-seconds>,v1=<hex>` header, including the 300-second replay tolerance.\n\n## Check inbox readiness\n\nInbox readiness reports whether inbound mail can actually reach your webhook endpoint, which is worth checking right after account creation or a DNS change.\n\nThe CLI exposes this directly:\n\n```bash\nprimitive inbox-status\n```\n\nSee [Inbox Setup and Status](cli-inbox) for the fields it reports (receiving readiness, processing readiness, domains, endpoints). Domain and route configuration itself is a platform concept covered in [Primitive Functions and Recipient Routing](functions-and-routing-concepts); readiness reporting only tells you the current state, it does not configure anything.\n\n## Next steps\n\n<CardGroup cols={2}>\n\n<Card title=\"Agent Accounts\" href=\"node-sdk-agent-accounts\">\n\nCreate a zero-touch agent account and upgrade it through the email-claim flow.\n\n</Card>\n\n<Card title=\"Webhook Signature Verification\" href=\"node-sdk-webhook-signing\">\n\nVerify the Primitive-Signature header with the secret you just fetched.\n\n</Card>\n\n<Card title=\"Generated API Client and Primitive Memories\" href=\"node-sdk-api-client\">\n\nCall any Primitive HTTP endpoint directly, and store durable JSON with client.memories.\n\n</Card>\n\n<Card title=\"Node.js SDK Errors\" href=\"node-sdk-errors\">\n\nLook up PrimitiveApiError codes and what triggers each one.\n\n</Card>\n\n</CardGroup>","canonical_base_url":"https://test.abhinandan.one","seo_indexing_enabled":true,"last_modified":"2026-08-21T18:22:43.359885+00:00","video_url":null,"voiceover_url":null,"tools_used":[],"demonstrated_by":[],"steps":[],"related_links":[],"intro":null,"prerequisites":[],"verification":[],"troubleshooting":[],"suggest_edit_url":"https://github.com/abhi-browzer/primitive-sdks/edit/main/sdk-node/src/api/index.ts","raise_issue_url":"https://github.com/abhi-browzer/primitive-sdks/issues/new?title=Docs+feedback%3A+Agent+Accounts+and+Account+Management+API&body=Page%3A+https%3A%2F%2Ftest.abhinandan.one%2Fnode-sdk-account-resource","page_feedback_enabled":true,"verified_ref":null,"verified_at":"2026-08-11T18:38:45.205849+00:00"}}