Turn on managing an ad account's ads

Turns on creating and changing the account's ads through Voidhash, with the daily budget limit every budget set through it is held within, once the platform confirms that the account's token may manage ads.

Turning it on again sets the limit. Only a person can, in Studio: the limit is there to catch a script's or an agent's mistake. Needs project:ads:manage.

Guide: Connect Meta Ads

POST
/api/v1/projects/{projectId}/ads/accounts/{adAccountId}/activate-management

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.

adAccountId*string

The connected ad account's id in Voidhash, ad_acct_....

Request body

application/json

TypeScript definitions

Use the request body type in TypeScript.

dailyBudgetLimit*integer

The most any one daily budget may be set to through Voidhash, a positive whole number of minor units of the account's currency.

Range-9007199254740991 <= value <= 9007199254740991

Examples

curl -X POST "https://api.voidhash.com/api/v1/projects/proj_tz4a98xxat96iws9zmbrgj3a/ads/accounts/ad_acct_k3m9x2c7v1b8n4q6w0e5r2t7/activate-management" \  -H "Authorization: Bearer vh_sk_..." \  -H "Content-Type: application/json" \  -d '{    "dailyBudgetLimit": 50000  }'
{  "adAccountId": "ad_acct_k3m9x2c7v1b8n4q6w0e5r2t7",  "isEnabled": true,  "enabledAt": "2026-03-02T09:00:00.000Z",  "currency": "USD",  "pageId": "104857600000001",  "instagramAccountId": "17841400000000001",  "datasetId": "1234567890123456",  "urlParameters": "utm_source=facebook&utm_medium=paid_social&utm_campaign={{campaign.name}}&utm_term={{adset.name}}&utm_content={{ad.name}}&campaign_id={{campaign.id}}&adset_id={{adset.id}}&ad_id={{ad.id}}",  "dsaBeneficiary": "Acme s.r.o.",  "dsaPayor": "Acme s.r.o.",  "dailyBudgetLimit": 50000}

{  "error": {    "type": "invalid_request",    "code": "invalid_ad_settings",    "message": "The default URL parameters lack ad_id, which Voidhash's attribution reads. Add ad_id={{ad.id}}."  }}

{  "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": "ad_account_not_found",    "message": "This project has no connected ad account ad_acct_k3m9x2c7v1b8n4q6w0e5r2t7.",    "param": "adAccountId"  }}

{  "error": {    "type": "conflict",    "code": "ad_account_reconnect_required",    "message": "The ad account's token does not grant ads_management, pages_show_list. Generate the system user token with the ads_read, ads_management, pages_show_list and pages_read_engagement permissions, assign the system user to the ad account and its Page, and connect the account again."  }}
{  "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."  }}
{  "error": {    "type": "unavailable",    "code": "ad_platform_unavailable",    "message": "Meta is limiting requests for this ad account; nothing was changed. Try again later."  }}

Response body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

Errors

StatustypecodeWhen
400invalid_requestinvalid_ad_settingsFor a limit that cannot be used.
400invalid_requestad_platform_rejectedWhen the platform refuses the check.
403permission_deniedpermission_deniedFor the CLI, a secret key, a bot or an AI agent.
404not_foundad_account_not_found—
409conflictad_account_reconnect_requiredWhen the account's token no longer works or may not manage ads, where message says which permissions it lacks and how to connect the account again.
503unavailablead_platform_unavailableWhen the platform cannot be reached or limits requests, with Retry-After when it says for how long.

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

More in Ad accounts

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