# Status Codes

> HTTP status codes and response formats for the WayinVideo API.

## Status Codes

The API uses standard HTTP status codes. The response body format depends on the status code.

---

## 200 OK

The request succeeded. The response body is JSON containing only the payload in `data`.

**Example**

```json
{
  "data": {
    "project_id": "prj06928fdjqqaza",
    "name": "Sample project name",
    "status": "SUCCEEDED"
  }
}
```

The structure of `data` varies by endpoint. See each API’s documentation for the exact fields.

---

## 400 Bad Request

A client-side error occurred — for example, invalid parameters, an unsupported video format, or other input issues. Review the `message` field, correct the request, and retry.

| Field | Type | Description |
|-------|------|-------------|
| `trace_id` | string | Unique identifier for diagnostics and support |
| `message` | string | Human-readable error description |

**Example**

```json
{
  "message": "the error message",
  "trace_id": "the_trace_id"
}
```

---

## Insufficient API Units

When the account does not have enough API Units to submit a task, the API returns **400 Bad Request**. No task is created and no units are deducted. The body uses `message` and `trace_id`.

**Example**

```json
{
  "message": "Your API units are insufficient. Please purchase more to continue: https://wayin.ai/wayinvideo/api-dashboard",
  "trace_id": "the_trace_id"
}
```

Rates are on the [Billing](https://wayin.ai/api-docs/pricing/) page.

---

## 500 Internal Server Error

A server-side error occurred — an internal failure or unexpected server-side error. If the issue persists, contact support with the `trace_id`.

| Field | Type | Description |
|-------|------|-------------|
| `trace_id` | string | Unique identifier for diagnostics and support |
| `message` | string | Human-readable error description |

**Example**

```json
{
  "message": "the error message",
  "trace_id": "the_trace_id"
}
```

---

## 403 Forbidden

Authentication failed (invalid or missing API key). The response body includes:

| Field | Type | Description |
|-------|------|-------------|
| `timestamp` | string | Time of the response (ISO 8601) |
| `status` | number | HTTP status code (403) |
| `error` | string | Short error type (e.g. `"Forbidden"`) |
| `path` | string | Request path |

**Example**

```json
{
  "timestamp": "2026-03-13T07:58:46.156+00:00",
  "status": 403,
  "error": "Forbidden",
  "path": "/api/v2/clips"
}
```

---

## 429 Too Many Requests

The request was rejected due to rate limits or concurrency limits. The response body uses the same format as 403: `timestamp`, `status`, `error`, `path`.

**Example**

```json
{
  "timestamp": "2026-03-10T15:52:01.610+00:00",
  "status": 429,
  "error": "Too Many Requests",
  "path": "/api/v2/clips/results/prjxxx"
}
```

See [Rate Limits](https://wayin.ai/api-docs/rate-limits/) for limit values and how to avoid 429.
