> ## Documentation Index
> Fetch the complete documentation index at: https://docs.targeter.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration Guide

> Integrate your platform with the Targeter API as a trusted third-party partner

## Get started in three steps

Connect your platform to Targeter and start creating campaigns for your clients.

### Step 1: Receive your issued API credentials

<AccordionGroup>
  <Accordion icon="key" title="Partner credential issuance">
    As a trusted third-party partner, you will receive API credentials from Targeter:

    * **API Key**: Your unique partner identifier issued by Targeter
    * **API Secret**: Your plain-text authentication secret issued by Targeter
    * **Base URL**: The API host for your integration (e.g. `https://app.targeter.tech/api`)

    These credentials are required for all API requests and are only provided to approved partners.
  </Accordion>

  <Accordion icon="shield-check" title="Understand authentication">
    Targeter uses JWT (JSON Web Token) authentication for third-party partners:

    1. Exchange your issued API credentials for a JWT token
    2. Include the token in the `Authorization` header for protected routes
    3. Tokens expire after 1 hour for security

    <Tip>
      Send the plain-text secret in `api_secret` — not a bcrypt hash. Always store your issued API secret securely and never expose it in client-side code. These credentials are for server-to-server communication only.
    </Tip>
  </Accordion>
</AccordionGroup>

### Step 2: Make your first integration call

<AccordionGroup>
  <Accordion icon="terminal" title="Authenticate with your issued credentials">
    Start by obtaining a JWT token using your partner credentials:

    ```bash theme={null}
    curl -X POST "https://app.targeter.tech/api/auth/token" \
      -H "Content-Type: application/json" \
      -d '{
        "api_key": "YOUR_ISSUED_PARTNER_KEY",
        "api_secret": "YOUR_ISSUED_PARTNER_SECRET"
      }'
    ```

    Response:

    ```json theme={null}
    {
        "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6...",
        "token_type": "Bearer",
        "expires_in": 3600
    }
    ```
  </Accordion>

  <Accordion icon="bullseye" title="Create a campaign for your client">
    Now create a campaign on behalf of your client using your JWT token:

    ```bash theme={null}
    curl -X POST "https://app.targeter.tech/api/campaign" \
      -H "Authorization: Bearer YOUR_JWT_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "source": {
          "material": [
            "https://example.com/property-photo.jpg"
          ],
          "name": "Client Property Campaign",
          "reference_id": "CLIENT-PROP-001",
          "target_url": "https://client-site.com/property/001"
        }
      }'
    ```

    Depending on whether a campaign already exists, you get **200** or **201** with a `campaign_link`. New campaigns also include `campaign_id`. Use [`GET /campaign`](/api-reference/endpoint/campaign/get) to fetch the campaign, stats, and app link. See [Create campaign](/api-reference/endpoint/campaign/create).

    Example **201** when automatic creation succeeds:

    ```json theme={null}
    {
        "campaign_link": "https://app.targeter.tech/campaigns/AbC123xyz",
        "campaign_id": "AbC123xyz"
    }
    ```
  </Accordion>
</AccordionGroup>

### Step 3: Complete your integration

<Accordion icon="book-open" title="Explore the full API">
  Now that you've made your first integration call, explore our complete partner API reference:

  * **[Authentication](/api-reference/endpoint/auth)** — JWT tokens and partner security
  * **[Create campaign](/api-reference/endpoint/campaign/create)** — Create or resolve campaigns for your clients
  * **[Get campaign](/api-reference/endpoint/campaign/get)** — Fetch campaign details and stats
  * **[API Introduction](/api-reference/introduction)** — Overview of all available partner endpoints
</Accordion>

## Next steps

Ready to complete your Targeter integration? Here's what you can do next:

<CardGroup cols={2}>
  <Card title="Partner Authentication" icon="shield-check" href="/api-reference/endpoint/auth">
    Learn about JWT authentication and security best practices for partners.
  </Card>

  <Card title="Create campaign" icon="bullseye" href="/api-reference/endpoint/campaign/create">
    Create and resolve targeted marketing campaigns for your clients.
  </Card>

  <Card title="Get campaign" icon="chart-line" href="/api-reference/endpoint/campaign/get">
    Fetch campaign details, stats, and app links.
  </Card>

  <Card title="Partner API Reference" icon="book-open" href="/api-reference/introduction">
    Explore our complete third-party integration documentation.
  </Card>

  <Card title="Partner Support" icon="headset" href="mailto:support@targeter.tech">
    Get help from our partner integration support team.
  </Card>
</CardGroup>

<Note>
  **Need integration help?** Contact our partner support team at [support@targeter.tech](mailto:support@targeter.tech)
  for assistance with your third-party integration or any questions.
</Note>
