# POST /update_sandbox_settings

Source: https://heyeveryone.ai/docs/api/update_sandbox_settings

> https://heyeveryone.ai/api/v1/update_sandbox_settings

## Operation

```json
{
  "post": {
    "description": "Change how a Sandbox account behaves, to rehearse failures. `failNext` makes the next `times` publishes (default 1) fail with `error`, then clears itself (null clears it now); with timeout_after_send the post DOES go live but the answer is lost. `tokenExpired` makes health checks ask for a reconnect and publishing fail with auth_expired. `latencyMs` slows every response. `creatorInfo` (accounts that behave like TikTok) sets what TikTok's creator info answers: comments, Duet or Stitch turned off by the creator, maxVideoPostDurationSec, privacyLevelOptions, or `cannotPost` (the creator can't post right now); null goes back to TikTok's defaults. Only fields you pass change. Works only on Sandbox accounts.",
    "operationId": "update_sandbox_settings",
    "requestBody": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "workspaceId": {
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                "type": "string"
              },
              "channelAccountId": {
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                "type": "string"
              },
              "failNext": {
                "anyOf": [
                  {
                    "properties": {
                      "error": {
                        "enum": [
                          "auth_expired",
                          "rate_limited",
                          "rejected_content",
                          "media_unsupported",
                          "platform_error",
                          "timeout_after_send",
                          "not_permitted"
                        ],
                        "type": "string"
                      },
                      "times": {
                        "default": 1,
                        "maximum": 100,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "message": {
                        "maxLength": 500,
                        "minLength": 1,
                        "type": "string"
                      }
                    },
                    "required": [
                      "error"
                    ],
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tokenExpired": {
                "type": "boolean"
              },
              "latencyMs": {
                "maximum": 60000,
                "minimum": 0,
                "type": "integer"
              },
              "creatorInfo": {
                "anyOf": [
                  {
                    "properties": {
                      "commentDisabled": {
                        "type": "boolean"
                      },
                      "duetDisabled": {
                        "type": "boolean"
                      },
                      "stitchDisabled": {
                        "type": "boolean"
                      },
                      "maxVideoPostDurationSec": {
                        "maximum": 3600,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "privacyLevelOptions": {
                        "items": {
                          "enum": [
                            "PUBLIC_TO_EVERYONE",
                            "MUTUAL_FOLLOW_FRIENDS",
                            "FOLLOWER_OF_CREATOR",
                            "SELF_ONLY"
                          ],
                          "type": "string"
                        },
                        "minItems": 1,
                        "type": "array"
                      },
                      "cannotPost": {
                        "anyOf": [
                          {
                            "enum": [
                              "spam_risk_too_many_posts",
                              "spam_risk_user_banned_from_posting",
                              "reached_active_user_cap"
                            ],
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "workspaceId",
              "channelAccountId"
            ],
            "type": "object"
          }
        }
      },
      "required": true
    },
    "responses": {
      "200": {
        "content": {
          "application/json": {
            "schema": {
              "additionalProperties": false,
              "properties": {
                "settings": {
                  "additionalProperties": false,
                  "properties": {
                    "failNext": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "properties": {
                            "error": {
                              "enum": [
                                "auth_expired",
                                "rate_limited",
                                "rejected_content",
                                "media_unsupported",
                                "platform_error",
                                "timeout_after_send",
                                "not_permitted"
                              ],
                              "type": "string"
                            },
                            "remaining": {
                              "maximum": 100,
                              "minimum": 1,
                              "type": "integer"
                            },
                            "message": {
                              "maxLength": 500,
                              "type": "string"
                            }
                          },
                          "required": [
                            "error",
                            "remaining"
                          ],
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null
                    },
                    "tokenExpired": {
                      "default": false,
                      "type": "boolean"
                    },
                    "latencyMs": {
                      "default": 0,
                      "maximum": 60000,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "creatorInfo": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "properties": {
                            "commentDisabled": {
                              "type": "boolean"
                            },
                            "duetDisabled": {
                              "type": "boolean"
                            },
                            "stitchDisabled": {
                              "type": "boolean"
                            },
                            "maxVideoPostDurationSec": {
                              "maximum": 3600,
                              "minimum": 1,
                              "type": "integer"
                            },
                            "privacyLevelOptions": {
                              "items": {
                                "enum": [
                                  "PUBLIC_TO_EVERYONE",
                                  "MUTUAL_FOLLOW_FRIENDS",
                                  "FOLLOWER_OF_CREATOR",
                                  "SELF_ONLY"
                                ],
                                "type": "string"
                              },
                              "minItems": 1,
                              "type": "array"
                            },
                            "cannotPost": {
                              "anyOf": [
                                {
                                  "enum": [
                                    "spam_risk_too_many_posts",
                                    "spam_risk_user_banned_from_posting",
                                    "reached_active_user_cap"
                                  ],
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null
                    }
                  },
                  "required": [
                    "failNext",
                    "tokenExpired",
                    "latencyMs",
                    "creatorInfo"
                  ],
                  "type": "object"
                }
              },
              "required": [
                "settings"
              ],
              "type": "object"
            }
          }
        },
        "description": "Success"
      },
      "400": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "invalid_input: the body does not match the schema"
      },
      "401": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "unauthenticated: missing, invalid, expired or revoked token"
      },
      "403": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "forbidden: the agent may not do this (for example, another workspace)"
      },
      "404": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "not_found"
      },
      "409": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "conflict"
      },
      "422": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Service-specific errors: not_sandbox"
      },
      "429": {
        "$ref": "#/components/responses/RateLimited"
      },
      "500": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "internal_error"
      }
    },
    "summary": "Set Sandbox failure switches",
    "tags": [
      "workspace"
    ],
    "x-heyeveryone-kind": "mutation"
  }
}
```

## Referenced definitions

```json
{
  "schemas": {
    "Error": {
      "properties": {
        "error": {
          "description": "A stable error code, for example forbidden.",
          "type": "string"
        },
        "message": {
          "description": "What went wrong, in plain words.",
          "type": "string"
        }
      },
      "required": [
        "error",
        "message"
      ],
      "type": "object"
    }
  },
  "responses": {
    "RateLimited": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "rate_limited: too many requests from this agent, account or address (docs/setup/agents.md, Rate limits); wait the Retry-After seconds, then retry",
      "headers": {
        "Retry-After": {
          "description": "Seconds to wait before retrying.",
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    }
  }
}
```

## Authentication

```json
{
  "bearer": {
    "description": "Personal access token (hey_pat_...)",
    "scheme": "bearer",
    "type": "http"
  },
  "oauth": {
    "flows": {
      "authorizationCode": {
        "authorizationUrl": "https://heyeveryone.ai/oauth/authorize",
        "refreshUrl": "https://heyeveryone.ai/oauth/token",
        "scopes": {
          "agent": "Act as your agent in the workspaces you choose"
        },
        "tokenUrl": "https://heyeveryone.ai/oauth/token"
      }
    },
    "type": "oauth2"
  }
}
```

## Security requirements

```json
[
  {
    "bearer": []
  },
  {
    "oauth": [
      "agent"
    ]
  }
]
```
