# Connect sandbox and live

> Index of all OmniSocials docs pages: https://docs.omnisocials.com/llms.txt

Connect has two environments, each with its own keys and addresses. You build in the sandbox. Live comes after we review your account once.

| Environment | Key prefix | Connect API | Posting API |
|-------------|------------|-------------|-------------|
| Sandbox | `omsk_org_test_` | `https://sandbox-api.omnisocials.com/connect/v1` | `https://sandbox-api.omnisocials.com/v1` |
| Live | `omsk_org_live_` | `https://api.omnisocials.com/connect/v1` | `https://api.omnisocials.com/v1` |

## Keys

- Create keys in the console under **API keys**. Admins and developers can create them, after they confirmed their email address. A new webhook endpoint needs a confirmed address too.
- Send the key as `Authorization: Bearer <key>`, from your server only. Never send it to a browser or a mobile app.
- A sandbox key on the live address, or a live key on the sandbox address, answers `401`. The message names the right address.
- A key belongs to the team member who made it. When that member leaves the team, is removed, or gets a role that cannot manage keys (billing or viewer), their keys stop working. Make the keys your servers use with a member who stays.

## The sandbox

- **Test accounts connect at once.** On the connect page of a sandbox link, a network connects a test account without a sign-in. The page shows that it is the sandbox.
- **Posts are simulated.** A post to a test account calls no network. It moves through `posting` to `published` like a real post.
- **Nothing reaches a real social account.**
- **Events work.** A test account that connects sends `account.connected`, and posts send their events, so you can build your webhook handler against the sandbox.
- **The sandbox is free.**

Simulated posts get no statistics, and a test account cannot be disconnected or made to need a reconnect. To start over, delete the customer: that removes its test accounts too. To test your reconnect handling, send a [test event](https://docs.omnisocials.com/connect/webhooks.md#send-a-test-event) of type `account.needs_reconnect`.

### Test a failure

Put one of these words in the caption to make the post fail on a test account:

| Word in the caption | The failure |
|---------------------|-------------|
| `[test:token_expired]` | The account's sign-in expired |
| `[test:rate_limited]` | The network refused the post for now |
| `[test:media_rejected]` | The network refused the image or video |

The failed network carries the reason on `GET /v1/posts/{id}`, and your webhook gets the post event. Use it to test your error screens and `POST /v1/posts/{id}/retry`.

## Go live

1. **Ask for live access** in the console under **Settings**, **Live access**. Give your privacy policy and your terms (both `https` links) and tell us what your customers post. Your email address must be confirmed first.
2. **We review your account once.** Until then, the request shows as in review.
3. **Create live keys** and switch your servers to the live addresses.

Live starts empty: the customers, accounts and webhook endpoints of the sandbox stay there. Create your webhook endpoints again with a live key, and your customers connect their real accounts through live connect links.

On live, a connect link's `return_url` must have an origin that is on your list in the console under **Settings**.

## What live costs

You pay per connected social account per month. Customers and posts are free, and so is the sandbox.

| Accounts in the month | Price per account per month |
|-----------------------|-----------------------------|
| 1 and 2 | Free |
| 3 to 10 | $5 |
| 11 to 100 | $2.50 |
| Above 100 | $1 |

- Each account counts by the UTC day, and the month's number is the average. An account connected for half the month counts as half an account.
- A day counts once the account worked that day. An account that was broken all day costs nothing for that day.
- For example, 10 accounts for a whole month cost $40: 2 free and 8 at $5.

The console shows the cost of the month so far under **Usage**, for admins and the billing role. There is no self-serve checkout yet: we set up billing with you.

## Close your account

An admin closes the account in the console under **Settings**, **Danger zone**. You type the name of the account and your password.

- **A sandbox account closes at once.** Its keys, customers, test accounts, posts, webhook endpoints and team are removed.
- **A live account closes 7 days later.** Until that date everything works. Every admin gets an email at once and one the day before, and every admin can cancel the close in **Settings**. On the date the keys stop working (calls answer `401`), your customers and their connected accounts are removed, scheduled posts do not go out, and you get a last invoice. Stored files go within 30 days.

A close is refused (`409 ads_running`) while an ad of one of your customers runs or waits for review: pause those ads first, so nothing keeps spending after your account is gone. For a live account, pause them before the date.

A close cannot be undone after it ran. Your customers must connect their accounts again if you come back.

The people of your team keep their sign-ins. Each person deletes their own under **Settings**, **Danger zone**, **Delete your sign-in**: they leave every team they are on, and the keys they made stop working. The owner of an account closes the account first, or asks us to hand it to a colleague.
