Python SDK

Profiles

Manage profiles to organize social media accounts with the Late Python SDK

The Profiles resource manages profiles, which are containers for grouping social media accounts. Think of profiles as "brands" or "projects" that organize related accounts together.

List Profiles

from late import Late

client = Late(api_key="your_api_key")

# Get all profiles
response = client.profiles.list()

for profile in response.profiles:
    print(f"{profile.name} ({profile.field_id})")
    if profile.isDefault:
        print("  ^ Default profile")

Get a Single Profile

response = client.profiles.get("prof_123")

print(f"Name: {response.profile.name}")
print(f"Description: {response.profile.description}")
print(f"Color: {response.profile.color}")
print(f"Is Default: {response.profile.isDefault}")

Create a Profile

# Create with just a name
response = client.profiles.create(name="My New Brand")

# Create with all options
response = client.profiles.create(
    name="Tech Blog",
    description="Social accounts for the tech blog",
    color="#4CAF50"
)

print(f"Created profile: {response.profile.field_id}")

Update a Profile

# Update name only
client.profiles.update("prof_123", name="Updated Name")

# Update multiple fields
client.profiles.update(
    "prof_123",
    name="New Brand Name",
    description="Updated description",
    color="#2196F3"
)

# Set as default profile
client.profiles.update("prof_123", is_default=True)

Delete a Profile

A profile can only be deleted if it has no connected accounts. Disconnect all accounts first.

response = client.profiles.delete("prof_123")
print(response.message)

Async Methods

All methods have async versions:

import asyncio
from late import Late

async def manage_profiles():
    async with Late(api_key="your_api_key") as client:
        # List
        result = await client.profiles.alist()

        # Get
        profile = await client.profiles.aget("prof_123")

        # Create
        new_profile = await client.profiles.acreate(
            name="Async Profile",
            color="#FF5722"
        )

        # Update
        await client.profiles.aupdate("prof_123", name="Updated!")

        # Delete
        await client.profiles.adelete("prof_123")

asyncio.run(manage_profiles())

API Reference

profiles.list()

List all profiles.

Returns: ProfilesListResponse

response = client.profiles.list()

response.profiles              # list[Profile]
response.profiles[0].field_id
response.profiles[0].name
response.profiles[0].isDefault

profiles.get()

Get a single profile by ID.

ParameterTypeRequiredDescription
profile_idstrYesThe profile ID

Returns: ProfileGetResponse

response = client.profiles.get("prof_123")

response.profile.field_id
response.profile.name
response.profile.description
response.profile.color
response.profile.isDefault

profiles.create()

Create a new profile.

ParameterTypeRequiredDefaultDescription
namestrYesProfile name
descriptionstrNoNoneProfile description
colorstrNoNoneHex color (e.g., "#ffeda0")

Returns: ProfileCreateResponse

response = client.profiles.create(name="My Brand")

response.message
response.profile.field_id

profiles.update()

Update an existing profile.

ParameterTypeRequiredDescription
profile_idstrYesID of the profile to update
namestrNoNew profile name
descriptionstrNoNew description
colorstrNoNew hex color
is_defaultboolNoSet as default profile

Returns: ProfileUpdateResponse

profiles.delete()

Delete a profile. Profile must have no connected accounts.

ParameterTypeRequiredDescription
profile_idstrYesID of the profile to delete

Returns: ProfileDeleteResponse

Profile Object

FieldTypeDescription
field_idstringUnique profile identifier
namestringProfile name
descriptionstring | NoneOptional description
colorstringHex color code
isDefaultboolWhether this is the default profile
createdAtdatetimeCreation timestamp
updatedAtdatetimeLast update timestamp