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

# Update member settings

> Changes a member's Grid spend limit in a team.



## OpenAPI

````yaml patch /v1/grid/team_settings/users/{user_id}
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/grid/team_settings/users/{user_id}:
    parameters:
      - $ref: '#/components/parameters/user_id'
    patch:
      summary: Updates a user's Grid settings by team ID or your only team
      description: >-
        Changes only the fields in the request. Once the user's metered spend in
        the team in a month reaches the spend limit, requests with Routes keys
        they created in the team are rejected until the limit is raised or the
        next month starts. Spend is metered every 15 minutes and can lag, so a
        user can go over the limit. Requires team admin for the specified team
        or organization admin. The team comes from `team_id` instead of the
        path. Omit it to use the team you belong to; when you belong to several,
        the request fails with a 400.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateGridUserSettingsRequestV1'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GridTeamUserSettingsV1'
      x-codeSamples:
        - lang: bash
          source: |-
            curl --request PATCH \
            --url https://api.baseten.co/v1/grid/team_settings/users/{user_id} \
            --header "Authorization: Bearer $BASETEN_API_KEY" \
            --data '{
              "spend_limit": null,
              "team_id": "abc1234"
            }'
        - lang: python
          source: |-
            import requests
            import os
            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
            url = "https://api.baseten.co/v1/grid/team_settings/users/{user_id}"

            headers = {"Authorization": f"Bearer {API_KEY}"}

            response = requests.request(
                "PATCH",
                url,
                headers=headers,
                json={'spend_limit': None, 'team_id': 'abc1234'}
            )

            print(response.text)
components:
  parameters:
    user_id:
      schema:
        type: string
      name: user_id
      in: path
      required: true
  schemas:
    UpdateGridUserSettingsRequestV1:
      additionalProperties: false
      minProperties: 1
      properties:
        spend_limit:
          anyOf:
            - $ref: '#/components/schemas/UpdateGridSpendLimitSettingV1'
            - type: 'null'
          default: null
          description: >-
            Spend limit fields to change. Pass null to remove the user's limit;
            omit to leave it unchanged.
          x-null-distinct: true
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            ID of the team. When omitted, the team you belong to; required when
            you belong to several.
          examples:
            - abc1234
          title: Team Id
      title: UpdateGridUserSettingsRequestV1
      type: object
    GridTeamUserSettingsV1:
      properties:
        team_id:
          description: ID of the team.
          examples:
            - abc1234
          title: Team Id
          type: string
        team_name:
          description: Name of the team.
          examples:
            - Engineering
          title: Team Name
          type: string
        user_id:
          description: ID of the user.
          examples:
            - abc1234
          title: User Id
          type: string
        email:
          anyOf:
            - type: string
            - type: 'null'
          description: Email address of the user.
          examples:
            - dev@example.com
          title: Email
        spend_limit:
          $ref: '#/components/schemas/GridSpendLimitSettingV1'
          description: >-
            Spend limit for Baseten Grid in the team. Applies to requests with
            Routes keys the user created in the team; personal API keys are not
            limited.
        month_spend_usd:
          description: >-
            The user's metered Grid spend in USD in the team this UTC calendar
            month, returned as an exact decimal string.
          examples:
            - '12.5'
          title: Month Spend Usd
          type: string
        is_blocked:
          description: >-
            Whether the user's spend this month reached their limit, or the
            team's spend reached its team-wide limit, so requests with Routes
            keys they created in the team are rejected.
          title: Is Blocked
          type: boolean
        blocked_by:
          anyOf:
            - $ref: '#/components/schemas/GridSpendBlockedByV1'
            - type: 'null'
          description: >-
            `member` when the user's spend this month reached their limit,
            `team` when the team's spend reached its team-wide limit. Null when
            the user is not blocked.
      required:
        - team_id
        - team_name
        - user_id
        - email
        - spend_limit
        - month_spend_usd
        - is_blocked
        - blocked_by
      title: GridTeamUserSettingsV1
      type: object
    UpdateGridSpendLimitSettingV1:
      additionalProperties: false
      minProperties: 1
      properties:
        user_monthly_limit_usd:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Standing spend limit in USD for each UTC calendar month. Send null
            to remove the limit; omit to leave it unchanged.
          examples:
            - '200'
          title: User Monthly Limit Usd
          x-null-distinct: true
        month_override_usd:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Spend limit in USD for the current UTC calendar month, which
            supersedes the standing limit. Send null to remove it; omit to leave
            it unchanged.
          examples:
            - '300'
          title: Month Override Usd
          x-null-distinct: true
      title: UpdateGridSpendLimitSettingV1
      type: object
    GridSpendLimitSettingV1:
      properties:
        user_monthly_limit_usd:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Standing spend limit in USD for each UTC calendar month set on the
            user in the team. Null when the user has no limit of their own
            there.
          examples:
            - '200'
          title: User Monthly Limit Usd
        month_override_usd:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Spend limit in USD for the current UTC calendar month set on the
            user in the team, which supersedes their standing limit. Null when
            there is none.
          examples:
            - '300'
          title: Month Override Usd
        team_default:
          anyOf:
            - $ref: '#/components/schemas/GridSpendLimitTeamDefaultV1'
            - type: 'null'
          description: >-
            Per-member limit of the team. This limit applies when the user has
            no limit of their own. Null when there is none.
        effective:
          $ref: '#/components/schemas/GridEffectiveSpendLimitV1'
          description: The effective limit enforced for the current month.
        team_wide_monthly_limit_usd:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Team-wide limit of the team in USD for each UTC calendar month. Once
            all members' spend in the team reaches it, the user's requests in
            the team are rejected whatever their own limit. Null when there is
            none.
          examples:
            - '5000'
          title: Team Wide Monthly Limit Usd
      required:
        - user_monthly_limit_usd
        - month_override_usd
        - team_default
        - effective
        - team_wide_monthly_limit_usd
      title: GridSpendLimitSettingV1
      type: object
    GridSpendBlockedByV1:
      enum:
        - member
        - team
      title: GridSpendBlockedByV1
      type: string
    GridSpendLimitTeamDefaultV1:
      properties:
        team_id:
          description: ID of the team whose per-member limit this is.
          examples:
            - abc1234
          title: Team Id
          type: string
        team_name:
          description: Name of the team.
          examples:
            - Engineering
          title: Team Name
          type: string
        per_member_monthly_limit_usd:
          description: >-
            The team's per-member spend limit in USD for each UTC calendar
            month.
          examples:
            - '100'
          title: Per Member Monthly Limit Usd
          type: string
      required:
        - team_id
        - team_name
        - per_member_monthly_limit_usd
      title: GridSpendLimitTeamDefaultV1
      type: object
    GridEffectiveSpendLimitV1:
      properties:
        monthly_limit_usd:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Spend limit in USD enforced for the current UTC calendar month: the
            user's own limit, else the team default. Null when no limit applies.
          examples:
            - '200'
          title: Monthly Limit Usd
        source:
          anyOf:
            - $ref: '#/components/schemas/GridSettingSourceV1'
            - type: 'null'
          description: >-
            Where the limit comes from: `user` when it is set on the user,
            `team` when it is the team default. Null when no limit applies.
      required:
        - monthly_limit_usd
        - source
      title: GridEffectiveSpendLimitV1
      type: object
    GridSettingSourceV1:
      enum:
        - user
        - team
      title: GridSettingSourceV1
      type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````