Skip to content

Docs

POST /connect_sandbox_account

https://heyeveryone.ai/api/v1/connect_sandbox_account

Operation

{
  "post": {
    "description": "Connect a Sandbox account: heyeveryone's own test network, which behaves like a real social network but posts only to a public test feed page (feedUrl) inside heyeveryone. For trying scheduling and publishing end to end, demos, or before any real channel is connected; no sign-in is needed. Each call creates a new account named `label`. `emulates` makes it follow that platform's post formats, text limits, media rules, required settings and result metrics, with format ids prefixed by the platform (x__text, x__thread, tiktok__video, youtube__short...; list them with get_channel_capabilities { platform: 'sandbox', emulates }). It never posts to the real platform, and what it emulates is fixed once connected. Failure switches (fail the next publish, expire the token, slow responses): update_sandbox_settings. With emulates 'linkedin', accountType 'page' stands in for a LinkedIn company page (named \"LinkedIn company page (Sandbox)\" by default); the formats are the same.",
    "operationId": "connect_sandbox_account",
    "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"
              },
              "label": {
                "maxLength": 60,
                "minLength": 1,
                "type": "string"
              },
              "emulates": {
                "anyOf": [
                  {
                    "enum": [
                      "x",
                      "linkedin",
                      "threads",
                      "bluesky",
                      "instagram",
                      "facebook",
                      "tiktok",
                      "youtube"
                    ],
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "accountType": {
                "pattern": "^[a-z][a-z_]{0,30}$",
                "type": "string"
              }
            },
            "required": [
              "workspaceId"
            ],
            "type": "object"
          }
        }
      },
      "required": true
    },
    "responses": {
      "200": {
        "content": {
          "application/json": {
            "schema": {
              "additionalProperties": false,
              "properties": {
                "channelAccount": {
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "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"
                    },
                    "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"
                    },
                    "platform": {
                      "enum": [
                        "x",
                        "linkedin",
                        "threads",
                        "bluesky",
                        "instagram",
                        "facebook",
                        "tiktok",
                        "youtube",
                        "sandbox"
                      ],
                      "type": "string"
                    },
                    "externalId": {
                      "type": "string"
                    },
                    "handle": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "avatarUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "accountType": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "enum": [
                        "active",
                        "reconnect_required",
                        "disconnected"
                      ],
                      "type": "string"
                    },
                    "statusReason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scopes": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "tokenExpiresAt": {
                      "anyOf": [
                        {
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastHealthCheckAt": {
                      "anyOf": [
                        {
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "metadata": {
                      "additionalProperties": {},
                      "propertyNames": {
                        "type": "string"
                      },
                      "type": "object"
                    },
                    "createdByAccountId": {
                      "anyOf": [
                        {
                          "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"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdByAgentClientId": {
                      "anyOf": [
                        {
                          "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"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                      "type": "string"
                    },
                    "updatedAt": {
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                      "type": "string"
                    },
                    "platformLabel": {
                      "type": "string"
                    },
                    "access": {
                      "enum": [
                        "available",
                        "pending_review",
                        "private_only"
                      ],
                      "type": "string"
                    },
                    "feedUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "emulates": {
                      "anyOf": [
                        {
                          "enum": [
                            "x",
                            "linkedin",
                            "threads",
                            "bluesky",
                            "instagram",
                            "facebook",
                            "tiktok",
                            "youtube"
                          ],
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "workspaceId",
                    "platform",
                    "externalId",
                    "handle",
                    "displayName",
                    "avatarUrl",
                    "accountType",
                    "status",
                    "statusReason",
                    "scopes",
                    "tokenExpiresAt",
                    "lastHealthCheckAt",
                    "metadata",
                    "createdByAccountId",
                    "createdByAgentClientId",
                    "createdAt",
                    "updatedAt",
                    "platformLabel",
                    "access",
                    "feedUrl",
                    "emulates"
                  ],
                  "type": "object"
                }
              },
              "required": [
                "channelAccount"
              ],
              "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: plan_limit_reached"
      },
      "429": {
        "$ref": "#/components/responses/RateLimited"
      },
      "500": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "internal_error"
      }
    },
    "summary": "Connect a Sandbox account",
    "tags": [
      "workspace"
    ],
    "x-heyeveryone-kind": "mutation"
  }
}

Referenced definitions

{
  "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

{
  "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

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