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

# Update Client

> Update an existing client sub-account by providing the client ID

<Note>
  To update a client, include the `id` field in the request body along with the fields you want to change. The same endpoint is used for both creating and updating clients.
</Note>

## Query Parameters

<ParamField query="api_key" type="string" required>
  Your SmartLead API key
</ParamField>

## Request Body

<ParamField body="id" type="number" required>
  The ID of the client to update. This makes the request an update instead of a create.
</ParamField>

<ParamField body="email" type="string" required>
  Client email address
</ParamField>

<ParamField body="name" type="string" required>
  Client display name
</ParamField>

<ParamField body="password" type="string">
  New login password for the client
</ParamField>

<ParamField body="logo" type="string">
  Base64 encoded logo image
</ParamField>

<ParamField body="logo_url" type="string">
  URL to the client logo image
</ParamField>

<ParamField body="uuid" type="string">
  Unique identifier for the client
</ParamField>

<ParamField body="permission" type="array">
  Array of permission strings
</ParamField>

<ParamField body="is_credit_assigned" type="boolean">
  Whether credits are assigned to this client
</ParamField>

<ParamField body="email_credits" type="number">
  Email credits allocated
</ParamField>

<ParamField body="lead_credits" type="number">
  Lead credits allocated
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://server.smartlead.ai/api/v1/client/save?api_key=YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "id": 301,
      "email": "admin@acme.com",
      "name": "Acme Agency Updated",
      "email_credits": 20000
    }'
  ```
</RequestExample>

## Response Codes

<ResponseField name="200" type="Success">
  Request successful
</ResponseField>

<ResponseField name="400" type="Bad Request">
  Invalid request parameters or malformed request body
</ResponseField>

<ResponseField name="401" type="Unauthorized">
  Invalid or missing API key
</ResponseField>

<ResponseField name="422" type="Validation Error">
  Request validation failed. Check parameter types and constraints.
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "ok": true,
    "data": {
      "id": 301,
      "name": "Acme Agency Updated",
      "email": "admin@acme.com"
    }
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "message": "Invalid API Key"
  }
  ```
</ResponseExample>
