Guides
Testing in the sandbox
Text triggers to reject, escalate and fail, the test account, the personas and the homologation toggles of the LinkedIn Ads simulator.
LinkedIn documents no magic test values. Mimicr adds its own triggers, with the same vocabulary as the other ads simulators, so you can cause each outcome without waiting for the other side. Everything here is a Mimicr rule.
Text triggers
| Where | Value | Effect |
|---|---|---|
Creative text: the post commentary, the media or article title, textAd.headline/description or the creative name | [reprovar] | Review ends REJECTED with MISLEADING_CLAIMS and the REJECTED hold |
| Same | [revisao-manual] | Review becomes NEEDS_REVIEW and stays there until creative.approve or creative.reject |
| Same, or the campaign name | [falha-simulada] | The create answers 500 INTERNAL_ERROR and nothing is created |
| Campaign name | [sem-entrega] | The campaign is eligible but delivers nothing |
| Campaign name | [audiencia-pequena] | The estimated audience is 120: CAMPAIGN_AUDIENCE_COUNT_HOLD and 400 AUDIENCE_SIZE_TOO_SMALL on activation |
| Ad account name | [billing-hold] | The account starts on BILLING_HOLD |
| Lead form name | [reprovar] | Form review ends REJECTED; linked creatives get FORM_HOLD |
Conversion event eventId | Starts with rejeitar- | The batch is refused with INVALID_USER_IDENTIFICATION_FIELD_VALUE |
Conversion event eventId | Starts with nomatch- | The event is accepted but never matches a member |
Without a trigger, creatives and forms are approved 10 sandbox minutes after entering review. Advance the clock (npx mimicr clock linkedin-ads +10m) or use the review actions.
The test account
The "Conta de Teste" (test: true, USD) behaves as LinkedIn documents: its creatives are rejected with TEST_ADS, never serve and adAnalytics returns nothing. Each app can have at most one test account; creating another answers 400 TEST_ACCOUNT_LIMIT_REACHED. For demos, turn honorTestAccounts off and the test account delivers like the others.
Personas
On the consent page, or in POST /v1/linkedin-ads/token with member, pick the persona for the scenario: admin does everything, campaign_manager can't read leads, creative_manager only touches creatives, viewer gets 403 on every write, no_accounts sees no accounts and cancel_login returns with error=user_cancelled_login. See Environment.
Homologation toggles
| Toggle | Default | Effect |
|---|---|---|
lenientRestli | off | On: no LinkedIn-Version uses the latest; tolerates a missing X-Restli-Protocol-Version and X-RestLi-Method (a POST with patch becomes PARTIAL_UPDATE) and unencoded URNs |
accessTier | development | development limits writes to 5 accounts (devAccounts); standard doesn't |
programmaticRefresh | on | Off: the code exchange returns no refresh token |
autoBilling | on | Off: new accounts start on BILLING_HOLD |
honorTestAccounts | on | Off: the test account delivers and has reporting |
autoReview | on | Off: creatives and forms stay in review until an action |
reviewDelayMinutes | 10 | Sandbox minutes until the automatic review |
autoDelivery | on | Off: the delivery model stops; only traffic.deliver creates numbers |
deliveryRate | 1 | Share of the daily budget the model spends |
cpmMultiplier | 1 | Multiplies the model's CPM |
fx | 5 | BRL per USD (costInUsd, floors of other currencies) |
demographicsLagHours | 12 | Delay of the MEMBER_* pivots |
conversionLagMinutes | 0 | Delay of attributed conversions in adAnalytics |
autoLeads | off | On: the model turns into real leads (with webhooks) in lead campaigns, up to 20 per hour |
requireWebhookValidation | on | Off: subscriptions are created even if the challenge fails |
allowHttpWebhooks | off | On: accepts http webhooks (they are already accepted on localhost) |
crmConnected | off | On: attributedRevenueMetrics gets values |
quotaScale, appDailyQuota, memberDailyQuota | 1, 100000, 10000 | Daily quotas per endpoint (see Rate limits) |
curl --request PUT \
--url https://api.mimicr.dev/v1/linkedin-ads/homolog \
--header 'Authorization: Bearer mk_...' \
--header 'Content-Type: application/json' \
--data '{ "lenientRestli": true, "reviewDelayMinutes": 0 }'Keep lenientRestli off in integration tests: that mode catches forgotten headers and unencoded URNs, like the real LinkedIn.
Failures on demand
Chaos injects latency and errors per area: api (500 before or after processing, 503, 504, 409 CONFLICT, 429), oauth (500 on the code exchange), analytics (408 TIMEOUT or empty responses), conversions (rejected batch) and webhooks (first attempt fails, duplicate notifications, challenge failed as if the hash were wrong). The other side's actions (billing, review, clicks, leads, versions, quotas) are in Sandbox control.