Python SDK for Contackd Sync
Project description
contackd-sync (Python)
Python SDK for pushing and syncing customer data (contacts, leads, prospects).
Install
pip install contackd-sync
2-Minute Start (Push Customer Details)
from contackd_sync import ContackdClient, Contact
client = ContackdClient(
api_key="sk_live_...",
base_url="https://api.yourapp.com/v1", # no trailing slash required
)
# Create/update a customer contact by email
customer = client.contacts.upsert(
Contact(
email="jane@acme.com",
first_name="Jane",
last_name="Doe",
phone="+14155550199",
tags=["customer", "vip"],
custom={
"customer_id": "CUST-1001",
"plan": "pro",
"country": "US",
},
)
)
print(customer)
Common Customer Push Patterns
1) Push one new customer
from contackd_sync import Contact
created = client.contacts.create(
Contact(email="new@acme.com", first_name="New", last_name="Customer")
)
2) Push many customers (bulk upsert)
from contackd_sync import Contact
result = client.contacts.bulk_upsert(
[
Contact(email="a@acme.com", first_name="A"),
Contact(email="b@acme.com", first_name="B", tags=["trial"]),
]
)
print(len(result.created), len(result.updated), result.errors)
3) Read/filter customers
page = client.contacts.list(page=1, per_page=50, email="jane@acme.com")
API Key Setup
- Create key (JWT required):
curl -X POST http://localhost:8000/api/v1/auth/api-keys \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name":"py-sdk"}'
-
Use returned
api_keyasapi_keyinContackdClient. -
Revoke key:
curl -X DELETE http://localhost:8000/api/v1/auth/api-keys/<API_KEY_ID> \
-H "Authorization: Bearer <ACCESS_TOKEN>"
Backend Routes Expected by SDK
Given base_url = https://api.yourapp.com/v1:
GET /healthPOST /contacts|leads|prospectsGET /contacts|leads|prospects/{id}PUT /contacts|leads|prospects/{id}DELETE /contacts|leads|prospects/{id}GET /contacts|leads|prospectsPOST /contacts|leads|prospects/upsertPOST /contacts|leads|prospects/bulkPOST /contacts|leads|prospects/bulk/upsertPOST /contacts|leads|prospects/bulk/delete
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
contackd_sync-0.1.1.tar.gz
(6.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file contackd_sync-0.1.1.tar.gz.
File metadata
- Download URL: contackd_sync-0.1.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f56042d6d78b80bb59ee6827d843183eba929a83c4919aa6603b89c0c0685af7
|
|
| MD5 |
cfb4bddb842f08e788dd57e4652ef659
|
|
| BLAKE2b-256 |
19144a1b83cbb7b0b5ab88ca8a55a42bde65fc29fb5463224b3c94cdefbb670b
|
File details
Details for the file contackd_sync-0.1.1-py3-none-any.whl.
File metadata
- Download URL: contackd_sync-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cadcec79c3a046efa094a1ad265cf1388c0b31dd09873e31b4acfd019337366f
|
|
| MD5 |
2eccce429160f6e8b74e4782031f24bc
|
|
| BLAKE2b-256 |
6723dfef9d37f24caa6eb03ce9f00fc3fac3fcb4a71a1db3fcbdb9eafb60614c
|