> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/api/preparation/status-code.md).

# 狀態碼

在透過 API 送出 HTTP 請求時，可使用以下狀態碼查看 API 請求成功與否：

## 狀態碼說明

### 正確代碼

| 狀態碼 | 說明     |
| --- | ------ |
| 200 | 請求成功   |
| 201 | 資源成功建立 |

#### 正確回應範例

{% hint style="info" %}
此處為內容示範，不同端點的回傳格式內容可能有差異，請以該端點的說明文件參考為主
{% endhint %}

```json
{
  "count": "integer",
  "next": "string|null",
  "previous": "string|null",
  "results": [
    // 結果回傳內容
  ]
}
```

### 錯誤代碼

| 狀態碼 | 說明     |
| --- | ------ |
| 400 | 請求格式錯誤 |
| 401 | 認證失敗   |
| 403 | 權限不足   |
| 404 | 資源不存在  |
| 500 | 伺服器錯誤  |

#### 錯誤回應範例

#### 400 - 請求錯誤：必填欄位缺失

```javascript
{
  "files": ["This field is required."],
  "filename": ["This field is required."],
  "file": ["This field is required."]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/api/preparation/status-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
