# Update member budget caps

PUT //localhost:8080/api/v1/policies/member-budget-caps
Content-Type: application/json

Update member budget caps (Team+). Free/Pro return 403 (10-policies.md endpoint 15).

Reference: https://api.alephant.io/api-reference/saa-s-api/policies/update-member-budget-caps

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: saas-openapi
  version: 1.0.0
paths:
  /api/v1/policies/member-budget-caps:
    put:
      operationId: update-member-budget-caps
      summary: Update member budget caps
      description: >-
        Update member budget caps (Team+). Free/Pro return 403 (10-policies.md
        endpoint 15).
      tags:
        - subpackage_policies
      responses:
        '200':
          description: 'data: MemberBudgetCapsResponse'
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Policies_updateMemberBudgetCaps_Response_200
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_alephant_backend-saas-service_internal_api_dto.APIErrorBody
        '403':
          description: TIER_FEATURE_DISABLED
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_alephant_backend-saas-service_internal_api_dto.APIErrorBody
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_alephant_backend-saas-service_internal_api_dto.APIErrorBody
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_alephant_backend-saas-service_internal_api_dto.APIErrorBody
      requestBody:
        description: Enabled, config, member overrides
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github_com_alephant_backend-saas-service_internal_api_dto.MemberBudgetCapsRequest
servers:
  - url: //localhost:8080
components:
  schemas:
    github_com_alephant_backend-saas-service_internal_api_dto.MemberBudgetCapsConfig:
      type: object
      properties:
        allowMemberOverride:
          type: boolean
        currency:
          type: string
        defaultCap:
          type: number
          format: double
        onExceed:
          type: string
        period:
          type: string
      title: >-
        github_com_alephant_backend-saas-service_internal_api_dto.MemberBudgetCapsConfig
    github_com_alephant_backend-saas-service_internal_api_dto.MemberOverrideInput:
      type: object
      properties:
        cap:
          type: number
          format: double
        memberId:
          type: string
      title: >-
        github_com_alephant_backend-saas-service_internal_api_dto.MemberOverrideInput
    github_com_alephant_backend-saas-service_internal_api_dto.MemberBudgetCapsRequest:
      type: object
      properties:
        config:
          $ref: >-
            #/components/schemas/github_com_alephant_backend-saas-service_internal_api_dto.MemberBudgetCapsConfig
        enabled:
          type: boolean
        memberOverrides:
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_alephant_backend-saas-service_internal_api_dto.MemberOverrideInput
      title: >-
        github_com_alephant_backend-saas-service_internal_api_dto.MemberBudgetCapsRequest
    Policies_updateMemberBudgetCaps_Response_200:
      type: object
      properties: {}
      title: Policies_updateMemberBudgetCaps_Response_200
    github_com_alephant_backend-saas-service_internal_api_dto.APIErrorBody:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
      title: github_com_alephant_backend-saas-service_internal_api_dto.APIErrorBody

```

## SDK Code Examples

```python
import requests

url = "https://localhost:8080/api/v1/policies/member-budget-caps"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://localhost:8080/api/v1/policies/member-budget-caps';
const options = {method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{}'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://localhost:8080/api/v1/policies/member-budget-caps"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://localhost:8080/api/v1/policies/member-budget-caps")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://localhost:8080/api/v1/policies/member-budget-caps")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://localhost:8080/api/v1/policies/member-budget-caps', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://localhost:8080/api/v1/policies/member-budget-caps");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://localhost:8080/api/v1/policies/member-budget-caps")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```