Skip to content

API Contatti

Gestisci i contatti tramite API REST.

Endpoints

MetodoEndpointDescrizione
GET/contactsLista contatti
POST/contactsCrea contatto
GET/contacts/{id}Dettaglio contatto
PUT/contacts/{id}Aggiorna contatto
DELETE/contacts/{id}Elimina contatto
GET/contacts/{id}/notesNote del contatto

Lista Contatti

http
GET /api/v1/contacts

Query Parameters

ParametroTipoDescrizione
pageintNumero pagina (default: 1)
per_pageintRecord per pagina (max 100)
searchstringRicerca per nome/email
company_idintFiltra per azienda
stagestringFiltra per stadio

Risposta

json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "first_name": "Mario",
      "last_name": "Rossi",
      "email": "mario@example.com",
      "phone": "+39 123 456 7890",
      "company_id": 5,
      "company": {
        "id": 5,
        "name": "Acme Srl"
      },
      "stage": "lead",
      "created_at": "2025-01-15T10:30:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 10,
    "per_page": 25,
    "total": 250
  }
}

Creare Contatto

http
POST /api/v1/contacts

Body

json
{
  "first_name": "Mario",
  "last_name": "Rossi",
  "email": "mario@example.com",
  "phone": "+39 123 456 7890",
  "mobile": "+39 333 456 7890",
  "company_id": 5,
  "title": "CEO",
  "stage": "lead",
  "source": "website",
  "custom_fields": {
    "budget": "50000",
    "industry": "software"
  }
}

Campi

CampoTipoObbligatorio
first_namestring
last_namestring
emailstring
phonestring
mobilestring
company_idint
titlestring
stagestring
sourcestring
custom_fieldsobject

Risposta

json
{
  "success": true,
  "data": {
    "id": 123,
    "first_name": "Mario",
    "last_name": "Rossi",
    ...
  }
}

Dettaglio Contatto

http
GET /api/v1/contacts/{id}

Risposta

json
{
  "success": true,
  "data": {
    "id": 1,
    "first_name": "Mario",
    "last_name": "Rossi",
    "email": "mario@example.com",
    "phone": "+39 123 456 7890",
    "mobile": "+39 333 456 7890",
    "company_id": 5,
    "company": {
      "id": 5,
      "name": "Acme Srl",
      "website": "https://acme.it"
    },
    "title": "CEO",
    "stage": "lead",
    "source": "website",
    "custom_fields": {
      "budget": "50000"
    },
    "tags": ["prospect", "software"],
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": "2025-01-16T14:20:00Z"
  }
}

Aggiornare Contatto

http
PUT /api/v1/contacts/{id}

Body

Invia solo i campi da aggiornare:

json
{
  "stage": "prospect",
  "title": "CTO"
}

Eliminare Contatto

http
DELETE /api/v1/contacts/{id}

Risposta

json
{
  "success": true,
  "message": "Contatto eliminato"
}

Note del Contatto

http
GET /api/v1/contacts/{id}/notes

Restituisce tutte le note associate al contatto.

Esempi

cURL - Lista

bash
curl -X GET "https://bladecrm.it/api/v1/contacts?page=1&per_page=10" \
  -H "Authorization: Bearer YOUR_API_KEY"

cURL - Crea

bash
curl -X POST "https://bladecrm.it/api/v1/contacts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Mario",
    "last_name": "Rossi",
    "email": "mario@example.com"
  }'

TIP

Usa company_id per collegare automaticamente il contatto a un'azienda esistente.

Realizzato con ❤️ da DScom