The target here can be used to set a project pereference (global-level) or a (resource-level) preference.You can use this API to :
Allow recipient to update their project preference on the “Notification’s setting” screen.
Allow recipient to subscribe to something. Example, “Subscribe a channel on YouTube” via target like yt_channel:mr_beast:new_video with subscribed: true.
The medium this preference applies to. In-app and email are toggled independently for the same target. Defaults to in_app when omitted.
Available options:
in_app,
email
Response
200 - application/json
Updated subscription state for the target
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Bodhveda","colors":{"primary":"#5A86C3","light":"#7CA6D8","dark":"#3E5D94"},"logo":{"light":"https://mintcdn.com/mudgallabs/uB9oPsFjNmYjQlol/logo/logo.svg?fit=max\u0026auto=format\u0026n=uB9oPsFjNmYjQlol\u0026q=85\u0026s=007119f0163f4b2f5617af39d7ccc782","dark":"https://mintcdn.com/mudgallabs/uB9oPsFjNmYjQlol/logo/logo.svg?fit=max\u0026auto=format\u0026n=uB9oPsFjNmYjQlol\u0026q=85\u0026s=007119f0163f4b2f5617af39d7ccc782"},"favicon":"https://mintcdn.com/mudgallabs/uB9oPsFjNmYjQlol/favicon.ico?fit=max\u0026auto=format\u0026n=uB9oPsFjNmYjQlol\u0026q=85\u0026s=8797dee5c6d2cd0e45b262d0345d295a","navbar":{"links":[{"href":"mailto:hey@ceoshikhar.com","label":"Support"}],"primary":{"type":"button","label":"Console","href":"https://console.bodhveda.com"}},"footer":{"socials":{"discord":"https://discord.gg/Wg9ebJSAAG","github":"https://github.com/MudgalLabs/bodhveda","website":"https://ceoshikhar.com"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"mudgallabs","hasAudioNarration":false,"actualSubdomain":"mudgallabs","customDomains":["docs.bodhveda.com"],"gitSource":{"type":"github","owner":"mudgallabs","repo":"bodhveda","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a73b6373c1cab3bc3c3e3cb","collectionId":"71eee3ae-d08f-4eb0-9a8b-c469c4a80c9a","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6a73b6373c1cab3bc3c3e3cb"},"entitlements":{},"buildId":"6a73b6373c1cab3bc3c3e3cb:success","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"API Reference","count":27},{"language":"default","tag":"Documentation","count":18},{"language":"default","tag":"Recipients","count":17},{"language":"default","tag":"Notifications","count":6},{"language":"default","tag":"Project Preferences","count":6},{"language":"default","tag":"Concepts","count":6},{"language":"default","tag":"Contacts","count":5},{"language":"default","tag":"Preferences","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/endpoint/recipients/preferences/set-preference","slug":"/api-reference/endpoint/recipients/preferences/set-preference","pageMetadata":{"title":"Set preference","openapi":"PATCH /recipients/{recipient_id}/preferences","description":"Set a recipient's subscription state for a specific target.","href":"/api-reference/endpoint/recipients/preferences/set-preference"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Set a recipient’s subscription state for a specific target.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,ul:`ul`,..._provideComponents(),...props.components};return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`target`}),` here can be used to set a project pereference (global-level) or a (resource-level) preference.`]}),`\n`,_jsx(_components.p,{children:`You can use this API to :`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Allow recipient to update their project preference on the “Notification’s setting” screen.`}),`\n`,_jsxs(_components.li,{children:[`Allow recipient to subscribe to something. Example, “Subscribe a channel on YouTube” via `,_jsx(_components.code,{children:`target`}),` like `,_jsx(_components.code,{children:`yt_channel:mr_beast:new_video`}),` with `,_jsx(_components.code,{children:`subscribed: true`}),`.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Set preference","openapi":"PATCH /recipients/{recipient_id}/preferences","description":"Set a recipient's subscription state for a specific target.","href":"/api-reference/endpoint/recipients/preferences/set-preference"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Set recipient's subscription state for a target","operationId":"setRecipientPreference","tags":["Preferences"],"description":"Set a recipient's subscription state for a specific target.","parameters":["29a3e6ce-eed4-443a-a6c5-4483cab7cb50"],"requestBody":"afbc5538-fc2a-48b1-88e8-592b1c6c915e","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X PATCH https://api.bodhveda.com/recipients/recipient_123/preferences \\\n -H \"Authorization: Bearer bv_xxxxxxxxx\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"target\": {\n \"channel\": \"posts\",\n \"topic\": \"post_id_123\",\n \"event\": \"new_comment\"\n },\n \"medium\": \"email\",\n \"state\": {\n \"enabled\": false\n }\n }' "},{"lang":"javascript","label":"JavaScript","source":"import { Bodhveda } from \"@bodhveda/js\";\n\nconst bodhveda = new Bodhveda(\"bv_xxxxxxxxx\");\n\nconst pref = await bodhveda.recipients.preferences.set(\"recipient_123\", {\n target: { channel: \"posts\", topic: \"post_id_123\", event: \"new_comment\" },\n medium: \"email\",\n state: { enabled: false },\n});"},{"lang":"go","label":"Go","source":"import (\n \"context\"\n\n bodhveda \"github.com/MudgalLabs/bodhveda/sdk/go\"\n)\n\nctx := context.Background()\nclient := bodhveda.NewClient(\"bv_xxxxxxxxx\", nil)\n\nreq := \u0026bodhveda.SetPreferenceRequest{\n Target: bodhveda.Target{Channel: \"posts\", Topic: \"post_id_123\", Event: \"new_comment\"},\n Medium: bodhveda.MediumEmail,\n}\nreq.State.Enabled = false\npref, _ := client.Recipients.Preferences.Set(ctx, \"recipient_123\", req)"},{"lang":"jsx","label":"React","source":"import { useUpdatePreference } from \"@bodhveda/react\";\n\n// Requires a \u003cBodhvedaProvider recipientID=\"recipient_123\"> higher in the tree.\nfunction Toggle() {\n const { mutate } = useUpdatePreference();\n return (\n \u003cbutton\n onClick={() =>\n mutate({\n target: { channel: \"posts\", topic: \"post_id_123\", event: \"new_comment\" },\n medium: \"email\",\n state: { enabled: false },\n })\n }\n >\n Unsubscribe\n \u003c/button>\n );\n}"}],"responses":{"200":"34602197-1557-4cb2-8609-5344d9aae9c6"},"security":["b9a59f42-eaf9-442f-914a-241e3c612334"],"method":"patch","type":"path","servers":[],"path":"/recipients/{recipient_id}/preferences","baseUrlOptions":[],"title":"Set recipient's subscription state for a target","codeSamples":[{"label":"cURL","lang":"curl","source":"curl -X PATCH https://api.bodhveda.com/recipients/recipient_123/preferences \\\n -H \"Authorization: Bearer bv_xxxxxxxxx\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"target\": {\n \"channel\": \"posts\",\n \"topic\": \"post_id_123\",\n \"event\": \"new_comment\"\n },\n \"medium\": \"email\",\n \"state\": {\n \"enabled\": false\n }\n }' "},{"label":"JavaScript","lang":"javascript","source":"import { Bodhveda } from \"@bodhveda/js\";\n\nconst bodhveda = new Bodhveda(\"bv_xxxxxxxxx\");\n\nconst pref = await bodhveda.recipients.preferences.set(\"recipient_123\", {\n target: { channel: \"posts\", topic: \"post_id_123\", event: \"new_comment\" },\n medium: \"email\",\n state: { enabled: false },\n});"},{"label":"Go","lang":"go","source":"import (\n \"context\"\n\n bodhveda \"github.com/MudgalLabs/bodhveda/sdk/go\"\n)\n\nctx := context.Background()\nclient := bodhveda.NewClient(\"bv_xxxxxxxxx\", nil)\n\nreq := \u0026bodhveda.SetPreferenceRequest{\n Target: bodhveda.Target{Channel: \"posts\", Topic: \"post_id_123\", Event: \"new_comment\"},\n Medium: bodhveda.MediumEmail,\n}\nreq.State.Enabled = false\npref, _ := client.Recipients.Preferences.Set(ctx, \"recipient_123\", req)"},{"label":"React","lang":"jsx","source":"import { useUpdatePreference } from \"@bodhveda/react\";\n\n// Requires a \u003cBodhvedaProvider recipientID=\"recipient_123\"> higher in the tree.\nfunction Toggle() {\n const { mutate } = useUpdatePreference();\n return (\n \u003cbutton\n onClick={() =>\n mutate({\n target: { channel: \"posts\", topic: \"post_id_123\", event: \"new_comment\" },\n medium: \"email\",\n state: { enabled: false },\n })\n }\n >\n Unsubscribe\n \u003c/button>\n );\n}"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"29a3e6ce-eed4-443a-a6c5-4483cab7cb50":{"name":"recipient_id","in":"path","required":true,"schema":{"type":"string","isRequired":true,"description":"The unique identifier of the recipient.","uniqueKey":"","typeLabel":"string"},"description":"The unique identifier of the recipient."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"type":"object","description":"A **target** is the structure used to describe _who should get a notification_ and _how it should be categorized_.","properties":{"channel":{"type":"string","description":"Broad category for a notification (e.g., \"posts\").","isRequired":true,"uniqueKey":"target.channel","typeLabel":"string"},"topic":{"type":"string","description":"Subcategory inside the channel (e.g., \"post_id_123\"). \n- `any` and `none` have special meaning. \n- `any` means **all topics under this channel/event**. \n- `none` means **only the base channel/event**. \n- `any` is **not** a valid `topic` when sending a notification, but both are valid for preferences. \n\n A preference with the target `posts:any:new_comment` will match a notification with target `posts:post_id_123:new_comment` but a preference with the target `posts:none:new_comment` will **only** match a notification with target `posts:none:new_comment`.","isRequired":true,"uniqueKey":"target.topic","typeLabel":"string"},"event":{"type":"string","description":"Event that triggered this notification (e.g., \"new_comment\").","isRequired":true,"uniqueKey":"target.event","typeLabel":"string"}},"required":["channel","topic","event"],"isRequired":true,"uniqueKey":"target","typeLabel":"object"},"state":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the recipient is subscribed to this target for this medium.","isRequired":true,"uniqueKey":"state.enabled","typeLabel":"boolean"}},"required":["enabled"],"isRequired":true,"uniqueKey":"state","typeLabel":"object"},"medium":{"type":"string","description":"The medium this preference applies to. In-app and email are toggled independently for the same target. Defaults to `in_app` when omitted.","enum":["in_app","email"],"default":"in_app","uniqueKey":"medium","typeLabel":"enum\u003cstring>"}},"required":["target","state"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"target":{"channel":"\u003cstring>","topic":"\u003cstring>","event":"\u003cstring>"},"state":{"enabled":true},"medium":"in_app"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"34602197-1557-4cb2-8609-5344d9aae9c6":{"description":"Updated subscription state for the target","content":{"application/json":{"examples":{"Updated Target Subscription State":{"title":"Updated Target Subscription State","value":{"data":{"target":{"channel":"posts","topic":"post_id_123","event":"new_comment","medium":"email"},"state":{"enabled":false,"inherited":false}}}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"b9a59f42-eaf9-442f-914a-241e3c612334":{"BearerAuthWithAPIKeyWithEitherScope":{"type":"http","scheme":"bearer","bearerFormat":"APIKey","description":"Bearer authentication header of the form `Bearer bv_xxxxxxxxx`, where `bv_xxxxxxxxx` is your **API Key** with `Full access` or `Recipient acess` scope.","scopes":[]}}},"servers":{},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"APIKey","description":"Bearer authentication header of the form `Bearer bv_xxxxxxxxx`, where `bv_xxxxxxxxx` is your **API Key** with `Full access` or `Recipient acess` scope.","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer bv_xxxxxxxxx`, where `bv_xxxxxxxxx` is your **API Key** with `Full access` or `Recipient acess` scope.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuthWithAPIKeyWithEitherScope","name":"Authorization"}],"title":"BearerAuthWithAPIKeyWithEitherScope"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"mudgallabs","siteName":"Bodhveda","title":"Set preference - Bodhveda","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2025-08-12T18:43:11.617Z","originalFileLocation":"api-reference/endpoint/recipients/preferences/set-preference.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Set a recipient\u0026#x27;s subscription state for a specific target.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Bodhveda\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/mudgallabs/5v1jVLXdcr6kuLJI/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/mudgallabs/5v1jVLXdcr6kuLJI/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/mudgallabs/5v1jVLXdcr6kuLJI/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/mudgallabs/5v1jVLXdcr6kuLJI/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/mudgallabs/5v1jVLXdcr6kuLJI/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/mudgallabs/5v1jVLXdcr6kuLJI/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/mudgallabs/5v1jVLXdcr6kuLJI/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/mudgallabs/5v1jVLXdcr6kuLJI/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/mudgallabs/5v1jVLXdcr6kuLJI/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Set preference - Bodhveda\">\u003cmeta data-mint-head property=\"og:description\" content=\"Set a recipient\u0026#x27;s subscription state for a specific target.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Bodhveda\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.bodhveda.com/api-reference/endpoint/recipients/preferences/set-preference\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://mudgallabs.mintlify.app/_mintlify/api/og/v2?division=Preferences\u0026amp;title=Set+preference\u0026amp;description=Set+a+recipient%27s+subscription+state+for+a+specific+target.\u0026amp;theme=615ce636f5c179f532b0b0a2\u0026amp;signature=5f88871a7f2ef15a66b8e70ed93705df7b884c73caab53206bc8611b3521f53c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Set preference - Bodhveda\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Set a recipient\u0026#x27;s subscription state for a specific target.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://mudgallabs.mintlify.app/_mintlify/api/og/v2?division=Preferences\u0026amp;title=Set+preference\u0026amp;description=Set+a+recipient%27s+subscription+state+for+a+specific+target.\u0026amp;theme=615ce636f5c179f532b0b0a2\u0026amp;signature=5f88871a7f2ef15a66b8e70ed93705df7b884c73caab53206bc8611b3521f53c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/mudgallabs/5v1jVLXdcr6kuLJI/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Bodhveda\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5A86C3\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.bodhveda.com/api-reference/endpoint/recipients/preferences/set-preference\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/recipients/preferences/set-preference.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.bodhveda.com/#organization\",\"name\":\"Bodhveda\",\"url\":\"https://docs.bodhveda.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/mudgallabs/uB9oPsFjNmYjQlol/logo/logo.svg?fit=max\u0026auto=format\u0026n=uB9oPsFjNmYjQlol\u0026q=85\u0026s=007119f0163f4b2f5617af39d7ccc782\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.bodhveda.com#website\",\"name\":\"Bodhveda\",\"url\":\"https://docs.bodhveda.com\",\"publisher\":{\"@id\":\"https://docs.bodhveda.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.bodhveda.com/api-reference/endpoint/recipients/preferences/set-preference#webpage\",\"url\":\"https://docs.bodhveda.com/api-reference/endpoint/recipients/preferences/set-preference\",\"name\":\"Set preference\",\"description\":\"Set a recipient's subscription state for a specific target.\",\"dateModified\":\"2025-08-12T18:43:11.617Z\",\"isPartOf\":{\"@id\":\"https://docs.bodhveda.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.bodhveda.com/api-reference/endpoint/recipients/preferences/set-preference#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.bodhveda.com/api-reference/endpoint/recipients/preferences/set-preference#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Recipients\",\"item\":\"https://docs.bodhveda.com/api-reference/endpoint/recipients/create-recipient\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Preferences\",\"item\":\"https://docs.bodhveda.com/api-reference/endpoint/recipients/preferences/list-preferences\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Set preference\",\"item\":\"https://docs.bodhveda.com/api-reference/endpoint/recipients/preferences/set-preference\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.bodhveda.com/api-reference/endpoint/recipients/preferences/set-preference#apireference\",\"headline\":\"Set preference\",\"name\":\"Set preference\",\"description\":\"Set a recipient's subscription state for a specific target.\",\"url\":\"https://docs.bodhveda.com/api-reference/endpoint/recipients/preferences/set-preference\",\"mainEntityOfPage\":{\"@id\":\"https://docs.bodhveda.com/api-reference/endpoint/recipients/preferences/set-preference#webpage\"},\"dateModified\":\"2025-08-12T18:43:11.617Z\",\"publisher\":{\"@id\":\"https://docs.bodhveda.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.bodhveda.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Bodhveda\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Bodhveda","nav":{"global":{"anchors":[]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/docs/introduction"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"title":"Introduction","href":"/api-reference/introduction"}]},{"group":"Notifications","pages":[{"title":"Send notification","openapi":"POST /notifications/send","href":"/api-reference/endpoint/notifications/send-notification"},{"title":"Retrieve notification","openapi":"GET /notifications/{notification_id}","href":"/api-reference/endpoint/notifications/get-notification"}]},{"group":"Recipients","pages":[{"title":"Create recipient","openapi":"POST /recipients","href":"/api-reference/endpoint/recipients/create-recipient"},{"title":"Batch create recipients","openapi":"POST /recipients/batch","href":"/api-reference/endpoint/recipients/batch-create-recipients"},{"title":"Retrieve recipient","openapi":"GET /recipients/{recipient_id}","href":"/api-reference/endpoint/recipients/retrieve-recipient"},{"title":"Update recipient","openapi":"PATCH /recipients/{recipient_id}","href":"/api-reference/endpoint/recipients/update-recipient"},{"title":"Delete recipient","openapi":"DELETE /recipients/{recipient_id}","href":"/api-reference/endpoint/recipients/delete-recipient"},{"group":"Notifications","pages":[{"title":"List notifications","openapi":"GET /recipients/{recipient_id}/notifications","href":"/api-reference/endpoint/recipients/notifications/list-notifications"},{"title":"Unread count","openapi":"GET /recipients/{recipient_id}/notifications/unread-count","href":"/api-reference/endpoint/recipients/notifications/unread-count"},{"title":"Update notifications state","openapi":"PATCH /recipients/{recipient_id}/notifications","href":"/api-reference/endpoint/recipients/notifications/update-state"},{"title":"Delete notifications","openapi":"DELETE /recipients/{recipient_id}/notifications","href":"/api-reference/endpoint/recipients/notifications/delete"}]},{"group":"Preferences","pages":[{"title":"List preferences","openapi":"GET /recipients/{recipient_id}/preferences","description":"Every `(target, medium)` known for this recipient, each with the state a send would **actually** act on.\n\n`state.enabled` is the **resolved** decision — the same answer the delivery path computes — not a raw stored row. Resolution walks, in order:\n\n1. the recipient's rule for the exact target,\n2. the recipient's `topic: any` rule for the channel/event,\n3. the project's rule for the exact target,\n4. the project's `topic: any` rule,\n5. the medium's **default**.\n\n**The default is per medium:** `in_app` delivers, every other medium does not. A `topic: none` target never takes an `any` rule.\n\nThe response covers every target in the project catalog **plus** any target this recipient has a rule of their own for, across the active mediums (`in_app` and `email`). So a recipient can have an entry for a `(target, medium)` you never cataloged — if they have an explicit rule for it, it is live, and this reports it.\n\nEach `state` carries:\n\n- `enabled` — whether a send to this `(target, medium)` would deliver.\n- `inherited` — `true` when the recipient has no rule of their own for this exact `(target, medium)`; the value came from elsewhere in the cascade. `false` means they set it explicitly.\n- `cataloged` — whether a project-level rule exists for this exact `(target, medium)`. This is **context, not a gate**: an explicit recipient rule on an uncataloged pair still delivers, and `in_app` delivers by default with no catalog entry at all. Use it to decide what to render, never to predict delivery — `enabled` is the answer.","href":"/api-reference/endpoint/recipients/preferences/list-preferences"},{"title":"Set preference","openapi":"PATCH /recipients/{recipient_id}/preferences","href":"/api-reference/endpoint/recipients/preferences/set-preference"},{"title":"Check preference","openapi":"GET /recipients/{recipient_id}/preferences/check","description":"Resolve a single `(target, medium)` for a recipient: whether a send would **actually** deliver.\n\n`state.enabled` is the resolved decision, computed by the same cascade the delivery path uses — the recipient's exact rule → the recipient's `topic: any` rule → the project's exact rule → the project's `topic: any` rule → the medium's default (`in_app` delivers, every other medium does not). A `topic: none` target never takes an `any` rule.\n\nThe target does **not** need to be in your catalog; any `(channel, topic, event)` resolves. `state.cataloged` reports whether a project-level rule exists for this exact `(target, medium)` — context, not a gate.","href":"/api-reference/endpoint/recipients/preferences/check-preference"}]},{"group":"Contacts","pages":[{"title":"List contacts","openapi":"GET /recipients/{recipient_id}/contacts","href":"/api-reference/endpoint/recipients/contacts/list-contacts"},{"title":"Add contact","openapi":"POST /recipients/{recipient_id}/contacts","href":"/api-reference/endpoint/recipients/contacts/create-contact"},{"title":"Set the primary contact","openapi":"PUT /recipients/{recipient_id}/contacts","href":"/api-reference/endpoint/recipients/contacts/set-primary-contact"},{"title":"Update contact","openapi":"PATCH /recipients/{recipient_id}/contacts/{contact_id}","href":"/api-reference/endpoint/recipients/contacts/update-contact"},{"title":"Delete contact","openapi":"DELETE /recipients/{recipient_id}/contacts/{contact_id}","href":"/api-reference/endpoint/recipients/contacts/delete-contact"}]}]},{"group":"Project Preferences","pages":[{"title":"List the catalog","openapi":"GET /preferences","href":"/api-reference/endpoint/preferences/list-project-preferences"},{"title":"Create a catalog entry","openapi":"POST /preferences","href":"/api-reference/endpoint/preferences/create-project-preference"},{"title":"Set up the catalog (bulk)","openapi":"PUT /preferences","href":"/api-reference/endpoint/preferences/upsert-project-preferences"},{"title":"Get a catalog entry","openapi":"GET /preferences/{preference_id}","href":"/api-reference/endpoint/preferences/get-project-preference"},{"title":"Update a catalog entry","openapi":"PATCH /preferences/{preference_id}","href":"/api-reference/endpoint/preferences/update-project-preference"},{"title":"Delete a catalog entry","openapi":"DELETE /preferences/{preference_id}","href":"/api-reference/endpoint/preferences/delete-project-preference"}]}]}]},"title":"Set preference - Bodhveda","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DmVyH30O.js","utils-BHQqGGOd.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-CD-E4BIt.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Bp5Lq9Ds.js","snippetPresets-C4xAVCFP.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CgXVLxUC.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BF8I5oUf.js","shallow-Byd0lWnC.js","getApiPlaygroundDisplay-BGOZG1OK.js","CodeSnippet-CpvQL0CY.js","CodeSnippets-B8wkBKXa.js","Page-CBCH2P7b.js","getPastedJson-Ry3scI3Y.js","icon-D7a9HcdD.js","MethodPill-CJ8pmHhz.js","DuplicateIcon-rh1HJF0t.js","createIcon-DvGznqYs.js","DynamicMarkdown-Cc6AuSHS.js","SectionHeading-B4A0S-ep.js","axios-vUo_bRtp.js","Markdown-Cc16CX65.js","clsx-Cs6nMGht.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-zbf22OZA.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-C_fs-y5n.js"]}