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

# Set Parameter Defaults

> Create or replace the saved defaults for a service, or for one of its tools

## Overview

Saves the parameters you always pass to a service, so future calls can leave them out. One row exists per scope, service and tool (or whole service); this request creates it or replaces its `defaults` in full.

At execution time the defaults are merged under the call's input. A parameter the call omits, or sends as `null` or an empty string, takes the default; any other explicit value wins. The execution response lists what was filled in under `defaults_applied`.

Defaults are identifiers and settings, never credentials. A default is refused with `400` when its key matches `secret`, `token`, `password`, `api_key`, `authorization`, `private_key` or `credential`, or when its value starts like a known secret (`sk_live_`, `sk_test_`, `rk_live_`, `rk_test_`, `whsec_`, `ghp_`, `gho_`, `github_pat_`, `xoxa-`, `xoxb-`, `xoxp-`, an `AKIA` access key id, or a JWT). Store those with [Store Credential](/api-reference/endpoint/store_credential) instead.

**Auth:** Required. API key (`danube-api-key` header) or JWT. Organization-wide defaults need the `owner` or `admin` role in that organization, or the response is `403`.

## Path Parameters

<ParamField path="service_id" type="string" required>
  The service UUID or slug. Unknown services return `404`.
</ParamField>

## Body Parameters

<ParamField body="defaults" type="object" required>
  Parameter name to value. Must be a JSON object; every key must be a non-empty string.
</ParamField>

<ParamField body="tool_id" type="string">
  Scope the row to one tool. Omit for a service-wide row.
</ParamField>

<ParamField body="scope" type="string" default="user">
  `user` for your own defaults, `org` for organization-wide defaults. Anything else is `400`.
</ParamField>

<ParamField body="org_id" type="string">
  Required when `scope` is `org`
</ParamField>

## Response

The stored row.

<ResponseField name="id" type="string">
  Row UUID
</ResponseField>

<ResponseField name="user_id" type="string">
  Your profile id for a `user` row, else `null`
</ResponseField>

<ResponseField name="org_id" type="string">
  The organization id for an `org` row, else `null`
</ResponseField>

<ResponseField name="service_id" type="string">
  The service UUID
</ResponseField>

<ResponseField name="tool_id" type="string">
  The tool UUID, or `null` for a service-wide row
</ResponseField>

<ResponseField name="defaults" type="object">
  The saved defaults
</ResponseField>

<ResponseField name="created_at" type="string">
  When the row was created
</ResponseField>

<ResponseField name="updated_at" type="string">
  When the row was last replaced
</ResponseField>

## Example

The Python and TypeScript SDKs do not wrap this endpoint yet.

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT "https://api.danubeai.com/v1/services/svc_vercel_001/parameter-defaults" \
    -H "danube-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "defaults": {"teamId": "team_acme"},
      "scope": "user"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": "pd_user_002",
    "user_id": "user_456",
    "org_id": null,
    "service_id": "svc_vercel_001",
    "tool_id": null,
    "defaults": {"teamId": "team_acme"},
    "created_at": "2026-09-12T10:04:55.000000Z",
    "updated_at": "2026-09-12T10:04:55.000000Z"
  }
  ```
</ResponseExample>

## MCP Tool

This endpoint is also available as the `set_parameter_defaults` MCP tool, which always writes `user` scope:

```python theme={null}
result = await mcp.call_tool("set_parameter_defaults", {
    "service_id": "svc_vercel_001",
    "defaults": {"teamId": "team_acme"},
    "tool_id": None
})
```
