> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hiveku.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Account API

> Manage team members, invitations, billing, permissions, and settings

## Team Members

### Update Member Role

<ParamField path="PATCH" type="/account/members/{member_id}">
  Update a team member's role within the organization.
</ParamField>

**Path Parameters**

| Parameter   | Type   | Description     |
| ----------- | ------ | --------------- |
| `member_id` | string | The member's ID |

**Request Body**

```json theme={null}
{
  "role": "admin",
  "account_id": "account_abc123"
}
```

**Roles**

| Role     | Permissions                          |
| -------- | ------------------------------------ |
| `owner`  | Full access, billing, delete account |
| `admin`  | Manage projects, members, settings   |
| `member` | Create and edit projects             |

### Remove Member

<ParamField path="DELETE" type="/account/members/{member_id}">
  Remove a team member from the organization.
</ParamField>

***

## Invitations

### List Invitations

<ParamField path="GET" type="/account/invitations">
  List all pending invitations for the organization.
</ParamField>

**Response**

```json theme={null}
[
  {
    "id": "inv_abc123",
    "email": "jane@example.com",
    "role": "member",
    "status": "pending",
    "createdAt": "2025-04-10T10:00:00Z",
    "expiresAt": "2025-04-17T10:00:00Z"
  }
]
```

### Send Invitation

<ParamField path="POST" type="/account/invitations">
  Invite a new team member by email.
</ParamField>

**Request Body**

```json theme={null}
{
  "email": "jane@example.com",
  "role": "member"
}
```

### Cancel Invitation

<ParamField path="DELETE" type="/account/invitations/{invitation_id}">
  Cancel a pending invitation.
</ParamField>

### Resend Invitation

<ParamField path="POST" type="/account/invitations/{invitation_id}/resend">
  Resend the invitation email.
</ParamField>

### Accept Invitation

<ParamField path="POST" type="/account/invitations/accept/{token}">
  Accept an invitation using the token from the invitation email.
</ParamField>

### Verify Invitation

<ParamField path="GET" type="/account/invitations/verify/{token}">
  Verify that an invitation token is valid before accepting.
</ParamField>

**Response**

```json theme={null}
{
  "valid": true,
  "email": "jane@example.com",
  "organizationName": "Acme Agency",
  "role": "member"
}
```

***

## Permissions

### Get Permissions

<ParamField path="GET" type="/account/permissions">
  Get the current user's permissions within the organization.
</ParamField>

**Response**

```json theme={null}
{
  "role": "admin",
  "canManageMembers": true,
  "canManageBilling": true,
  "canDeleteProjects": true,
  "canManageSettings": true
}
```

***

## Activity

### Get Activity Log

<ParamField path="GET" type="/account/activity">
  Get the recent activity log for the organization.
</ParamField>

**Response**

```json theme={null}
[
  {
    "id": "act_abc123",
    "userId": "user_xyz",
    "action": "project.deployed",
    "target": "My Website",
    "timestamp": "2025-04-12T15:30:00Z"
  }
]
```

***

## Billing

### List Invoices

<ParamField path="GET" type="/account/invoices">
  List all invoices for the organization, most recent first.
</ParamField>

**Response**

```json theme={null}
[
  {
    "id": "inv_abc123",
    "invoice_number": "HVK-2025-0042",
    "status": "paid",
    "period_start": "2025-03-01T00:00:00Z",
    "period_end": "2025-03-31T23:59:59Z",
    "subtotal_cents": 2900,
    "total_cents": 2900,
    "currency": "usd",
    "pdf_url": "https://..."
  }
]
```

### Get Invoice

<ParamField path="GET" type="/account/invoices/{invoiceId}">
  Get a specific invoice by ID.
</ParamField>

### Get Account Limits

<ParamField path="GET" type="/account/limits">
  Get resource usage and plan limits for the organization.
</ParamField>

**Response**

```json theme={null}
{
  "plan": "standard",
  "projects": { "used": 5, "limit": 25 },
  "storage": { "used_mb": 2400, "limit_mb": 10000 },
  "aiCredits": { "used_cents": 450, "limit_cents": 1000 },
  "teamMembers": { "used": 3, "limit": 10 }
}
```

***

## BYOK (Bring Your Own Key)

Manage your own API keys for AI model access. When BYOK is enabled, AI requests use your key instead of Hiveku's shared quota.

### Get BYOK Status

<ParamField path="GET" type="/account/byok">
  Check whether BYOK is enabled and see the masked key.
</ParamField>

**Response**

```json theme={null}
{
  "enabled": true,
  "maskedKey": "sk-ant-...****WXYZ",
  "provider": "anthropic"
}
```

### Save API Key

<ParamField path="POST" type="/account/byok">
  Save or update your BYOK API key. The key is encrypted at rest.
</ParamField>

**Request Body**

```json theme={null}
{
  "apiKey": "sk-ant-api03-...",
  "provider": "anthropic"
}
```

<Warning>
  Your API key is encrypted before storage and is never exposed in plain text after saving. You'll only see a masked version.
</Warning>

### Remove API Key

<ParamField path="DELETE" type="/account/byok">
  Remove your BYOK key and revert to Hiveku's shared quota.
</ParamField>

***

## Settings

### Get Settings

<ParamField path="GET" type="/settings">
  Get account-level settings.
</ParamField>

### Update Settings

<ParamField path="PATCH" type="/settings">
  Update account-level settings.
</ParamField>

### Check BYOK Key Status

<ParamField path="GET" type="/settings/byok-key-status">
  Verify whether a saved BYOK key is still valid and working.
</ParamField>

**Response**

```json theme={null}
{
  "valid": true,
  "provider": "anthropic",
  "lastChecked": "2025-04-12T10:00:00Z"
}
```

***

## Password

### Reset Password

<ParamField path="POST" type="/account/password/reset">
  Trigger a password reset email for the current user.
</ParamField>
