We use cookies to improve your experience. Read more about how we handle your data in our GDPR policy.

    Back to Genju
    API Docsv1
    Docs

    Python SDK

    Installation

    bash
    pip install genju-api

    Setup

    python
    from genju import GenjuClient
    
    genju = GenjuClient(api_key=os.environ['GENJU_API_KEY'])

    Examples

    Get account info

    python
    account = genju.me()
    print(f'{account.business_name}: {account.credits_remaining} credits')

    List contacts with pagination

    python
    contacts = []
    cursor = None
    while True:
        result = genju.contacts.list(after=cursor, limit=100)
        contacts.extend(result.contacts)
        if not result.next_cursor:
            break
        cursor = result.next_cursor

    Create or find contact (deduplicates)

    python
    contact = genju.contacts.create(
        full_name='Maria Borg',
        email='maria@example.com',
        tags=['new-lead', 'from-instagram']
    )

    Add a note to a contact

    python
    genju.contacts.add_note(
        contact_id=contact.id,
        content='Called to discuss hair colour options',
        type='call'
    )

    Create an invoice

    python
    invoice = genju.invoices.create(
        email='maria@example.com',
        line_items=[
            {'description': 'Balayage treatment', 'quantity': 1, 'unit_price': 120.00},
            {'description': 'Blow-dry', 'quantity': 1, 'unit_price': 25.00}
        ],
        due_date='2026-04-07',
        send_to_client=True
    )