---
id: ducklings-set-duckling-config-for-user
title: "Set user Ducklings"
description: "Configure account-specific settings, such as Duckling sizes for service accounts. See the Service Accounts Guide for context."
sidebar_label: "Set user Ducklings"
hide_title: true
hide_table_of_contents: true
api: eJztmE1v2zgQhv8KwUtbwI2dNrn45iQO1kDX6Sr2HtYIDFqibSYSqSWpfFTQf+8MJUUfFhIUNooA6SWRzOFw5p2HlDQpVTHXzAolJwEd0iDx70IhN+az4faiuDlXci02l0rPDde0RwNufC1inARTrrk1REhjmfQ58Z1tkrska6UJIwlMOyIe/z8RmhvyYRREQn4gWoUcvFm2MXS4oKULQ2961HA/0cI+wUBKR4ndKi1+sHzFxU0GFjHTLOKWa+NsBIYSM7sFjxIG4A6XdZftiHGAPAi7FZLYLSdKb5gs3cPa/pZHjA5Tap9idGSsBhVgJGKP37jcwCLDL6env+Q261GdCwAyW51wzAF/4caeqeAJl2sa9Choabm0OMTiOBS+c9W/NbhcuhunWt1y30KcscaqWgFawmhektftNGfB8gFU56/blsVaGvGDd0nFZRJhVeMkNFgBNA+YDuDyNolWit5kDUkWLZc3bhQCMj5DBn9PSD26DpV/13YBE1eOfOBWROhl4GDIr09ezqThcyfrmuithHdMizrC7/mIiZU0ee5fBgP819qYiQ+7yayTkJTG9GBQ/YHlrcGCxiddHJyxwB2+cNIcrv4RkMU2ndI1V5/BSci1hgdBOQXEfWRRHPJWbBkGF/ySS2ff8De6WHrjf+bj6xn6E8YkebyFR6Y1e4IZIGFk9siyXZnSEKloBjuSxC1K1Jrk4cDDgVnywDUv96VYhdw9K22ZWT2pxQ4HlZJOAHiSWGHbehYSfQQmPr0goZCwcFQ++54XTYtaNBTtVYK0qCqFXjgQHYnHuyRO5D3gGpBzyAMYFCw0b47IrhgPQeZ8OprP/rryJv+NL94lmh3CVoge74NoQ9o6o928dbD6dZfVuWTFaycP3hykjeAOQefllXc2ubgYT98lmnU5Kya/7sNkJWgdyBZUHSSe7JI4VZZcqkS+PQyryA7B4PRqtry8mk/f5/H4rGUF4Mk+AFZq1gGss7RD32nX2+MEgIPP6JCMi+zeFoKt8A7B4WQ6G3vT0bfl9dj7d+wtx5535b1LJpvilmCe7vdC2S1v87HdQq5FaobGcIxiwypOnM7Y+BnS/v1xH7swpp+WzZ+sX/WVsK2k78uOUaJDmLK1NjbDfp/F4ihSoJjGFtiRryKa1fpQ10h1XsVWN+q5luip7B7h/YozDd+BGC3uDa/q9YzrmpS9meYHdev7tPgM7fjM7TZsfpoOnGRYFxduUdy/XbbY4yMevNyT0fcJzEN58ooeHw2OBrhkrIyNmEu16Kxdc+uaeqSubYOHtDom9m8Q5vpa/mj7cciEa6a56qVF4Rf0/hgMXenh/7DW+Wt0FbeQCVqn6YoZPtdhluHPUBiNnUa4vGdasJXbJ3AQCoPXgNka3hz5Cyl+LGIPPpFXmoudyZTHicTDBF5ZE7yDyzv+VO9jZngebAEAwArjy4fP8yg+z9BJNX3nbM565YyR7/PYvmh7U9ti3+f45bcqmpRRvos1e8AeBPx1kSonSt4Zwt9SGjK5SfL9nLtEBvHtp7Zlii3SKy8wqU4toGDOYqbuuISildJYvEddsuwnVCzhWg==
sidebar_class_name: "put api-method"
info_path: sql-reference/rest-api/motherduck-rest-api
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";
import Admonition from '@theme/Admonition';

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Set user Ducklings"}
>
</Heading>

::::info
  This endpoint is used to configure user-specific settings, primarily for setting Duckling sizes for service accounts. 
  For a complete walkthrough of service account management, see <a href="../../../key-tasks/service-accounts-guide#step-3-set-account-ducklings-configure-compute">Service Accounts Guide - Step 3</a>.
::::

::::caution[Username Parameter]
  When configuring a service account, ensure the `username` in the path (`/v1/users/:username/instances`) is the specific username defined when creating the service account. Note: The endpoint path uses "instances" for legacy reasons but configures Ducklings (compute instances).
::::

<MethodEndpoint
  method={"put"}
  path={"/v1/users/{username}/instances"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Set user specific config such as Duckling (instance) sizes

::::note
  Authentication for this endpoint requires an Admin token. This configuration currently applies to Duckling sizes and will in the future include read scaling tokens.
::::

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"in":"path","name":"username","description":"user within the organization","schema":{"type":"string","maxLength":255,"description":"user within the organization"},"required":true}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"type":"object","properties":{"read_write":{"type":"object","properties":{"instance_size":{"type":"string","enum":["pulse","standard","jumbo","mega","giga"]},"cooldown_seconds":{"type":"number","minimum":60,"maximum":86400,"description":"Cooldown period in seconds before the duckling is shut down. Changes may take up to 30-40 seconds to propagate on existing ducklings."}},"required":["instance_size"]},"read_scaling":{"type":"object","properties":{"instance_size":{"type":"string","enum":["pulse","standard","jumbo"]},"flock_size":{"type":"number","minimum":1,"maximum":16},"cooldown_seconds":{"type":"number","minimum":60,"maximum":86400,"description":"Cooldown period in seconds before the duckling is shut down. Changes may take up to 30-40 seconds to propagate on existing ducklings."}},"required":["instance_size","flock_size"]}},"required":["read_write","read_scaling"]}},"required":["config"]}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"read_write":{"type":"object","properties":{"instance_size":{"type":"string","enum":["pulse","standard","jumbo","mega","giga"]},"cooldown_seconds":{"type":"number","minimum":60,"maximum":86400,"description":"Cooldown period in seconds before the duckling is shut down."}},"required":["instance_size"]},"read_scaling":{"type":"object","properties":{"instance_size":{"type":"string","enum":["pulse","standard","jumbo"]},"flock_size":{"type":"number","minimum":1,"maximum":16},"cooldown_seconds":{"type":"number","minimum":60,"maximum":86400,"description":"Cooldown period in seconds before the duckling is shut down."}},"required":["instance_size","flock_size"]}},"required":["read_write","read_scaling"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Bad Request"},"code":{"type":"string","description":"The error code","example":"BAD_REQUEST"},"issues":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"description":"An array of issues that were responsible for the error","example":[]}},"required":["message","code"],"title":"Bad Request error (400)","description":"The error information","example":{"code":"BAD_REQUEST","message":"Bad Request","issues":[]}}}}},"401":{"description":"Invalid Credentials","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Invalid Credentials"},"code":{"type":"string","description":"The error code","example":"UNAUTHORIZED"},"issues":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"description":"An array of issues that were responsible for the error","example":[]}},"required":["message","code"],"title":"Invalid Credentials error (401)","description":"The error information","example":{"code":"UNAUTHORIZED","message":"Invalid Credentials","issues":[]}}}}},"403":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Unauthorized"},"code":{"type":"string","description":"The error code","example":"FORBIDDEN"},"issues":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"description":"An array of issues that were responsible for the error","example":[]}},"required":["message","code"],"title":"Unauthorized error (403)","description":"The error information","example":{"code":"FORBIDDEN","message":"Unauthorized","issues":[]}}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Not Found"},"code":{"type":"string","description":"The error code","example":"NOT_FOUND"},"issues":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"description":"An array of issues that were responsible for the error","example":[]}},"required":["message","code"],"title":"Not Found error (404)","description":"The error information","example":{"code":"NOT_FOUND","message":"Not Found","issues":[]}}}}},"500":{"description":"Internal Error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Internal Error"},"code":{"type":"string","description":"The error code","example":"INTERNAL_SERVER_ERROR"},"issues":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"description":"An array of issues that were responsible for the error","example":[]}},"required":["message","code"],"title":"Internal Error error (500)","description":"The error information","example":{"code":"INTERNAL_SERVER_ERROR","message":"Internal Error","issues":[]}}}}}}}
>
  
</StatusCodes>


      
