Source: https://developers.tokportal.com/overview/
Markdown: https://developers.tokportal.com/overview.md

# Overview

The TokPortal API lets you programmatically create geo-targeted TikTok and Instagram account/video workflows, configure content, publish bundles, receive webhooks, and read analytics.

The public API covers the developer workflow documented here. Some dashboard-only or future features may not be exposed yet.

## Base URL

All API requests are made to:

```
https://app.tokportal.com/api/ext
```

Current public API version: `2026-05-25`. Every response includes `X-TokPortal-API-Version` and `X-TokPortal-API-Stability`; see [Versioning & Stability](https://developers.tokportal.com/versioning).

## Key Concepts

- **Multi-platform** — Manage TikTok and Instagram workflows from a single API.
- **Credit-based billing** — Operations consume credits. The same credit balance is shared between the API and the web UI. See [Credits & Pricing](https://developers.tokportal.com/credits) for details.
- **Documented public surface** — Create bundles, upload media, configure videos, publish, configure webhooks, and pull analytics through the endpoints in this reference.

## Response Format

All responses return JSON.

**Success responses** wrap the payload in a `data` key:

```json
{
  "data": {
    "email": "you@example.com",
    "credits": 1250
  }
}
```

**Error responses** return an `error` object with a machine-readable `code`, a human-readable `message`, and optional `details`:

```json
{
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "Not enough credits to complete this operation.",
    "details": {
      "required": 50,
      "available": 12
    }
  }
}
```

See [Errors](https://developers.tokportal.com/errors) for the full list of error codes.

## Authentication

Include your API key in the `X-API-Key` header on every request. See [Authentication](https://developers.tokportal.com/authentication) for details.

## Quick Example

Verify your API key and check your account info with a single call:

```bash
curl -X GET https://app.tokportal.com/api/ext/me \
  -H "X-API-Key: sk_xxx"
```

**Response:**

```json
{
  "data": {
    "email": "you@example.com",
    "credits": 1250,
    "plan": "pro",
    "created_at": "2025-09-15T10:30:00Z"
  }
}
```

## What's Next

| Topic                                                                    | Description                                                                                           |
| ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| [Authentication](https://developers.tokportal.com/authentication)        | API key setup and security best practices                                                             |
| [Credits & Pricing](https://developers.tokportal.com/credits)            | Credit costs per operation and balance endpoints                                                      |
| [Sandbox (dry run)](https://developers.tokportal.com/sandbox)            | Simulate any write for free: real validation, real errors, the real price, nothing created or charged |
| [Errors](https://developers.tokportal.com/errors)                        | Full error code reference                                                                             |
| [Rate Limits & Pagination](https://developers.tokportal.com/rate-limits) | Throttling, pagination, and idempotency                                                               |
| [Versioning & Stability](https://developers.tokportal.com/versioning)    | API version headers, compatibility policy, and deprecations                                           |
