Aller au contenu

POST /v1/contacts

POST
/v1/contacts
curl --request POST \
--url https://api.asap.cool/v1/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "address": "example", "city": "example", "company": "example", "consent_source": "example", "country": "example", "default_discount_terms": "example", "default_payment_terms": "example", "email": "example", "first_name": "example", "last_name": "example", "lead_score": 1, "lead_status": "example", "legal_basis": "example", "marketing_consent": true, "notes": "example", "phone": "example", "postal_code": "example", "preferred_language": "example", "reminder_opt_out": true, "siret": "example", "tags": [ "example" ], "type": "example", "vat_intra": "example" }'
Media type application/json

Body of POST /v1/contacts. org_id is never accepted here — it is resolved from the authenticated caller.

object
address

Street address.

string | null
city

City.

string | null
company

Company / legal name (business).

string | null
consent_source

Provenance of the consent.

string | null
country

ISO 3166-1 alpha-2 country code (defaults to FR).

string | null
default_discount_terms

Per-contact default early-payment discount terms (free text).

string | null
default_payment_terms

Per-contact default payment terms (free text) pre-filling new documents.

string | null
email

Contact email.

string | null
first_name

Given name (individual).

string | null
last_name

Family name (individual).

string | null
lead_score

Lead score in [0..=100].

integer | null format: int32
lead_status

Lead pipeline stage (new/qualified/contacted/won/lost).

string | null
legal_basis

RGPD lawful basis.

string | null
marketing_consent

Initial marketing-consent state.

boolean | null
notes

Free-form notes.

string | null
phone

Phone number.

string | null
postal_code

Postal / ZIP code.

string | null
preferred_language

Preferred language (fr or en) for outbound communication.

string | null
reminder_opt_out

Whether the contact opts out of reminder emails.

boolean | null
siret

French business registration number (14 digits).

string | null
tags

Tags assigned at creation (empty when omitted).

Array<string> | null
type

particulier or professionnel (defaults to professionnel).

string | null
vat_intra

Intra-EU VAT number (e.g. FR12345678901).

string | null
Example generated
{
"address": "example",
"city": "example",
"company": "example",
"consent_source": "example",
"country": "example",
"default_discount_terms": "example",
"default_payment_terms": "example",
"email": "example",
"first_name": "example",
"last_name": "example",
"lead_score": 1,
"lead_status": "example",
"legal_basis": "example",
"marketing_consent": true,
"notes": "example",
"phone": "example",
"postal_code": "example",
"preferred_language": "example",
"reminder_opt_out": true,
"siret": "example",
"tags": [
"example"
],
"type": "example",
"vat_intra": "example"
}

Contact created.

Media type application/json

Public projection of a [Contact] (omits unsubscribe_token).

object
address

Street address.

string | null
archived_at

RFC3339 archival timestamp, or null when the contact is active.

string | null
city

City.

string | null
company

Company / legal name (business).

string | null
consent_at

RFC3339 instant consent was last granted, or null.

string | null
consent_source

Provenance of the recorded consent, or null.

string | null
country
required

ISO 3166-1 alpha-2 country code.

string
created_at
required

RFC3339 creation timestamp.

string
default_discount_terms

Per-contact default early-payment discount terms pre-filling a new quote/invoice, or null to fall back to the org default.

string | null
default_payment_terms

Per-contact default payment terms pre-filling a new quote/invoice, or null to fall back to the org default.

string | null
email

Contact email.

string | null
erased_at

RFC3339 RGPD-erasure timestamp, or null when not erased.

string | null
first_name

Given name (individual).

string | null
id
required

Stable identifier.

string format: uuid
last_interaction_at

RFC3339 timestamp of the last recorded interaction (chat reply, email, …), or null when none.

string | null
last_name

Family name (individual).

string | null
lead_score

Lead score in [0..=100], or null for a non-lead.

integer | null format: int32
lead_status

Lead pipeline stage, or null for a non-lead.

string | null
legal_basis

RGPD lawful basis (consent/contract/legitimate_interest/ legal_obligation), or null.

string | null
marketing_consent
required

Current marketing-consent state.

boolean
merged_into

Surviving contact this row was merged into (null for a live contact).

string | null format: uuid
notes

Free-form notes.

string | null
phone

Phone number.

string | null
postal_code

Postal / ZIP code.

string | null
preferred_language

Preferred language (fr or en) for outbound emails and documents, or null when no explicit preference.

string | null
reminder_opt_out
required

Whether the contact opted out of reminder emails.

boolean
siret

French business registration number (14 digits).

string | null
source
required

Acquisition source (manual/chat/import/api).

string
tags
required

Assigned tags (empty when none).

Array<string>
type
required

particulier or professionnel.

string
updated_at
required

RFC3339 last-update timestamp.

string
vat_intra

Intra-EU VAT number (e.g. FR12345678901).

string | null
Example generated
{
"address": "example",
"archived_at": "example",
"city": "example",
"company": "example",
"consent_at": "example",
"consent_source": "example",
"country": "example",
"created_at": "example",
"default_discount_terms": "example",
"default_payment_terms": "example",
"email": "example",
"erased_at": "example",
"first_name": "example",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"last_interaction_at": "example",
"last_name": "example",
"lead_score": 1,
"lead_status": "example",
"legal_basis": "example",
"marketing_consent": true,
"merged_into": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"notes": "example",
"phone": "example",
"postal_code": "example",
"preferred_language": "example",
"reminder_opt_out": true,
"siret": "example",
"source": "example",
"tags": [
"example"
],
"type": "example",
"updated_at": "example",
"vat_intra": "example"
}

No active org.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Missing contacts:write scope.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Invalid contact payload.

Media type application/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}