Title: Backend SDK: ExternalAccount.id returns identification ID (idn_), unusable with deleteUserExternalAccount · Issue #7936 · clerk/javascript · GitHub
Open Graph Title: Backend SDK: ExternalAccount.id returns identification ID (idn_), unusable with deleteUserExternalAccount · Issue #7936 · clerk/javascript
X Title: Backend SDK: ExternalAccount.id returns identification ID (idn_), unusable with deleteUserExternalAccount · Issue #7936 · clerk/javascript
Description: Preliminary Checks I have reviewed the documentation: https://clerk.com/docs I have searched for existing issues: https://github.com/clerk/javascript/issues I have not already reached out to Clerk support via email or Discord (if you hav...
Open Graph Description: Preliminary Checks I have reviewed the documentation: https://clerk.com/docs I have searched for existing issues: https://github.com/clerk/javascript/issues I have not already reached out to Clerk ...
X Description: Preliminary Checks I have reviewed the documentation: https://clerk.com/docs I have searched for existing issues: https://github.com/clerk/javascript/issues I have not already reached out to Clerk ...
Opengraph URL: https://github.com/clerk/javascript/issues/7936
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Backend SDK: ExternalAccount.id returns identification ID (idn_), unusable with deleteUserExternalAccount","articleBody":"### Preliminary Checks\n\n- [x] I have reviewed the documentation: https://clerk.com/docs\n\n- [x] I have searched for existing issues: https://github.com/clerk/javascript/issues\n\n- [x] I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)\n\n- [x] This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.\n\n\n### Reproduction\n\nNo external reproduction needed — reproducible with any Clerk Backend SDK project. See description for steps.\n\n### Publishable key\n\npk_test_ZGlzdGluY3QtcGlnLTgyLmNsZXJrLmFjY291bnRzLmRldiQ\n\n### Description\n\n## Bug Description\n\nThe `@clerk/backend` SDK's `ExternalAccount.fromJSON()` maps `data.id` (which is an identification ID with `idn_` prefix) to `this.id`, but completely ignores the `external_account_id` field from the raw API response (which has an `eac_` prefix). This means `deleteUserExternalAccount()` always fails with a 404 because it receives an `idn_` ID instead of the `eac_` ID it expects.\n\n## Steps to reproduce\n\n1. Have a user who signed up via Google OAuth\n2. Call `clerk.users.getUser(userId)` via the Backend SDK (`@clerk/backend`)\n3. Log `user.externalAccounts[0].id` — it returns an `idn_` prefixed ID (e.g., `idn_3ABXLLckIF5kLikvzAVRxuuN31M`)\n4. Attempt to delete: `clerk.users.deleteUserExternalAccount({ userId, externalAccountId: user.externalAccounts[0].id })`\n5. Clerk returns **404**: `external_account_not_found` / \"The External Account was not found.\"\n\n## Root Cause\n\nThe raw JSON response from `GET /v1/users/{userId}` includes both fields on each external account object:\n\n```json\n{\n \"id\": \"idn_3ABXLLckIF5kLikvzAVRxuuN31M\",\n \"external_account_id\": \"eac_3ABXLObDmeHsnLsLgOd5panvOPJ\",\n \"identification_id\": \"idn_3ABXLLckIF5kLikvzAVRxuuN31M\",\n \"provider\": \"oauth_google\",\n ...\n}\n```\n\nThe SDK's `ExternalAccount.fromJSON()` ([source](https://github.com/clerk/javascript/blob/main/packages/backend/src/api/resources/ExternalAccount.ts)) maps:\n- `data.id` → `this.id` (gets `idn_` value)\n- `data.identification_id` → `this.identificationId` (also `idn_`)\n- **`data.external_account_id` is never mapped**\n\nMeanwhile, `deleteUserExternalAccount()` builds the path as `/users/{userId}/external_accounts/{externalAccountId}` and expects the `eac_` prefixed ID.\n\n## Expected behavior\n\n`ExternalAccount.id` should return the external account resource ID (`eac_` prefix), or the class should expose `externalAccountId` as a separate property, so that `deleteUserExternalAccount()` works with the ID from `getUser()`.\n\n## Actual behavior\n\n`ExternalAccount.id` returns the identification ID (`idn_` prefix), which causes `deleteUserExternalAccount()` to fail with 404.\n\n## Workaround\n\nMake a raw `fetch` to `GET /v1/users/{userId}` and use the `external_account_id` field from the JSON response:\n\n```typescript\nconst rawResponse = await fetch(`https://api.clerk.com/v1/users/${userId}`, {\n headers: { Authorization: `Bearer ${secretKey}` },\n})\nconst rawUser = await rawResponse.json()\nconst eacId = rawUser.external_accounts[0].external_account_id // \"eac_xxx\"\nawait clerk.users.deleteUserExternalAccount({ userId, externalAccountId: eacId }) // works\n```\n\n### Environment\n\n```Shell\nSystem:\n OS: macOS Darwin 25.2.0\n Node: v24.12.0\n\nnpmPackages:\n @clerk/backend: 2.5.0\n```","author":{"url":"https://github.com/nspady","@type":"Person","name":"nspady"},"datePublished":"2026-02-26T01:09:10Z","url":"https://github.com/clerk/javascript/issues/7936"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c2394c59-e7f4-6d83-2b9d-85b2960795d3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9CB2:3491F9:12EC6B8:19E6AA0:6AFB6DAD |
| html-safe-nonce | f15ff8a7a6ae4c45f4eb04a40a1625c21febe55382eb4eb0d99872e37dce3b0d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0IyOjM0OTFGOToxMkVDNkI4OjE5RTZBQTA6NkFGQjZEQUQiLCJ2aXNpdG9yX2lkIjoiNzg4NzQ4Mjk4MTYxMzAwNjI1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2d5258b8c8dd87d83a83ac20eb1f00268423dc95f7f254cabbda7eeb8cc80dc8 |
| hovercard-subject-tag | issue:3992662663 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/clerk/javascript/7936/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3215803af586e700f9b21f8cd928daf9fd53c5a1fa85e0a09a15b5a4583c6a9b/clerk/javascript/issues/7936 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3215803af586e700f9b21f8cd928daf9fd53c5a1fa85e0a09a15b5a4583c6a9b/clerk/javascript/issues/7936 |
| og:image:alt | Preliminary Checks I have reviewed the documentation: https://clerk.com/docs I have searched for existing issues: https://github.com/clerk/javascript/issues I have not already reached out to Clerk ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nspady |
| hostname | github.com |
| expected-hostname | github.com |
| None | cca289ecd54650fcf3c0b037a58b97186dee2cc4406819d87fab93728fd83700 |
| turbo-cache-control | no-preview |
| go-import | github.com/clerk/javascript git https://github.com/clerk/javascript.git |
| octolytics-dimension-user_id | 49538330 |
| octolytics-dimension-user_login | clerk |
| octolytics-dimension-repository_id | 438331492 |
| octolytics-dimension-repository_nwo | clerk/javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 438331492 |
| octolytics-dimension-repository_network_root_nwo | clerk/javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 88808b1fae5ab8a526a73e7ce5542a10eb9d6971 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width