Prompt

How do I set up a targeting API for audience onboarding with privacy-safe identity matching?

Advertising / DSP & SSP4 observationsLast seen Oct 27, 2026

Latest observation

Oct 27, 2026OpenAI APIWeb search: off

To set up a targeting API for audience onboarding with privacy-safe identity matching, design it as a system that accepts audience data from a client, matches it against your identity graph using protected identifiers, and returns activation-ready audience keys or segments without exposing raw PII.

1) Define the onboarding flow

A typical flow looks like this:

  1. Client uploads audience
    The advertiser or data provider sends a list of users, usually with identifiers like:

    • email
    • phone number
    • postal address
    • mobile ad IDs
    • CRM IDs
  2. Normalize and protect identifiers Before matching:

    • normalize inputs
    • hash or tokenize sensitive fields
    • remove raw PII as soon as possible
  3. Match against your identity graph Your system checks:

    • exact hashed matches
    • deterministic linkages
    • allowed probabilistic matches, if policy permits
  4. Return onboarding results Return only:

    • matched internal IDs
    • segment membership
    • activation tokens
    • counts and status summaries
  5. Activate to destinations Push matched audiences to ad platforms or downstream endpoints through approved connectors.


2) Core privacy-safe identity design

Use these principles:

A. Minimize raw PII

  • Accept PII only at ingestion boundary.
  • Immediately normalize and hash/tokenize.
  • Do not store raw PII unless absolutely necessary.

B. Deterministic matching first

Prefer strong identifiers:

  • SHA-256 hashed email/phone
  • normalized address
  • first-party user IDs mapped through consented sources

C. Use a trusted identity graph

Store relationships like:

  • hashed email ↔ internal user ID
  • device ID ↔ user ID
  • customer ID ↔ household ID

D. Enforce consent and purpose limitation

For each record, check:

  • user consent status
  • region/jurisdiction rules
  • permitted use for targeting
  • retention policy

E. Return only privacy-safe outputs

Never return:

  • raw PII
  • full joined identity graph
  • unnecessary internal identifiers

3) API architecture

A practical setup:

Ingestion API

Used by partners to submit audiences.

Example endpoint

  • POST /audiences/import
  • POST /audiences/{id}/members

Payload

{
  "audience_name": "Spring Promo Buyers",
  "source": "crm_upload",
  "identifiers": [
    {
      "type": "email",
      "value": "user@example.com",
      "hashing": "sha256",
      "normalized": true
    }
  ],
  "consent": {
    "status": "granted",
    "lawful_basis": "consent"
  }
}

Matching service

Internal service that:

  • normalizes fields
  • hashes if needed
  • searches identity store
  • scores matches
  • applies policy checks

Activation API

Used to publish matched audience to destinations.

Example endpoint

  • POST /audiences/{id}/activate

Status API

For async processing:

  • GET /jobs/{job_id}
  • GET /audiences/{id}/summary

4) Identity matching methods

Deterministic matching

Best for privacy-safe onboarding.

Examples:

  • exact hashed email match
  • exact hashed phone match
  • CRM ID mapped to known customer ID

Recommended rules:

  • use the same normalization standard across all partners
  • specify hashing algorithm and salt policy
  • compare only normalized forms

Probabilistic matching

If used, make it optional and tightly controlled:

  • only with explicit consent/policy approval
  • use aggregate confidence thresholds
  • avoid exposing match reasons externally

For privacy-sensitive onboarding, deterministic is usually preferred.


5) Normalization standards

Consistency is crucial. Define canonical formatting for:

  • emails: lowercase, trim spaces
  • phone numbers: E.164 format
  • addresses: standardized postal normalization
  • names: trim, remove extra whitespace, locale-aware rules

Example:

  • User@Example.com → user@example.com
  • +1 (555) 123-4567 → +15551234567

Then hash the normalized value.


6) Security controls

Implement:

  • TLS in transit
  • encryption at rest
  • strict IAM / least privilege
  • audit logging
  • rate limiting
  • request signing or mTLS for partners
  • key management via KMS/HSM
  • data retention controls and deletion workflows

Also:

  • separate partner-specific namespaces
  • isolate audiences by tenant
  • prevent cross-tenant leakage

7) Recommended API behavior

Input validation

Reject:

  • malformed identifiers
  • unsupported identifier types
  • records missing required consent fields

Async processing

For large uploads:

  • accept job
  • return job_id
  • process in background
  • provide status updates

Idempotency

Support idempotency keys so retries don’t duplicate records.

Partial success

Return counts like:

  • received
  • normalized
  • matched
  • rejected
  • suppressed due to consent

8) Example onboarding response

{
  "audience_id": "aud_12345",
  "job_id": "job_98765",
  "status": "processing",
  "received": 100000,
  "accepted": 98210,
  "rejected": 1790,
  "matched": 72155,
  "suppressed": 4021
}

9) Privacy and compliance checklist

Make sure the design supports:

  • consent management
  • GDPR/CCPA/CPRA compliance
  • data subject deletion requests
  • purpose limitation
  • retention limits
  • vendor DPAs
  • cross-border transfer controls
  • logging without sensitive payloads

10) Practical implementation pattern

A strong pattern is:

  • API gateway for auth, quotas, logging
  • Normalization service for identifier standardization
  • Hashing/tokenization service
  • Identity graph store
  • Policy engine for consent/region rules
  • Audience store
  • Activation connectors
  • Audit and monitoring layer

11) Suggested endpoint set

Minimal set:

  • POST /audiences
  • POST /audiences/{audience_id}/members:import
  • GET /audiences/{audience_id}
  • GET /jobs/{job_id}
  • POST /audiences/{audience_id}/activate
  • DELETE /audiences/{audience_id}

12) Best practices summary

  • Normalize before matching
  • Hash or tokenize identifiers immediately
  • Match deterministically when possible
  • Enforce consent and purpose checks
  • Return only privacy-safe outputs
  • Make onboarding asynchronous and auditable
  • Separate tenants and destinations
  • Minimize retention of raw identifiers

If you want, I can also provide:

  1. a sample OpenAPI spec,
  2. a reference architecture diagram, or
  3. a code example for the matching pipeline.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (4 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.