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].isDefaultprofiles.get()
Get a single profile by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
profile_id | str | Yes | The 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.isDefaultprofiles.create()
Create a new profile.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name | str | Yes | — | Profile name |
description | str | No | None | Profile description |
color | str | No | None | Hex color (e.g., "#ffeda0") |
Returns: ProfileCreateResponse
response = client.profiles.create(name="My Brand")
response.message
response.profile.field_idprofiles.update()
Update an existing profile.
| Parameter | Type | Required | Description |
|---|---|---|---|
profile_id | str | Yes | ID of the profile to update |
name | str | No | New profile name |
description | str | No | New description |
color | str | No | New hex color |
is_default | bool | No | Set as default profile |
Returns: ProfileUpdateResponse
profiles.delete()
Delete a profile. Profile must have no connected accounts.
| Parameter | Type | Required | Description |
|---|---|---|---|
profile_id | str | Yes | ID of the profile to delete |
Returns: ProfileDeleteResponse
Profile Object
| Field | Type | Description |
|---|---|---|
field_id | string | Unique profile identifier |
name | string | Profile name |
description | string | None | Optional description |
color | string | Hex color code |
isDefault | bool | Whether this is the default profile |
createdAt | datetime | Creation timestamp |
updatedAt | datetime | Last update timestamp |