# Data supplier posting

> Post the records you collect to your campaign in ICON, one request per record, and read a standardized answer.

A data supplier sends ICON the records it collects: one `POST /api/v1/engine/leads` per record, to its own campaign, with its own API key. Every post must carry your key. ICON checks each record and answers in the same call; when the answer is `PENDING`, the final outcome is not in yet.

## What you need

Everything comes from your login to ICON (**Campaigns**, then the campaign):

| What | Where |
| --- | --- |
| Your API key | Created on your campaign's page. It starts with `icsk_` and is shown once. See [API keys](https://developers.iconroute.io/data-suppliers/keys/). |
| The values that name your campaign | Listed on your campaign's page under "Send these on every record". Send them on every record, exactly as shown. |
| Your campaign's fields | Listed on your campaign's page, with the ones it requires. The [field dictionary](https://developers.iconroute.io/fields/) gives every field's format. |
| Whether your campaign is in testing | Shown on your campaign's page. While it is, every record is held as a test. |

## Your first post

Send a test record. A test record is checked like any record: your key, the values that name your campaign, its required fields, consent, eligibility and the duplicate check. It is compared with the records already held but never added to them, so it can be answered `DUPLICATE` like a live one. If it passes, it is held: never sent on, not counted against your campaign's caps and not paid, and answered `TEST_LEAD_HELD`.

```bash
export ICON_API_KEY='<your API key>'
```

```bash
curl -X POST 'https://iconroute.io/api/v1/engine/leads' \
  -H "X-API-Key: $ICON_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "icon_campaign_id": "6f1c2d3e-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
  "icon_offer_id": "0b7e4a2c-9d8f-4e1a-b2c3-d4e5f6a7b8c9",
  "icon_affiliate_id": "3c9d8e7f-1a2b-4c3d-9e8f-7a6b5c4d3e2f",
  "lead": {
    "personal": {
      "first_name": "Ada",
      "last_name": "Lovelace",
      "email": "ada.lovelace@mail.test",
      "phone": "6025552368",
      "date_of_birth": "1990-04-07"
    },
    "address": {
      "address_line_1": "123 N Main St",
      "city": "Phoenix",
      "state": "AZ",
      "zip_code": "85004"
    },
    "education": {
      "education_level": "bachelors",
      "high_school_graduation_year": "2008",
      "start_timeline": "1_3_months",
      "learning_preference": "online"
    },
    "background": {
      "military_affiliation": "none",
      "us_citizen": "yes"
    }
  },
  "tracking": {
    "ip_address": "203.0.113.9"
  },
  "universal_leadid": "3f2c7a1e-5b6d-4e8f-9a0b-1c2d3e4f5a6b",
  "trusted_form_cert_url": "https://cert.trustedform.com/0123456789abcdef0123456789abcdef01234567",
  "icon_is_test_lead": true
}'
```

The answer has `code: "TEST_LEAD_HELD"` and `status: "held"`. Take the ids above from your campaign's page; it may give a campaign code to send in place of the two ids. Without `icon_is_test_lead`, the answer is `ACCEPTED` or the reason it was not: see [Post a record](https://developers.iconroute.io/data-suppliers/records/).

## Next

- [API keys](https://developers.iconroute.io/data-suppliers/keys/): creating, sending, restricting and replacing your key.
- [Post a record](https://developers.iconroute.io/data-suppliers/records/): the request, consent certificates, testing, every answer and when to send again.
