For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.synthflow.ai/api-reference/platform-api/subaccounts/llms.txt. For full documentation content, see https://docs.synthflow.ai/api-reference/platform-api/subaccounts/llms-full.txt.

# Update a subaccount

PUT https://api.synthflow.ai/v2/subaccounts/{subaccount_id}
Content-Type: application/json



Reference: https://docs.synthflow.ai/api-reference/platform-api/subaccounts/update-subaccount

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Synthflow APIs
  version: 1.0.0
paths:
  /subaccounts/{subaccount_id}:
    put:
      operationId: update-subaccount
      summary: Update a subaccount
      description: ''
      tags:
        - ''
      parameters:
        - name: subaccount_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/subaccount_id'
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-subaccount_Response_200'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Update-subaccountRequestBadRequestError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                subaccount_name:
                  type: string
                  description: >-
                    The name for the new subaccount. This should be a unique
                    identifier that distinguishes it from other subaccounts
                    within the main account.
                invite_user_email:
                  type: string
                  description: >-
                    This is the email address of the user you wish to invite to
                    the subaccount. When this optional parameter is filled in, a
                    "sign in" link will be generated and sent back in the
                    response. The user can use this link to sign in and set up
                    their account.
                permissions:
                  $ref: >-
                    #/components/schemas/SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaPermissions
                  description: >-
                    These settings define the initial configuration for various
                    features of the subaccount
                pricing_tiers_attach:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaPricingTiersAttachItems
                  description: >-
                    Pricing tier IDs that this subaccount can choose from when
                    selecting a subscription plan.
                pricing_tiers_detach:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaPricingTiersDetachItems
                  description: >-
                    Pricing tiers will be removed from this subaccount and will
                    no longer be available for selection when choosing a
                    subscription plan.
                import_subscription:
                  $ref: >-
                    #/components/schemas/SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaImportSubscription
                  description: >-
                    This section is used when you want to import an existing
                    Stripe subscription for the subaccount
                twilio_account_sid:
                  type: string
                  description: This is the Twilio SID of the subaccount.
                twilio_auth_token:
                  type: string
                  description: This is the Twilio Token of the subaccount.
                concurrency:
                  type: integer
                  description: The maximum calls the subaccount can handle at once.
                operation_type:
                  $ref: >-
                    #/components/schemas/SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaOperationType
                  description: >-
                    The type of operation to perform. You can import objects
                    from the parent workspace to a subaccount or return objects
                    from a subaccount in some cases.
                products:
                  $ref: >-
                    #/components/schemas/SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaProducts
                  description: Objects to be imported to or returned from the subaccount_id
servers:
  - url: https://api.synthflow.ai/v2
  - url: https://api.us.synthflow.ai/v2
components:
  schemas:
    subaccount_id:
      type: string
      description: Subaccount ID.
      title: subaccount_id
    SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaPermissions:
      type: object
      properties:
        assistants:
          type: boolean
          description: If true, allows the subaccount to create agents.
        knowledge_base:
          type: boolean
          description: If true, allows the subaccount to access and use the knowledge base.
        actions:
          type: boolean
          description: If true, allows the subaccount to create and use actions.
        workflows:
          type: boolean
          description: If true, allows the subaccount to create and use workflows.
        contacts:
          type: boolean
          description: If true, allows the subaccount to create and manage contacts.
        phone_numbers:
          type: boolean
          description: If true, allows the subaccount to acquire phone numbers.
      description: >-
        These settings define the initial configuration for various features of
        the subaccount
      title: >-
        SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaPermissions
    SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaPricingTiersAttachItems:
      type: object
      properties:
        pricing_tier_id:
          type: string
          description: The ID of the Synthflow pricing tier.
      required:
        - pricing_tier_id
      title: >-
        SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaPricingTiersAttachItems
    SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaPricingTiersDetachItems:
      type: object
      properties:
        pricing_tier_id:
          type: string
          description: The ID of the Synthflow pricing tier.
      required:
        - pricing_tier_id
      title: >-
        SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaPricingTiersDetachItems
    SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaImportSubscription:
      type: object
      properties:
        stripe_subscription_id:
          type: string
          description: >-
            The ID of the existing Stripe subscription you want to import. This
            is typically used when the subaccount already has a subscription set
            up in Stripe, and you want to link it to their Synthflow account.
        synthflow_price_id:
          type: string
          description: >-
            The ID of the Synthflow pricing tier that corresponds to the
            imported Stripe subscription. This allows you to map the external
            Stripe subscription to an equivalent plan within Synthflow.
      description: >-
        This section is used when you want to import an existing Stripe
        subscription for the subaccount
      title: >-
        SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaImportSubscription
    SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaOperationType:
      type: string
      enum:
        - import
        - return
      description: >-
        The type of operation to perform. You can import objects from the parent
        workspace to a subaccount or return objects from a subaccount in some
        cases.
      title: >-
        SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaOperationType
    SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaProductsPhoneNumbersItems:
      type: object
      properties:
        number:
          type: string
          description: The E.164 formatted phone number
      title: >-
        SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaProductsPhoneNumbersItems
    SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaProducts:
      type: object
      properties:
        phone_numbers:
          type: array
          items:
            $ref: >-
              #/components/schemas/SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaProductsPhoneNumbersItems
          description: >-
            The list of numbers to be imported to or returned from the
            subaccount_id
      description: Objects to be imported to or returned from the subaccount_id
      title: >-
        SubaccountsSubaccountIdPutRequestBodyContentApplicationJsonSchemaProducts
    SubaccountsSubaccountIdPutResponsesContentApplicationJsonSchemaResponse:
      type: object
      properties:
        subaccount_id:
          $ref: '#/components/schemas/subaccount_id'
        api_key:
          type: string
        user_email:
          type: string
        sign_in_link:
          type: string
      title: SubaccountsSubaccountIdPutResponsesContentApplicationJsonSchemaResponse
    update-subaccount_Response_200:
      type: object
      properties:
        status:
          type: string
        response:
          $ref: >-
            #/components/schemas/SubaccountsSubaccountIdPutResponsesContentApplicationJsonSchemaResponse
      title: update-subaccount_Response_200
    Update-subaccountRequestBadRequestError:
      type: object
      properties: {}
      title: Update-subaccountRequestBadRequestError
  securitySchemes:
    sec0:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python
import requests

url = "https://api.synthflow.ai/v2/subaccounts/1726005822670x239735712159542050"

payload = {
    "subaccount_name": "string",
    "permissions": {
        "assistants": True,
        "knowledge_base": True,
        "actions": True
    },
    "operation_type": "import",
    "products": { "phone_numbers": [{ "number": "+12065550123" }] }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```go
package main

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

func main() {

	url := "https://api.synthflow.ai/v2/subaccounts/1726005822670x239735712159542050"

	payload := strings.NewReader("{\n  \"subaccount_name\": \"string\",\n  \"permissions\": {\n    \"assistants\": true,\n    \"knowledge_base\": true,\n    \"actions\": true\n  },\n  \"operation_type\": \"import\",\n  \"products\": {\n    \"phone_numbers\": [\n      {\n        \"number\": \"+12065550123\"\n      }\n    ]\n  }\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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://api.synthflow.ai/v2/subaccounts/1726005822670x239735712159542050")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"subaccount_name\": \"string\",\n  \"permissions\": {\n    \"assistants\": true,\n    \"knowledge_base\": true,\n    \"actions\": true\n  },\n  \"operation_type\": \"import\",\n  \"products\": {\n    \"phone_numbers\": [\n      {\n        \"number\": \"+12065550123\"\n      }\n    ]\n  }\n}"

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://api.synthflow.ai/v2/subaccounts/1726005822670x239735712159542050")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"subaccount_name\": \"string\",\n  \"permissions\": {\n    \"assistants\": true,\n    \"knowledge_base\": true,\n    \"actions\": true\n  },\n  \"operation_type\": \"import\",\n  \"products\": {\n    \"phone_numbers\": [\n      {\n        \"number\": \"+12065550123\"\n      }\n    ]\n  }\n}")
  .asString();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.synthflow.ai/v2/subaccounts/1726005822670x239735712159542050");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"subaccount_name\": \"string\",\n  \"permissions\": {\n    \"assistants\": true,\n    \"knowledge_base\": true,\n    \"actions\": true\n  },\n  \"operation_type\": \"import\",\n  \"products\": {\n    \"phone_numbers\": [\n      {\n        \"number\": \"+12065550123\"\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "subaccount_name": "string",
  "permissions": [
    "assistants": true,
    "knowledge_base": true,
    "actions": true
  ],
  "operation_type": "import",
  "products": ["phone_numbers": [["number": "+12065550123"]]]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/subaccounts/1726005822670x239735712159542050")! 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()
```