Accounts
An account represents an authenticated user. Accounts are provisioned automatically on first login via GitHub OAuth (JIT upsert). The account holds profile information, subscription tier state, and the public slug used in config URLs.
All account endpoints are under /api/admin/accounts and require a GitHub OAuth Bearer token.
Object: Account
{
"accountId": "550e8400-e29b-41d4-a716-446655440000",
"ssoProvider": "github",
"ssoUserId": "12345678",
"email": "user@example.com",
"displayName": "Jane Smith",
"avatarUrl": "https://avatars.githubusercontent.com/u/12345678",
"stripeCustomerId": "cus_abc123",
"subscriptionTier": "hobby",
"paymentFailedAt": null,
"currentPeriodEnd": "2025-02-01T00:00:00.000Z",
"stripeSubscriptionId": "sub_xyz",
"lastStripeError": null,
"slug": "jane-smith",
"lastLoginAt": "2025-01-20T09:00:00.000Z",
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-20T09:00:00.000Z"
}| Field | Type | Description |
|---|---|---|
accountId | UUID | Unique account ID |
ssoProvider | string | OAuth provider (always "github") |
ssoUserId | string | GitHub user ID |
email | string or null | Email from GitHub profile |
displayName | string or null | Display name from GitHub profile |
avatarUrl | string or null | Avatar image URL |
stripeCustomerId | string or null | Stripe customer ID |
subscriptionTier | string | Current tier: free, hobby, or pro |
paymentFailedAt | ISO 8601 or null | When the last payment failed, if any |
currentPeriodEnd | ISO 8601 or null | End of the current Stripe billing period |
stripeSubscriptionId | string or null | Active Stripe subscription ID |
lastStripeError | string or null | Last Stripe error message |
slug | string | URL-safe account identifier, used in public config URLs |
lastLoginAt | ISO 8601 or null | Most recent login timestamp |
createdAt | ISO 8601 datetime | Account creation timestamp |
updatedAt | ISO 8601 datetime | Last account update timestamp |
Get Current Account
Returns the profile of the authenticated account.
GET /api/admin/accounts/meAuth: Authorization: Bearer <token>
Responses:
| Status | Description |
|---|---|
200 | Returns Account object |
404 | Account not found |
Example:
curl https://app.skystate.io/api/admin/accounts/me \
-H "Authorization: Bearer <token>"Update Account Profile
Updates the displayName and avatarUrl fields. Both fields are optional; omit a field to leave it unchanged.
PUT /api/admin/accounts/meAuth: Authorization: Bearer <token>
Request body:
{
"displayName": "Jane Smith",
"avatarUrl": "https://example.com/avatar.png"
}| Field | Type | Description |
|---|---|---|
displayName | string or null | New display name |
avatarUrl | string or null | New avatar URL |
Responses:
| Status | Description |
|---|---|
204 | Updated |
404 | Account not found |
Example:
curl -X PUT https://app.skystate.io/api/admin/accounts/me \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"displayName":"Jane Smith","avatarUrl":null}'Set Account Slug
Sets the account slug, which appears in public config URLs:
/api/public/{accountSlug}/{projectSlug}/config/{envSlug}Slugs must be lowercase alphanumeric with hyphens and cannot start or end with a hyphen. Slugs are globally unique across all accounts.
PUT /api/admin/accounts/me/slugAuth: Authorization: Bearer <token>
Request body:
{
"slug": "jane-smith"
}| Field | Type | Required | Constraints |
|---|---|---|---|
slug | string | Yes | Pattern: ^[a-z0-9][a-z0-9-]*[a-z0-9]$ |
Responses:
| Status | Description |
|---|---|
204 | Slug updated |
400 | Invalid slug format |
404 | Account not found |
409 | Slug already taken by another account |
Example:
curl -X PUT https://app.skystate.io/api/admin/accounts/me/slug \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"slug":"jane-smith"}'Delete Account
Permanently deletes the account and all associated data including projects, configurations, and billing history. This action is irreversible.
DELETE /api/admin/accounts/meAuth: Authorization: Bearer <token>
Responses:
| Status | Description |
|---|---|
204 | Account deleted |
404 | Account not found |
Example:
curl -X DELETE https://app.skystate.io/api/admin/accounts/me \
-H "Authorization: Bearer <token>"