> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAPI Conventions

> Base URL, naming, timestamps, pagination, errors, and authentication for Teams OpenAPI.

These rules apply to all Teams OpenAPI endpoints unless an endpoint doc says otherwise.

## Base URL

Production:

`https://api.qoder.com`

Example full URL:

`https://api.qoder.com/v1/organizations/{organization_id}/members`

## Field naming

JSON uses **lowerCamelCase**, for example:

`organizationId`, `repositoryUrl`, `createdAt`, `maxResults`, `nextToken`

## Timestamps

Use **ISO 8601 (RFC 3339)**, e.g. `2025-01-01T00:00:00Z`. Some query parameters also accept **Unix time in milliseconds**—check each endpoint.

## Cursor pagination

List endpoints typically use **cursor** pagination:

### Query parameters

| Parameter    | Type    | Required | Default | Description                                               |
| ------------ | ------- | -------- | ------- | --------------------------------------------------------- |
| `maxResults` | integer | No       | 20      | Page size, max **100**                                    |
| `nextToken`  | string  | No       | —       | Cursor from the previous response; omit on the first page |

Usage endpoints use **`nextToken`** for cursor pagination unless an endpoint says otherwise.

### Response fields

| Field        | Type    | Description                                              |
| ------------ | ------- | -------------------------------------------------------- |
| `maxResults` | integer | Page size used for this response                         |
| `nextToken`  | string  | Next page cursor; **empty or omitted** means end of list |

<Note>
  Do not rely on a global `totalCount`; page until the cursor is empty.
</Note>

## Error responses

On failure, HTTP status is non-2xx and the body is JSON **without** a top-level `status` field. Shape:

```json theme={null}
{
  "requestId": "req_abc123",
  "code": "NotFound",
  "message": "resource not found",
  "details": ["the requested resource does not exist"]
}
```

### Error object fields

| Field       | Type   | Required | Description                                    |
| ----------- | ------ | -------- | ---------------------------------------------- |
| `requestId` | string | Yes      | Correlation ID—include when contacting support |
| `code`      | string | Yes      | Stable code for programmatic handling          |
| `message`   | string | Yes      | Human-readable summary                         |
| `details`   | array  | No       | Optional extra context                         |

### Common HTTP status and `code` values

| HTTP | Example `code`  | Meaning                              |
| ---- | --------------- | ------------------------------------ |
| 400  | `BadRequest`    | Invalid input                        |
| 401  | `Unauthorized`  | Missing or invalid API key           |
| 403  | `Forbidden`     | Not allowed for this org or resource |
| 404  | `NotFound`      | Resource not found                   |
| 409  | `AlreadyExists` | Conflict                             |
| 500  | `InternalError` | Server error                         |

<Note>
  After gateway or service mapping, the pair of HTTP status and `code` is defined by the **actual response**—do not rely on status alone.
</Note>

## Authentication

Send:

```http theme={null}
Authorization: Bearer <api_key>
```

Use the key created in the console. Never ship real keys in public clients or repositories.

## Organization path prefix

Most routes extend:

`/v1/organizations/{organization_id}`

`organization_id` is a path parameter. See **Member**, **Usage**, and **AI code metrics** sections for subpaths.
