---
title: "Setup account with user profile and relationship."
method: POST
path: "/v1/accounts/setup"
tags: ["accounts"]
---

# Setup account with user profile and relationship.

`POST /v1/accounts/setup`

Create an account, user profile, and account relationship in a single operation. This endpoint handles all database operations for account setup.

## Request body

- SetupAccountRequest — Request to setup an account with user profile and relationship.
  - `account_id` string, nullable — The account ID. If not supplied, a new one will be created.
  - `account_name` string, required — The account name.
  - `account_tier` 'ACCOUNT_TIER_INVALID' | 'ACCOUNT_TIER_BASIC' | 'ACCOUNT_TIER_PRO' | 'ACCOUNT_TIER_ENTERPRISE' | 'ACCOUNT_TIER_TRIAL' | 'UNRECOGNIZED', required
  - `account_status` 'ACCOUNT_STATUS_INVALID' | 'ACCOUNT_STATUS_ONBOARDING' | 'ACCOUNT_STATUS_ENABLED' | 'ACCOUNT_STATUS_DISABLED_BY_ADMIN' | 'ACCOUNT_STATUS_DISABLED_QUOTA_REACHED' | 'UNRECOGNIZED', required
  - `stripe_customer_id` string, nullable — The Stripe customer ID.
  - `active_subscription` string, nullable — The active subscription ID.
  - `user_profile_id` string, nullable — The user profile ID. If not supplied, a new one will be created.
  - `user_email` string, required — The user email.
  - `github_user_name` string, nullable — The GitHub username.
  - `keycloak_user_id` string, nullable — The Keycloak user ID.
  - `auth_provider` 'AUTH_PROVIDER_UNSPECIFIED' | 'AUTH_PROVIDER_SUPABASE' | 'AUTH_PROVIDER_KEYCLOAK' | 'UNRECOGNIZED', required

## Response `200`

OK

- SetupAccountResponse — Response containing the created account and user profile.
  - `account` AccountView — Account information.
    - `id` string, required — The account ID.
    - `name` string, required — The account name.
    - `tier` 'ACCOUNT_TIER_INVALID' | 'ACCOUNT_TIER_BASIC' | 'ACCOUNT_TIER_PRO' | 'ACCOUNT_TIER_ENTERPRISE' | 'ACCOUNT_TIER_TRIAL' | 'UNRECOGNIZED', required
    - `account_status` 'ACCOUNT_STATUS_INVALID' | 'ACCOUNT_STATUS_ONBOARDING' | 'ACCOUNT_STATUS_ENABLED' | 'ACCOUNT_STATUS_DISABLED_BY_ADMIN' | 'ACCOUNT_STATUS_DISABLED_QUOTA_REACHED' | 'UNRECOGNIZED', required
    - `created_at` string, required — The account creation timestamp.
    - `stripe_customer_id` string, nullable — The Stripe customer ID.
    - `active_subscription` string, nullable — The active subscription ID.
  - `user_profile` UserProfileView — User profile information.
    - `id` string, required — The user profile ID.
    - `github_user_name` string, nullable — The GitHub username.
    - `active_account` string, nullable — The active account ID.
    - `keycloak_user_id` string, nullable — The Keycloak user ID.
    - `auth_provider` string, nullable — The auth provider.
    - `email` string, required — The user email.
    - `created_at` string, required — The user creation timestamp.

## Changes

- **2025-11-19** `5f33221208c1` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/runloopai/apis/runloop-api/changes/v1/accounts/setup/post.md)

---

[API](https://skmtc.dev/runloopai/apis/runloop-api.md) · [All operations](https://skmtc.dev/runloopai/apis/runloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runloopai/runloop-api/revisions/5f33221208c1/schema)
