Skip to content
TriedDocs
Contacts

Import contacts

Create or merge up to 5000 contacts by phone number in one synchronous request.

POSThttps://api.tried.com.au/import-contacts

Upserts contacts by phone number and returns when every row is done. A new number creates a contact. An existing number is merged: non-empty names and email replace the old values, custom fields are merged key by key, and do_not_call is set only when the row includes it. For larger files or CSV input, use Create contact import job.

Request#

Field Type Required Description
contacts array of objects Yes 1 to 5000 rows. Each row takes the fields of Create contact.

Invalid rows are skipped and reported in errors; the other rows are still imported.

Example request#

curl -X POST https://api.tried.com.au/import-contacts \
  -H "Authorization: Bearer $TRIED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contacts": [
      { "phone_number": "+61412345678", "first_name": "Sam", "custom_fields": { "plan": "Pro" } },
      { "phone_number": "+14155550199", "first_name": "Jordan", "do_not_call": true },
      { "phone_number": "0412 345 678" }
    ]
  }'
const res = await fetch("https://api.tried.com.au/import-contacts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TRIED_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    contacts: [
      { phone_number: "+61412345678", first_name: "Sam", custom_fields: { plan: "Pro" } },
      { phone_number: "+14155550199", first_name: "Jordan", do_not_call: true },
      { phone_number: "0412 345 678" },
    ],
  }),
});
const result = await res.json();
import os, requests

res = requests.post(
    "https://api.tried.com.au/import-contacts",
    headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
    json={
        "contacts": [
            {"phone_number": "+61412345678", "first_name": "Sam", "custom_fields": {"plan": "Pro"}},
            {"phone_number": "+14155550199", "first_name": "Jordan", "do_not_call": True},
            {"phone_number": "0412 345 678"},
        ]
    },
)
result = res.json()

Response#

200 OK

{
  "created": 1,
  "updated": 1,
  "errors": [
    { "row": 3, "message": "phone_number must be E.164, e.g. +61412345678" }
  ]
}
Field Type Description
created integer New contacts.
updated integer Existing contacts merged.
errors array One item per rejected row. row is 1-based.

Errors#

Status When
400 contacts is missing, empty or has more than 5000 rows, for example contacts: Array must contain at most 5000 element(s).
401 Missing or invalid API key.
403 The key's IP allowlist or scopes reject the request, or the caller has the read-only member role. This route needs the calls scope.
429 Rate limit exceeded. See Rate limits.

See Errors for the body format.