Skip to main content
GET
https://api.getdoppel.ai/api/v1
/
api
/
v1
/
clinics
List Clinics
curl --request GET \
  --url https://api.getdoppel.ai/api/v1/api/v1/clinics \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "data": {
    "clinics": [
      {}
    ]
  },
  "meta": {}
}

List Clinics

Returns a list of all clinics you have access to. If your API key is restricted to specific clinics, only those clinics will be returned.

Request

GET https://api.getdoppel.ai/api/v1/clinics

Headers

HeaderRequiredDescription
AuthorizationYesBearer token with your API key

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number (1-indexed)
limitinteger25Items per page (max: 500)

Response

success
boolean
Whether the request was successful
data
object
meta
object
Pagination metadata

Clinic Object

FieldTypeDescription
idstringUnique clinic ID (UUID)
namestringClinic name
addressstringClinic address
phonestringClinic phone number
emailstringClinic email address
timezonestringClinic timezone (e.g., Europe/Madrid)
created_atstringWhen the clinic was added (ISO 8601)

Examples

Basic Request

curl -X GET "https://api.getdoppel.ai/api/v1/clinics" \
  -H "Authorization: Bearer dpl_live_YOUR_API_KEY"

Response Example

{
  "success": true,
  "data": {
    "clinics": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "SmileUp Madrid Centro",
        "address": "Calle Gran Via 123, 28013 Madrid",
        "phone": "+34912345678",
        "email": "[email protected]",
        "timezone": "Europe/Madrid",
        "created_at": "2024-01-01T00:00:00.000Z"
      },
      {
        "id": "660f9511-f30c-52e5-b827-557766551111",
        "name": "SmileUp Barcelona",
        "address": "Passeig de Gracia 45, 08007 Barcelona",
        "phone": "+34934567890",
        "email": "[email protected]",
        "timezone": "Europe/Madrid",
        "created_at": "2024-01-15T00:00:00.000Z"
      },
      {
        "id": "770a0622-g41d-63f6-c938-668877662222",
        "name": "SmileUp Valencia",
        "address": "Calle Colon 78, 46004 Valencia",
        "phone": "+34961234567",
        "email": "[email protected]",
        "timezone": "Europe/Madrid",
        "created_at": "2024-02-01T00:00:00.000Z"
      }
    ]
  },
  "meta": {
    "page": 1,
    "limit": 25,
    "total": 3,
    "total_pages": 1,
    "has_more": false
  },
  "request_id": "req_abc123xyz",
  "timestamp": "2024-01-15T10:30:00.000Z"
}

Use Cases

Build a Clinic Selector

Create a dropdown to filter data by clinic:
async function getClinicOptions(apiKey) {
  const response = await fetch('https://api.getdoppel.ai/api/v1/clinics', {
    headers: { 'Authorization': `Bearer ${apiKey}` }
  });
  const { data } = await response.json();

  return data.clinics.map(clinic => ({
    value: clinic.id,
    label: clinic.name
  }));
}

// Usage in a React component
function ClinicSelector({ apiKey, onSelect }) {
  const [options, setOptions] = useState([]);

  useEffect(() => {
    getClinicOptions(apiKey).then(setOptions);
  }, [apiKey]);

  return (
    <select onChange={(e) => onSelect(e.target.value)}>
      <option value="">All Clinics</option>
      {options.map(opt => (
        <option key={opt.value} value={opt.value}>
          {opt.label}
        </option>
      ))}
    </select>
  );
}

Get Clinic by ID

Find a specific clinic from the list:
import requests

def get_clinic_by_id(api_key, clinic_id):
    response = requests.get(
        'https://api.getdoppel.ai/api/v1/clinics',
        headers={'Authorization': f'Bearer {api_key}'}
    )
    clinics = response.json()['data']['clinics']
    return next(
        (c for c in clinics if c['id'] == clinic_id),
        None
    )

# Usage
clinic = get_clinic_by_id(
    'dpl_live_YOUR_API_KEY',
    '550e8400-e29b-41d4-a716-446655440000'
)
if clinic:
    print(f"Found clinic: {clinic['name']}")

Create a Clinic Summary Report

import requests

def generate_clinic_summary(api_key):
    # Get all clinics
    clinics_response = requests.get(
        'https://api.getdoppel.ai/api/v1/clinics',
        headers={'Authorization': f'Bearer {api_key}'}
    )
    clinics = clinics_response.json()['data']['clinics']

    summary = []
    for clinic in clinics:
        # Get metrics for each clinic
        metrics_response = requests.get(
            'https://api.getdoppel.ai/api/v1/metrics/summary',
            params={'clinic_id': clinic['id']},
            headers={'Authorization': f'Bearer {api_key}'}
        )
        metrics = metrics_response.json()['data']

        summary.append({
            'clinic_name': clinic['name'],
            'total_interactions': metrics['total_interactions'],
            'appointments_scheduled': metrics['appointments_scheduled'],
            'success_rate': metrics['success_rate']
        })

    return summary

# Usage
report = generate_clinic_summary('dpl_live_YOUR_API_KEY')
for clinic in report:
    print(f"{clinic['clinic_name']}: {clinic['appointments_scheduled']} appointments ({clinic['success_rate']}% success)")

API Key Restrictions

If your API key is restricted to specific clinics, only those clinics will appear in the response. Contact your account manager to modify clinic access.