Skip to main content

API Reference

Complete reference for all endpoint specifications and error codes.

Base URL

All API requests are sent to the following base URL.

SaaS
https://api.agenticstar.jp
Marketplace
https://<your-domain>

Endpoint paths in this document are relative paths from the base URL.

Authentication

All API requests must include a Bearer token in the Authorization header.

Authorization: Bearer <access_token>

If the token is invalid or not specified, 401 Unauthorized is returned. Some endpoints require additional scopes. If required scopes are missing, 403 Forbidden is returned.

For details on obtaining tokens and scopes, see the Authentication Guide and Authentication Reference.

Pagination

List retrieval endpoints support cursor-based pagination.

ParameterTypeDescription
limitinteger1Number of items per page。Default values and limits vary by endpoint
cursorstring次のページを取得するためのカーソルValue。Included in previous response cursor specify as is
orderstringSort order。"asc"(昇順)or "desc"(降順、Default)

The response includes a hasMore field. If true, you can obtain the next page by passing the cursor value to the next request.

curl
# 1 page
curl https://api.agenticstar.jp/v1/conversations?limit=10 \
-H "Authorization: Bearer <access_token>"

# 2 page(Response cursor Valueを使用)
curl https://api.agenticstar.jp/v1/conversations?limit=10&cursor=2025-01-15T10:30:00.000Z \
-H "Authorization: Bearer <access_token>"

Currently, only GET /v1/conversations supports cursor-based pagination. For other endpoints, hasMore is always false.

Chat

OpenAI-compatible Chat Completions API. Agent interactions are delivered via SSE (Server-Sent Events) streaming.

The Chat API consists of three endpoints. You can send messages, reconnect to existing conversations, and cancel ongoing conversations.

SaaSMarketplace

SSE Streaming Guide

Connection flow, response objects, Delta拡張・実行パターン・再接続・エラーハンドリングの詳細解説

View Guide

Endpoint List

メソッドエンドポイント説明スコープ
POST/v1/chat/completionsSend chat message and、SSEGet response via streamingchat:exec
GET/v1/chat/completions/:conversationId進行中のConversationのSSEReconnect to streamchat:exec
POST/v1/chat/completions/:conversationId/cancel進行中のConversationをキャンセルchat:exec

POST/v1/chat/completions

Send a message to the agent and receive a response via SSE streaming. The response is delivered in OpenAI-compatible Chat Completion Chunk format.

Request Headers

ヘッダー必須説明
Authorization必須Bearer <access_token>
Content-Type必須application/json

Request Body

パラメータ必須説明
modelstring必須Model ID to use. Specify "AGENTIC STAR".
messagesarray必須Array of message objects. At least one message with user role is required.
streamboolean必須Specify true. Currently, only streaming mode is supported.
conversationIdstringSpecify conversation ID to continue an existing conversation. If omitted, a new conversation is created.

Edition-Specific Parameters

SaaS
agentLevelstring"default" or "high_performance". Defaults to "default".
agentModebooleanEnable/disable agent mode. Defaults to true.
privateModebooleanEnable/disable private mode. Defaults to false.
Marketplace
agentIdstringAgent ID to use.
agentstringAlias for agentId. Specify one or the other.

Message Object

パラメータ必須説明
rolestring必須"user", "assistant", or "system"
contentstring | array必須Message content. String or array of content parts.

Content Parts (Array Format)

When specifying content as an array, the following part types are available. You can combine text and files.

typeParameterDescription
"text"text (string)Text message
"file"file_id (string)Uploaded fileID

Request Example

Create chat completion
1curl -X POST https://api.agenticstar.jp/v1/chat/completions \
2-H "Authorization: Bearer <access_token>" \
3-H "Content-Type: application/json" \
4-d '{
5 "model": "AGENTIC STAR",
6 "stream": true,
7 "messages": [
8 {
9 "role": "user",
10 "content": "Salesデータを分析してください"
11 }
12 ]
13}'

Response Headers

HeaderDescription
Content-Typetext/event-stream
X-Conversation-IdConversationID。新規Conversationの場合はサーバーが生成したID is returned。
X-Message-IdAssistant response messageID。

SSE Response Format

The response is delivered as SSE events in the following order. Each event is a JSON line with a data: prefix.

SSEEvent Flow
1. data: {"choices":[{"delta":{"role":"assistant"}}]}
2. data: {"choices":[{"delta":{"content":"..."}}]} × N
3. data: {"choices":[{"finish_reason":"stop"}]}
4. data: [DONE]

Response is delivered via SSE (Server-Sent Events) streaming. Each chunk is in OpenAI-compatible ChatCompletionChunk format. For details on connection lifecycle, response objects, agent extension fields, and error handling, see the Streaming Guide.

Response Example

SSE
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created_at":"2025-01-15T10:30:00Z","model":"AGENTIC STAR","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null}]}

data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created_at":"2025-01-15T10:30:00Z","model":"AGENTIC STAR","choices":[{"index":0,"delta":{"content":"Salesデータ"},"finish_reason":null}]}

data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created_at":"2025-01-15T10:30:00Z","model":"AGENTIC STAR","choices":[{"index":0,"delta":{"content":" to analyze。"},"finish_reason":null}]}

data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created_at":"2025-01-15T10:30:01Z","model":"AGENTIC STAR","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}

data: [DONE]

GET/v1/chat/completions/:conversationId

Reconnect to the SSE stream of an ongoing conversation. Use this when the agent is processing long-running tasks or when recovering from network disconnection.

Request Example

Resume SSE stream
1curl https://api.agenticstar.jp/v1/chat/completions/550e8400-e29b-41d4-a716-446655440000 \
2-H "Authorization: Bearer <access_token>"

Path Parameters

パラメータ必須説明
conversationIdstring必須再接続するConversationのID

Response (200 OK)

Reconnect to SSE stream. The response format is the same as POST /v1/chat/completions. Response headers include X-Conversation-Id and X-Message-Id. For detailed reconnection procedures, see the Streaming Guide.

Error Response

StatusDescription
404Conversationが見つからない、or not in progress

POST/v1/chat/completions/:conversationId/cancel

Cancel an ongoing conversation. Use when you want to interrupt agent execution.

Path Parameters

パラメータ必須説明
conversationIdstring必須Conversation to cancelID

Response Fields (200 OK)

FieldTypeDescription
conversationIdstringCancelled conversationID(UUID)
cancelledbooleanAlways true on successful cancellation true

Response Example

JSON
{ "conversationId": "550e8400-...", "cancelled": true }

Error Response

StatusDescription
400conversationId is invalid
404Conversation not found

Error Response

Errors before SSE stream starts are returned in JSON format. Errors during streaming are delivered as SSE chunks.

StatusDescription
400RequestInvalid parameter(model, messages, stream等)
401Authentication token is invalid or unspecified
403chat:exec Insufficient scope
409指定したConversationが現在処理中

Resource API

Resource operation API for conversations, files, search, users, and master data.

SaaS

Endpoint List

メソッドエンドポイント説明スコープ
GET/v1/conversationsConversation一覧を取得chat:history
GET/v1/conversations/:id/messagesGet message historychat:history
PATCH/v1/conversations/:idUpdate conversation titlechat:history
DELETE/v1/conversations/:idDelete conversationchat:history
GET/v1/filesRetrieve file listchat:file
POST/v1/filesUpload filechat:file
GET/v1/files/:id/contentDownload filechat:file
DELETE/v1/files/:idDelete filechat:file
GET/v1/files/proxyRetrieve artifact filechat:exec
GET/v1/search/messagesFull-text search messageschat:history
GET/v1/userRetrieve user information
PATCH/v1/userUpdate user information
POST/v1/user/passwordChange password
GET/v1/organizationsRetrieve organization list
GET/v1/job-typesRetrieve job type list

Endpoints with "—" in the scope column are available with JWT authentication only (no additional scope required). For details on scope assignment, see Authentication Reference.

Conversation Management

Retrieve conversation lists, view message history, delete, and update titles.

SaaS スコープ: chat:history

GET/v1/conversations

Retrieve conversation list. Supports cursor-based pagination.

Request Example

List conversations
1curl https://api.agenticstar.jp/v1/conversations?limit=10&order=desc \
2-H "Authorization: Bearer <access_token>"

Query Parameters

ParameterTypeDefaultDescription
limitinteger25Number of items to retrieve (1-100)
cursorstring次ページ取得用カーソル(前回Response cursor Value)
orderstring"desc""asc" or "desc"
titlestringFilter by title

Response Fields (200 OK)

FieldTypeDescription
conversationsarrayArray of conversation objects
conversations[].conversationIdstringUnique identifier for conversation (UUID)
conversations[].titlestringConversation title
conversations[].createdAtstringCreation date (ISO 8601)
conversations[].updatedAtstringLast updated date (ISO 8601)
hasMorebooleanWhether next page exists
cursorstringCursor for next page. Included only if hasMore is true

Response Example

JSON
{
"conversations": [
{
"conversationId": "550e8400-e29b-41d4-a716-446655440000",
"title": "Salesデータ分析",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:35:00Z"
}
],
"hasMore": true,
"cursor": "2025-01-15T10:30:00.000Z"
}

Error Response

StatusDescription
400limit parameter is invalid (out of 1-100 range)
403chat:history scope is insufficient

GET/v1/conversations/:conversationId/messages

Retrieve message history for specified conversation.

Request Example

Get messages
1curl https://api.agenticstar.jp/v1/conversations/550e8400-e29b-41d4-a716-446655440000/messages?order=asc \
2-H "Authorization: Bearer <access_token>"

Query Parameters

ParameterTypeDefaultDescription
limitintegerMaximum number of items to retrieve
orderstring"desc""asc" or "desc"

Response Fields (200 OK)

FieldTypeDescription
messagesarrayMessageobject array
messages[].conversationIdstringConversationID(UUID)
messages[].messageIdstringMessageの一意識別子
messages[].parentMessageIdstring親MessageのID(Conversationツリー構造の参照)
messages[].senderstring送信者。"User" or "AI"
messages[].textstringMessageの本文テキスト
messages[].createdAtstringCreation date (ISO 8601)
messages[].updatedAtstringLast updated date (ISO 8601)
messages[].statusobjectMessageの処理状態
messages[].status.processingbooleanWhether agent is currently processing
messages[].status.unfinishedbooleanWhether agent response was interrupted
messages[].tasksarrayArray of tasks executed by agent(後述)
messages[].deliverablesarrayArray of artifacts generated by agent。存在する場合のみ含まれます
messages[].deliverables[].filenamestring成果物のファイル名
messages[].deliverables[].filepathstring成果物のファイルパス
messages[].deliverables[].fileTypestringFile type
hasMoreboolean常に false(Pagination not supported)

Task object

FieldTypeDescription
taskIdstringUnique task identifier
messageIdstringMessage containing the taskID
conversationIdstringConversation containing the taskID
actionTypestringTask type(Example: Tool execution、Code Generation)
titlestringTask title
descriptionstringTask description
statusstringTask status(Example: "completed"、"running")
contentstringTask execution result text
filesarrayFiles related to task(filename, fileType, size, filepath)
timestampnumberTimestamp when task was executed(Unix milliseconds)

Response Example

JSON
{
"messages": [
{
"conversationId": "550e8400-...",
"messageId": "msg-abc123",
"parentMessageId": "msg-parent",
"sender": "User",
"text": "Salesデータを分析してください",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z",
"status": { "processing": false, "unfinished": false },
"tasks": [],
"deliverables": []
}
],
"hasMore": false
}

Error Response

StatusDescription
400conversationId is invalid format
403chat:history scope is insufficient
404Conversation not found

PATCH/v1/conversations/:conversationId

Conversationのタイトルを更新します。

Request Example

Update conversation
1curl -X PATCH https://api.agenticstar.jp/v1/conversations/550e8400-e29b-41d4-a716-446655440000 \
2-H "Authorization: Bearer <access_token>" \
3-H "Content-Type: application/json" \
4-d '{ "title": "新しいタイトル" }'

Request Body

パラメータ必須説明
titlestring必須新しいConversationタイトル

Response Fields (200 OK)

FieldTypeDescription
conversationIdstringConversationID(UUID)
titlestring更新後のタイトル

Error Response

StatusDescription
400title is unspecified or empty
403chat:history scope is insufficient
404Conversation not found

DELETE/v1/conversations/:conversationId

Conversationを削除します。

Request Example

Delete conversation
1curl -X DELETE https://api.agenticstar.jp/v1/conversations/550e8400-e29b-41d4-a716-446655440000 \
2-H "Authorization: Bearer <access_token>"

Response (200 OK)

JSON
{ "conversationId": "550e8400-...", "deleted": true }

Error Response

StatusDescription
403chat:history scope is insufficient
404Conversation not found

File Management

Upload, retrieve, and delete files。

SaaS スコープ: chat:file

POST/v1/files

Upload file。

Request Example

Upload file
1curl -X POST https://api.agenticstar.jp/v1/files \
2-H "Authorization: Bearer <access_token>" \
3-F "file=@report.pdf"

GET/v1/files

Retrieve file list。

Request Example

List files
1curl https://api.agenticstar.jp/v1/files?order=desc \
2-H "Authorization: Bearer <access_token>"

GET/v1/files/:fileId/content

Download file。

Request Example

Download file
1curl https://api.agenticstar.jp/v1/files/f-abc123/content \
2-H "Authorization: Bearer <access_token>" \
3-o downloaded_file.pdf

DELETE/v1/files/:fileId

Delete fileします。

Request Example

Delete file
1curl -X DELETE https://api.agenticstar.jp/v1/files/f-abc123 \
2-H "Authorization: Bearer <access_token>"

GET/v1/files/proxy

Retrieve artifact files generated by agent。

Query Parameters

パラメータ必須説明
filepathstring必須成果物のファイルパス(Message履歴の deliverables[].filepath to retrieve)

Request Example

Get artifact file
1curl "https://api.agenticstar.jp/v1/files/proxy?filepath=/path/to/artifact.xlsx" \
2-H "Authorization: Bearer <access_token>" \
3-o artifact.xlsx

GET/v1/search/messages

Messageを全文検索します。

Query Parameters

パラメータ必須説明
qstring必須検索クエリ

Request Example

Search messages
1curl "https://api.agenticstar.jp/v1/search/messages?q=Sales" \
2-H "Authorization: Bearer <access_token>"

User

GET/v1/user

Retrieve user information。

Get user
1curl https://api.agenticstar.jp/v1/user \
2-H "Authorization: Bearer <access_token>"

PATCH/v1/user

Update user information。

Update user
1curl -X PATCH https://api.agenticstar.jp/v1/user \
2-H "Authorization: Bearer <access_token>" \
3-H "Content-Type: application/json" \
4-d '{ "username": "田中太郎", "bio": "Engineering Department" }'

POST/v1/user/password

Change password。

Change password
1curl -X POST https://api.agenticstar.jp/v1/user/password \
2-H "Authorization: Bearer <access_token>" \
3-H "Content-Type: application/json" \
4-d '{
5 "currentPassword": "OldPass123!",
6 "newPassword": "NewPass456!",
7 "confirmPassword": "NewPass456!"
8}'

Master Data

GET/v1/organizations

組織一覧を取得します。

List organizations
1curl https://api.agenticstar.jp/v1/organizations \
2-H "Authorization: Bearer <access_token>"

GET/v1/job-types

Retrieve job type list。

List job types
1curl https://api.agenticstar.jp/v1/job-types \
2-H "Authorization: Bearer <access_token>"

Common Error Response

Common errors that may be returned from all endpoints.

StatusDescription
400Request parameters are invalid
401Authentication token is invalid or unspecified
403Required scope is insufficient
404Resource not found
429Rate limit exceeded
500Server internal error

Error Response Format

All error responses are returned with the following common structure.

FieldTypeDescription
error.typestringError classification. One of "invalid_request_error", "authentication_error", "insufficient_scope_error", "forbidden_error", "not_found_error", "conflict_error", "payload_too_large_error", "server_error"
error.messagestringHuman-readable error message
error.codestringMachine-processable error code (e.g., "missing_parameter", "invalid_parameter", "invalid_token")
error.paramstringParameter name that caused the error. Included only on validation errors
error.suggested_actionstringRecommended action. Included only for some errors
JSON
{
"error": {
"type": "invalid_request_error",
"message": "Invalid parameter: limit",
"code": "invalid_parameter",
"param": "limit",
"suggested_action": "limit must be between 1 and 100"
}
}

Rate Limiting

Rate limits are applied to API requests. When exceeded, 429 Too Many Requests is returned.

When rate limit is reached, check the Retry-After header (in seconds) in the response and retry after the specified time has passed.

HTTP/1.1 429 Too Many Requests
Retry-After: 30
Content-Type: application/json

{
"error": {
"type": "server_error",
"message": "Rate limit exceeded",
"code": "rate_limit_exceeded",
"suggested_action": "Retry after 30 seconds"
}
}

For retries, it is recommended to use exponential backoff instead of fixed intervals. This prevents concentrated access after the limit is lifted and enables stable use.

Detailed Error Codes

Detailed HTTP status codes that may be returned from all endpoints.

StatusDescription
400 Bad RequestRequest parameters are invalid
401 UnauthorizedToken is invalid or unspecified
403 ForbiddenNo access rights to resource
404 Not FoundResource does not exist
409 ConflictOperation conflicts, such as resource being processed
413 Payload Too LargeRequest body exceeds size limit
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorServer internal error