## PATCH /v1/account/settings

Merge changes into your account settings. A section you leave out keeps its value, and `null` removes a value so its default applies. Only a GitHub administrator can change the budget ceiling.

Required permissions: write:defaults.
API key: Cannot set budget_ceiling to a non-null value; those changes require a CLI user token belonging to an account administrator.
CLI user token: Requires an account administrator when setting budget_ceiling to a non-null value.
Session token: Not supported by session tokens, even with permissions.ellipsis enabled.
Higher permission levels include lower levels: read < write < delete.

### Request

```text
{
  "analytics": {
    "enabled": bool
  },
  "budget_ceiling": {
    "session": int
  },
  "code_review": {
    "default_repository_id": int
  },
  "data_retention": {
    "archive_inactive_sessions_days": int,
    "environment_snapshots_days": int,
    "session_logs_days": int
  },
  "notifications": {
    "email_contacts": [
      {
        "email": str
      }
    ]
  }
}
```

### Response

```text
{
  "analytics": {
    "enabled": bool
  },
  "budget_ceiling": {
    "session": int
  },
  "code_review": {
    "default_repository_id": int
  },
  "data_retention": {
    "archive_inactive_sessions_days": int,
    "environment_snapshots_days": int,
    "session_logs_days": int
  },
  "mention": {
    "require_leading_mention": bool,
    "trigger_on_bot_mention_private_repo": bool,
    "trigger_on_bot_mention_public_repo": bool,
    "trigger_on_leading_ellipsis_symbol": bool,
    "trigger_on_user_mention_private_repo": bool,
    "trigger_on_user_mention_public_repo": bool
  },
  "notifications": {
    "email_contacts": [
      {
        "email": str
      }
    ]
  }
}
```

### Python

```python
import os

from ellipsis import Ellipsis

client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])

result = client.account.settings.update()
print(result)
```

### TypeScript

```typescript
import { Ellipsis } from '@ellipsis-dev/sdk';

const client = new Ellipsis({
  apiKey: process.env.ELLIPSIS_API_TOKEN!,
});

const result = await client.account.settings.update();
console.log(result);
```

### cURL

```bash
curl -X PATCH "https://api.ellipsis.dev/v1/account/settings" \
  -H "Authorization: Bearer $ELLIPSIS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Request schema

```json
{
  "additionalProperties": false,
  "properties": {
    "analytics": {
      "anyOf": [
        {
          "additionalProperties": false,
          "properties": {
            "enabled": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "budget_ceiling": {
      "anyOf": [
        {
          "properties": {
            "session": {
              "anyOf": [
                {
                  "multipleOf": 1000,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "code_review": {
      "anyOf": [
        {
          "properties": {
            "default_repository_id": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "data_retention": {
      "anyOf": [
        {
          "additionalProperties": false,
          "properties": {
            "archive_inactive_sessions_days": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "environment_snapshots_days": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "session_logs_days": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "notifications": {
      "anyOf": [
        {
          "additionalProperties": false,
          "properties": {
            "email_contacts": {
              "anyOf": [
                {
                  "items": {
                    "properties": {
                      "email": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "email"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object"
}
```

### Response schema

```json
{
  "properties": {
    "analytics": {
      "properties": {
        "enabled": {
          "default": false,
          "type": "boolean"
        }
      },
      "required": [
        "enabled"
      ],
      "type": "object"
    },
    "budget_ceiling": {
      "properties": {
        "session": {
          "anyOf": [
            {
              "multipleOf": 1000,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object"
    },
    "code_review": {
      "properties": {
        "default_repository_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "default_repository_id"
      ],
      "type": "object",
      "x-ellipsis-returned-form-of": "CodeReviewSettings"
    },
    "data_retention": {
      "properties": {
        "archive_inactive_sessions_days": {
          "default": 7,
          "maximum": 90,
          "minimum": 1,
          "type": "integer"
        },
        "environment_snapshots_days": {
          "default": 7,
          "maximum": 7,
          "minimum": 1,
          "type": "integer"
        },
        "session_logs_days": {
          "default": 365,
          "maximum": 365,
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "environment_snapshots_days",
        "session_logs_days",
        "archive_inactive_sessions_days"
      ],
      "type": "object"
    },
    "mention": {
      "properties": {
        "require_leading_mention": {
          "default": false,
          "type": "boolean"
        },
        "trigger_on_bot_mention_private_repo": {
          "default": false,
          "type": "boolean"
        },
        "trigger_on_bot_mention_public_repo": {
          "default": false,
          "type": "boolean"
        },
        "trigger_on_leading_ellipsis_symbol": {
          "default": true,
          "type": "boolean"
        },
        "trigger_on_user_mention_private_repo": {
          "default": true,
          "type": "boolean"
        },
        "trigger_on_user_mention_public_repo": {
          "default": true,
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "notifications": {
      "properties": {
        "email_contacts": {
          "items": {
            "properties": {
              "email": {
                "type": "string"
              }
            },
            "required": [
              "email"
            ],
            "type": "object"
          },
          "type": "array"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "mention",
    "analytics",
    "data_retention",
    "notifications",
    "code_review"
  ],
  "type": "object"
}
```
