VoidhashDocs
DevelopersHelp centerGuidesAPI reference
Dashboard
Essentials
API overview
Authentication
Event capture
Push device API
Webhooks
Webhook delivery
Webhook events
Projects & keys
Projects
API keys
Audit log
Customers & access
Persons
Products
Perks
Sandbox
Paywalls
Paywalls
Paywall locations
Components
Component registry
Assets
Experiments & flags
Experiments
Feature flags
Analytics & events
Analytics
Analytics alerts
Events
Ingest policy
VoidQL
Tracking domains
Ads
Ads
Ad accounts
Meta measurement
Payments & stores
Payment providers
Payment provider products
Purchase history imports
Payment sources
Webhooks & notifications
Webhooks
Push notifications
Push configurations
Automations
Organization & team
Organizations
Members
Invitations
Billing
Your account
Profile
Session
Notices
Connected apps
Terms of Service
Developer tools
Schema
SDK
Retrieve Meta measurement settings
Update Meta measurement settings

Update Meta measurement settings

Changes the fields it names; null removes one.

Secrets are stored encrypted and never returned. Conversions go only for people whose $ad_data_sharing trait is true, and turning them on sends only purchases made from then on. Needs project:ads:manage.

Guide: Share purchases with Meta

Errors

StatustypecodeWhen
400invalid_requestconversions_not_configuredTo turn conversions on without both a dataset and a token.
400invalid_requestinvalid_install_referrer_keyFor a malformed value, with param naming the field.
400invalid_requestinvalid_dataset_idFor a malformed value, with param naming the field.
400invalid_requestinvalid_conversions_tokenFor a malformed value, with param naming the field.
400invalid_requestinvalid_test_event_codeFor a malformed value, with param naming the field.

It can also fail with the errors every operation shares, such as unauthenticated; see Errors.

More in Meta measurement

  • Retrieve Meta measurement settings GET

Something wrong or missing on this page? Tell us by email or on Discord.

PreviousRetrieve Meta measurement settingsNextList payment providers

On this page

AuthorizationPath parametersRequest bodyExamplesResponse bodyErrorsMore in Meta measurement
PATCH
/api/v1/projects/{projectId}/ads/meta-measurement/settings

Authorization

AuthorizationBearer <token>

A project secret key: vh_sk_... for production, vh_sk_test_... for test. Keep it on your servers.

In: header

Path parameters

projectId*string

The project's id, proj_.... A secret key works only in the project it belongs to.

Request body

application/json

TypeScript definitions

Use the request body type in TypeScript.

installReferrerKey?||

The install referrer decryption key Meta shows for the app, 64 hexadecimal characters; null removes it. Write-only.

isConversionsEnabled?|

Whether to send purchases to Meta's Conversions API. Turning it on needs a dataset and a token, and sends only purchases made from then on.

conversionsDatasetId?||

The dataset (pixel) id from Meta's Events Manager, digits only; null removes it, which is refused while conversions are on.

conversionsToken?||

An access token for the dataset, from Meta's Events Manager, at most 4096 characters; null removes it, which is refused while conversions are on. Write-only.

conversionsTestEventCode?||

The code from Meta's Test Events tab, such as TEST12345: letters, digits, _ and -, at most 64; null removes it and Meta counts the events again.

Examples

curl -X PATCH "https://api.voidhash.com/api/v1/projects/proj_tz4a98xxat96iws9zmbrgj3a/ads/meta-measurement/settings" \  -H "Authorization: Bearer vh_sk_..." \  -H "Content-Type: application/json" \  -d '{    "isConversionsEnabled": true,    "conversionsDatasetId": "1234567890123456",    "conversionsToken": "EAAB..."  }'
{  "projectId": "proj_tz4a98xxat96iws9zmbrgj3a",  "hasInstallReferrerKey": true,  "installReferrerLastError": null,  "installReferrerLastErrorAt": null,  "isConversionsEnabled": true,  "conversionsDatasetId": "1234567890123456",  "hasConversionsToken": true,  "conversionsTestEventCode": null,  "conversionsLastSentAt": null,  "conversionsLastRunAt": "2026-03-02T10:00:00.000Z",  "conversionsLastError": null,  "conversionsLastErrorAt": null,  "conversionsLastErrorKind": null,  "conversionsSkippedTotal": 0,  "conversionsRefusedInARow": 0,  "conversionsWithheld": {    "noAdDataSharing": 0,    "noMatchKey": 0,    "personGone": 0,    "reversed": 0  }}

{  "error": {    "type": "invalid_request",    "code": "conversions_not_configured",    "message": "Conversions need an access token to be on.",    "param": "conversionsToken"  }}

{  "error": {    "type": "unauthenticated",    "code": "invalid_api_key",    "message": "This secret key is not valid."  }}
{  "error": {    "type": "permission_denied",    "code": "permission_denied",    "message": "Insufficient permissions."  }}
{  "error": {    "type": "not_found",    "code": "project_not_found",    "message": "There is no project proj_tz4a98xxat96iws9zmbrgj3a, or this credential cannot use it.",    "param": "projectId"  }}
{  "error": {    "type": "internal",    "code": "internal_error",    "message": "Something went wrong on our side. Try again, and contact support with the Request-Id header if it keeps failing."  }}

Response body

application/json

application/json

application/json

application/json

application/json

application/json