POST
Stable
Create or update contact
/v1/contacts/upsert
Creates or updates a lightweight tenant-level contact while preserving EmailsDone's template-first sending model.
Request
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
email |
Yes | Contact email address. | user@example.com |
|
name |
string | No | Optional contact name. | Ada Lovelace |
groupSlugs |
array | No | Simple tenant-level group slugs. | ["beta-users"] |
customFields |
object | No | Flat string, number, boolean, or null fields. | {"plan":"build"} |
curl
curl -X POST 'https://api.emailsdone.dev/v1/contacts/upsert' \
-H 'Authorization: Bearer ed_...' \
-H 'Content-Type: application/json' \
-d '{
"email": "user@example.com",
"name": "Ada Lovelace",
"groupSlugs": [
"beta-users"
]
}'
Response
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
ok |
boolean | Yes | True when contact was saved. | true |
contact |
object | Yes | Contact record. | {} |
{}
Errors
| Status | Code | Message |
|---|---|---|
| 400 | invalid_request |
Request body failed validation. |
| 401 | missing_api_key |
Authorization bearer token is missing. |
| 401 | invalid_api_key |
API key is invalid. |
| 403 | api_key_revoked |
API key has been revoked. |
| 404 | contact_not_found |
Contact was not found. |
| 405 | method_not_allowed |
Only POST is allowed. |
| 500 | internal |
Unexpected server error. |
Notes
- Contacts are tenant-level recipients for app email history, not CRM records.
- Existing environment API keys can access tenant contacts endpoints.