Skip to content

Authors

Authors represent content creators and contributors in your website. They have profiles with bios, social links, avatars, and can be associated with pages, blog posts, and other content types.

Basic Author Management

Creating Authors

Create a basic author profile:

import konigle

# Initialize client
client = konigle.Client(api_key="your-api-key")

# Create a simple author
author_data = konigle.models.CreateAuthor(
    name="Jane Smith",
    handle="jane-smith",
    tagline="Senior Content Writer",
    bio="Jane is a seasoned content writer with over 8 years of experience in digital marketing and storytelling.",
    email="jane.smith@company.com"
)

author = client.authors.create(author_data)
print(f"Created author: {author.id}")

Create a comprehensive author profile:

import konigle

client = konigle.Client(api_key="your-api-key")

# Create author with avatar and social links
author_data = konigle.models.CreateAuthor(
    name="John Doe",
    handle="john-doe",
    tagline="Marketing Director",
    bio="""John leads our marketing team with expertise in growth strategies, 
    content marketing, and brand development. He has helped scale multiple 
    startups from idea to IPO.""",
    email="john.doe@company.com",
    avatar="/path/to/avatar.jpg",  # Local file path
    social_links={
        "website": "https://johndoe.com",
        "twitter": "https://twitter.com/johndoe",
        "linkedin": "https://linkedin.com/in/johndoe",
        "facebook": "https://facebook.com/johndoe"
    }
)

author = client.authors.create(author_data)
print(f"Created author: {author.name}")
print(f"Handle: {author.handle}")

Upload Avatar from Different Sources

Authors support various avatar upload methods:

import konigle
import io

client = konigle.Client(api_key="your-api-key")

# Method 1: File path
author_data = konigle.models.CreateAuthor(
    name="Alice Johnson",
    handle="alice-johnson",
    avatar="/path/to/alice-avatar.png"
)

# Method 2: Bytes
with open("/path/to/avatar.jpg", "rb") as f:
    avatar_bytes = f.read()

author_data = konigle.models.CreateAuthor(
    name="Bob Wilson", 
    handle="bob-wilson",
    avatar=avatar_bytes
)

# Method 3: BytesIO
avatar_io = io.BytesIO()
# ... write image data to avatar_io ...

author_data = konigle.models.CreateAuthor(
    name="Carol Davis",
    handle="carol-davis", 
    avatar=avatar_io
)

# Method 4: Tuple with filename
author_data = konigle.models.CreateAuthor(
    name="Dave Brown",
    handle="dave-brown",
    avatar=(avatar_bytes, "dave-avatar.jpg")
)

author = client.authors.create(author_data)

Author Profile Management

Retrieve Authors

Get specific authors and their information:

import konigle
from konigle.filters import AuthorFilters

client = konigle.Client(api_key="your-api-key")

# Get author by ID
author = client.authors.get("auth_123456789")
print(f"Author: {author.name}")
print(f"Handle: {author.handle}")
print(f"Tagline: {author.tagline}")
print(f"Bio: {author.bio}")

# Access social links
if author.social_links:
    print("Social Links:")
    if author.social_links.website:
        print(f"  Website: {author.social_links.website}")
    if author.social_links.twitter:
        print(f"  Twitter: {author.social_links.twitter}")
    if author.social_links.linkedin:
        print(f"  LinkedIn: {author.social_links.linkedin}")

# Check avatar information
if author.avatar:
    print(f"Avatar URL: {author.avatar}")
    if author.avatar_width and author.avatar_height:
        print(f"Avatar Dimensions: {author.avatar_width}x{author.avatar_height}")

# List all authors
authors = client.authors.list()
print(f"Found {len(authors)} authors")

# Search authors by name or handle
filters = AuthorFilters(q="john")
matching_authors = client.authors.list(filters)

# Filter by specific handle
filters = AuthorFilters(handle="jane-smith")
specific_author = client.authors.list(filters)

# Order by name
filters = AuthorFilters(ordering="name")
sorted_authors = client.authors.list(filters)

Update Author Profiles

Modify existing author information:

import konigle

client = konigle.Client(api_key="your-api-key")

# Update basic information
update_data = konigle.models.UpdateAuthor(
    tagline="Chief Marketing Officer",
    bio="Updated bio with new role and responsibilities...",
    email="new.email@company.com"
)

updated_author = client.authors.update("auth_123456789", update_data)
print(f"Updated author: {updated_author.name}")

# Update social links
update_data = konigle.models.UpdateAuthor(
    social_links={
        "website": "https://newwebsite.com",
        "twitter": "https://twitter.com/newhandle",
        "linkedin": "https://linkedin.com/in/newprofile"
    }
)

updated_author = client.authors.update("auth_123456789", update_data)

# Update avatar
update_data = konigle.models.UpdateAuthor(
    avatar="/path/to/new-avatar.jpg"
)

updated_author = client.authors.update("auth_123456789", update_data)

Author Content Association

Authors in Content Creation

Authors are referenced in various content types:

import konigle

client = konigle.Client(api_key="your-api-key")

# Create a blog post with author
blog_data = konigle.models.BlogCreate(
    name="My Latest Blog Post",
    handle="my-latest-post",
    title="Understanding Digital Marketing Trends",
    author="auth_123456789",  # Author ID
    folder="blog_folder_001"
)

blog = client.blogs.create(blog_data)

# Create a page with author and contributors
page_data = konigle.models.PageCreate(
    name="About Us Page",
    handle="about-us",
    title="About Our Company",
    author="auth_123456789",  # Primary author
    contributor_ids=["auth_111111111", "auth_222222222"],  # Contributors
    reviewer_ids=["auth_333333333"],  # Reviewers
    folder="pages_folder_001"
)

page = client.pages.create(page_data)

# Create glossary term with author
glossary_data = konigle.models.GlossaryTermCreate(
    name="Content Marketing",
    handle="content-marketing",
    title="Content Marketing Definition",
    author="auth_123456789"
)

term = client.glossary_terms.create(glossary_data)

Team and Collaboration

Manage author teams and collaboration:

import konigle

client = konigle.Client(api_key="your-api-key")

# Create team of authors for content production
marketing_team = []

# Content writers
writer1_data = konigle.models.CreateAuthor(
    name="Sarah Connor",
    handle="sarah-connor",
    tagline="Content Writer",
    bio="Specializes in technical writing and documentation."
)
writer1 = client.authors.create(writer1_data)
marketing_team.append(writer1.id)

writer2_data = konigle.models.CreateAuthor(
    name="Mike Johnson",
    handle="mike-johnson", 
    tagline="Blog Writer",
    bio="Expert in storytelling and engaging blog content."
)
writer2 = client.authors.create(writer2_data)
marketing_team.append(writer2.id)

# Editor/Reviewer
editor_data = konigle.models.CreateAuthor(
    name="Lisa Editor",
    handle="lisa-editor",
    tagline="Senior Editor",
    bio="Ensures content quality and brand consistency."
)
editor = client.authors.create(editor_data)

# Create collaborative blog post
collaborative_blog = konigle.models.BlogCreate(
    name="Team Collaboration Guide",
    handle="team-collaboration-guide",
    title="How Our Team Collaborates Effectively",
    author=writer1.id,  # Primary author
    contributor_ids=[writer2.id],  # Additional contributors  
    reviewer_ids=[editor.id],  # Reviewers
    folder="blog_folder_001"
)

blog = client.blogs.create(collaborative_blog)

Author Profile Customization

Professional Profiles

Create detailed professional author profiles:

import konigle

client = konigle.Client(api_key="your-api-key")

# Executive profile
executive_data = konigle.models.CreateAuthor(
    name="Alexandra Chen",
    handle="alexandra-chen",
    tagline="Chief Executive Officer",
    bio="""Alexandra is the visionary leader behind our company's growth strategy. 
    With over 15 years in the industry, she has successfully led multiple 
    organizations through digital transformation initiatives. 

    Prior to joining our company, Alexandra served as VP of Strategy at Fortune 500 
    companies and holds an MBA from Stanford Business School. She is passionate about 
    innovation, sustainability, and building high-performing teams.""",
    email="alexandra.chen@company.com",
    social_links={
        "website": "https://alexandrachen.com",
        "linkedin": "https://linkedin.com/in/alexandrachen",
        "twitter": "https://twitter.com/alexchen"
    }
)

executive = client.authors.create(executive_data)

# Technical expert profile  
expert_data = konigle.models.CreateAuthor(
    name="Dr. Robert Kim",
    handle="dr-robert-kim",
    tagline="Chief Technology Officer & Co-founder",
    bio="""Dr. Kim is a technology visionary with deep expertise in AI, machine learning, 
    and distributed systems. He holds a Ph.D. in Computer Science from MIT and has 
    published over 50 research papers in top-tier conferences.

    Before co-founding the company, Robert was a Principal Engineer at Google where he 
    led several breakthrough projects in search and recommendation systems. He is also 
    an active open-source contributor and frequent speaker at technology conferences.""",
    email="robert.kim@company.com", 
    social_links={
        "website": "https://robertkim.dev",
        "linkedin": "https://linkedin.com/in/drrobertkim",
        "twitter": "https://twitter.com/drrobertkim"
    }
)

expert = client.authors.create(expert_data)

Content Specialist Profiles

Create profiles for different content specializations:

import konigle

client = konigle.Client(api_key="your-api-key")

# SEO specialist
seo_specialist = konigle.models.CreateAuthor(
    name="Emma Rodriguez",
    handle="emma-rodriguez",
    tagline="SEO & Content Strategy Specialist",
    bio="""Emma helps businesses improve their online visibility through strategic SEO 
    and content marketing. She has helped over 200 companies achieve first-page 
    Google rankings and increased organic traffic by an average of 300%.

    Emma is certified in Google Analytics, Google Ads, and holds multiple SEO 
    certifications. She regularly shares insights on search engine optimization 
    and content strategy.""",
    social_links={
        "website": "https://emmarodriguez-seo.com",
        "twitter": "https://twitter.com/emmaseo",
        "linkedin": "https://linkedin.com/in/emmarodriguez"
    }
)

# Social media expert
social_expert = konigle.models.CreateAuthor(
    name="Marcus Thompson", 
    handle="marcus-thompson",
    tagline="Social Media & Brand Strategist",
    bio="""Marcus is a creative strategist who specializes in building authentic 
    brand connections through social media. His campaigns have generated millions 
    of engagements and helped brands build loyal communities across all major platforms.

    With experience at both startup and enterprise levels, Marcus understands how 
    to adapt social strategies for different audiences and business goals.""",
    social_links={
        "twitter": "https://twitter.com/marcusthompson",
        "linkedin": "https://linkedin.com/in/marcusthompson",
        "instagram": "https://instagram.com/marcusthompson"
    }
)

authors = [
    client.authors.create(seo_specialist),
    client.authors.create(social_expert)
]

Author Management Operations

Bulk Author Operations

Manage multiple authors efficiently:

import konigle
from konigle.filters import AuthorFilters

client = konigle.Client(api_key="your-api-key")

# Create multiple authors
team_members = [
    {
        "name": "Jennifer Walsh",
        "handle": "jennifer-walsh", 
        "tagline": "Content Manager",
        "email": "jennifer@company.com"
    },
    {
        "name": "David Park",
        "handle": "david-park",
        "tagline": "Technical Writer", 
        "email": "david@company.com"
    },
    {
        "name": "Maria Gonzalez",
        "handle": "maria-gonzalez",
        "tagline": "UX Writer",
        "email": "maria@company.com"
    }
]

created_authors = []
for member in team_members:
    author_data = konigle.models.CreateAuthor(**member)
    author = client.authors.create(author_data)
    created_authors.append(author)
    print(f"Created author: {author.name}")

# Update multiple authors with common information
company_bio_suffix = "\n\nAll our authors are committed to creating high-quality, engaging content that helps our readers achieve their goals."

for author in created_authors:
    update_data = konigle.models.UpdateAuthor(
        bio=author.bio + company_bio_suffix
    )
    client.authors.update(author.id, update_data)

Author Cleanup and Management

Remove and manage author accounts:

import konigle
from konigle.filters import AuthorFilters

client = konigle.Client(api_key="your-api-key")

# Delete specific author
try:
    client.authors.delete("auth_123456789")
    print("Author deleted successfully")
except Exception as e:
    print(f"Error deleting author: {e}")

# Clean up test authors
test_filters = AuthorFilters(q="test")
test_authors = client.authors.list(test_filters)

for author in test_authors:
    if "test" in author.name.lower() or "temp" in author.handle:
        client.authors.delete(author.id)
        print(f"Deleted test author: {author.name}")

# Find authors without social links
all_authors = client.authors.list()
authors_without_social = []

for author in all_authors:
    if not author.social_links:
        authors_without_social.append(author)

print(f"Found {len(authors_without_social)} authors without social links")

# Update authors to add missing social links
for author in authors_without_social:
    update_data = konigle.models.UpdateAuthor(
        social_links={
            "website": f"https://company.com/author/{author.handle}",
            "linkedin": f"https://linkedin.com/in/{author.handle}"
        }
    )
    client.authors.update(author.id, update_data)

Async Usage

All author operations support async usage:

import asyncio
import konigle

async def manage_authors():
    async with konigle.AsyncClient(api_key="your-api-key") as client:
        # Create author asynchronously
        author_data = konigle.models.CreateAuthor(
            name="Async Author",
            handle="async-author",
            tagline="Asynchronous Content Creator"
        )

        author = await client.authors.create(author_data)
        print(f"Created async author: {author.id}")

        # List authors asynchronously  
        authors = await client.authors.list()
        print(f"Found {len(authors)} authors")

        # Update author asynchronously
        update_data = konigle.models.UpdateAuthor(
            bio="Updated bio for async author"
        )
        updated = await client.authors.update(author.id, update_data)

        return updated

# Run async function
asyncio.run(manage_authors())

CLI Usage

Use the CLI for quick author management:

# Create an author
konigle authors create \
  --name "Jane Smith" \
  --handle "jane-smith" \
  --tagline "Senior Content Writer" \
  --bio "Experienced writer with expertise in digital marketing" \
  --email "jane@company.com" \
  --avatar "/path/to/avatar.jpg" \
  --social-links '{"website": "https://janesmith.com", "twitter": "https://twitter.com/janesmith"}'

# List authors
konigle authors list --query marketing

# Get author details
konigle authors get auth_123456789

# Update author
konigle authors update auth_123456789 \
  --tagline "Chief Content Officer" \
  --bio "Promoted to lead our content strategy team"

# Delete author
konigle authors delete auth_123456789 --confirm

Authors provide the foundation for content attribution, collaboration, and building trust with your audience through professional author profiles and social proof.