Skip to main content
POST
/
api
/
v1
/
users
/
Python (SDK)
import os
from syllable_sdk import SyllableSDK, models


with SyllableSDK(
    api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:

    res = ss_client.v1.create(request={
        "email": "user@syllable.ai",
        "first_name": "Jane",
        "last_name": "Smith",
        "role_id": 1,
        "login_type": models.LoginType.USERNAME_AND_PASSWORD,
    })

    # Handle response
    print(res)
{
  "email": "user@syllable.ai",
  "first_name": "Jane",
  "last_name": "Smith",
  "role_id": 1,
  "last_updated_comments": "Updated to change which role was assigned",
  "id": 1,
  "role_name": "Admin",
  "email_sent": true,
  "activity_status": "invited",
  "last_updated": "2023-11-07T05:31:56Z",
  "last_updated_by": "admin@email.com",
  "last_session_at": "2025-01-01T12:00:00Z"
}

Authorizations

Syllable-API-Key
string
header
required

Body

application/json

Request model to create a user.

email
string
required

Email address of the user

Examples:

"user@syllable.ai"

role_id
integer
required

ID of the role assigned to the user

Examples:

1

first_name
string | null

First name of the user

Examples:

"Jane"

last_name
string | null

Last name of the user

Examples:

"Smith"

login_type
enum<string> | null

The type of login to use for the user. If not provided, defaults to google for @gmail.com email addresses, and username and password otherwise.

Available options:
google,
username_and_password
Examples:

"username_and_password"

skip_auth
boolean
default:false

Whether to skip authentication for the user.

Response

Successful Response

Information about a user.

email
string
required

Email address of the user

Examples:

"user@syllable.ai"

role_id
integer
required

ID of the role assigned to the user

Examples:

1

id
integer
required

Internal ID of the user

Examples:

1

role_name
string
required

Name of the role assigned to the user

Examples:

"Admin"

email_sent
boolean
required

Whether the welcome email has been sent to the user

Examples:

true

activity_status
enum<string>
required

The activity status of the user

Available options:
not_invited,
invited,
active
last_updated
string<date-time>
required

The timestamp of the most recent update to the user

first_name
string | null

First name of the user

Examples:

"Jane"

last_name
string | null

Last name of the user

Examples:

"Smith"

last_updated_comments
string | null

Comments for the most recent edit to the user.

Examples:

"Updated to change which role was assigned"

last_updated_by
string | null

The email address of the user who last updated the user

Examples:

"admin@email.com"

last_session_at
string<date-time> | null

The timestamp of the user's last session

Examples:

"2025-01-01T12:00:00Z"

I