DevCast API (1.0.0)

Download OpenAPI specification:

DevCast backend API (Slim Framework 4 / PHP).

Generated by hand-reading the live controllers under backend/src/Features and backend/src/Config/Routes.php, since the backend has no schema library (no zod / class-validator equivalent) to generate from automatically. Treat this spec as the source of truth for the HTTP contract; when the backend changes, update the corresponding .tsp file in this directory and recompile with bun run build.

Health

Health_health

Liveness check. Returns a plain-text body, not JSON. backend/src/Futures/Health/HealthController.php:8

Authorizations:
None

Responses

Auth

Auth_oauthUrl

Generates the GitHub OAuth authorization URL. backend/src/Futures/Auth/AuthController.php:13

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

Auth_callback

GitHub OAuth callback. On success this issues a 302 redirect to {frontend_base_url}/_auth/callback?token={jwt} rather than a JSON body. backend/src/Futures/Auth/Callback/CallbackController.php:25

Authorizations:
None
query Parameters
code
required
string
state
required
string

Responses

Response samples

Content type
application/json
{
  • "details": {
    },
  • "message": "string",
  • "code": "INVALID_CODE"
}

Auth_getProfile

Requires a bearer JWT. Returns the authenticated user's profile. backend/src/Futures/Auth/Profile/ProfileController.php:14

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

Auth_accessToken

Exchanges a refresh token (in the request body) for a new access + refresh token pair, rotating the refresh token in the process. Distinct from refreshToken, which requires a bearer JWT and also tears down all of the user's existing sessions. backend/src/Futures/Auth/AccessToken/AccessTokenController.php:15

Authorizations:
None
Request Body schema: application/json
required
refresh_token
required
string

Responses

Request samples

Content type
application/json
{
  • "refresh_token": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

Auth_refreshToken

Requires a bearer JWT. Invalidates all of the user's existing sessions and refresh tokens, then issues a brand new access + refresh token pair. backend/src/Futures/Auth/RefreshToken/RefreshTokenController.php:14

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1

V1_version

backend/src/Features/Version1/Version1Controller.php

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_getAiUsage

現在のAI翻訳利用状況を返す。

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_getApiKeys

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_createApiKey

Authorizations:
BearerAuth
Request Body schema: application/json
required
name
required
string
scopes
Array of strings

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "scopes": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_deleteApiKey

Authorizations:
BearerAuth
path Parameters
key_id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string"
}

V1_getArticles

Authorizations:
BearerAuth
query Parameters
metadata
string
Enum: "true" "false"
include
string

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_createArticle

Authorizations:
BearerAuth
Request Body schema: application/json
required
title
required
string
body
required
string
tags
required
Array of strings
description
string or null
slug
string or null
language
string or null

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "body": "string",
  • "tags": [
    ],
  • "description": "string",
  • "slug": "string",
  • "language": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_importArticles

選択した外部記事をDevCastへ取り込む。

Authorizations:
BearerAuth
Request Body schema: application/json
required
provider
required
string
external_ids
required
Array of strings
language
string or null

取り込んだ記事の言語。省略時はProviderの既定言語。

Responses

Request samples

Content type
application/json
{
  • "provider": "string",
  • "external_ids": [
    ],
  • "language": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_getImportableArticles

接続済みProviderから取り込み可能な記事一覧を返す。

Authorizations:
BearerAuth
query Parameters
provider
required
string

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_getArticle

Authorizations:
BearerAuth
path Parameters
article_id
required
integer <int32>
query Parameters
include
string

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_updateArticle

Authorizations:
BearerAuth
path Parameters
article_id
required
integer <int32>
Request Body schema: application/json
required
title
string
body
string
content
string
tags
Array of strings
description
string or null
slug
string or null
language
string or null
status
string (Models.ArticleState)
Enum: "draft" "published" "archived"

PRD 11. Article Model の status。

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "body": "string",
  • "content": "string",
  • "tags": [
    ],
  • "description": "string",
  • "slug": "string",
  • "language": "string",
  • "status": "draft"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_deleteArticle

Authorizations:
BearerAuth
path Parameters
article_id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string"
}

V1_publishArticle

選択した Provider へ公開する。部分成功を許容する。

Authorizations:
BearerAuth
path Parameters
article_id
required
integer <int32>
Request Body schema: application/json
required
providers
Array of strings

省略時は接続済みの全 Provider。

Responses

Request samples

Content type
application/json
{
  • "providers": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_getArticleRevisions

記事のリビジョン一覧(本文なし)を返す。

Authorizations:
BearerAuth
path Parameters
article_id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_getArticleRevision

指定バージョンのリビジョン(本文あり)を返す。

Authorizations:
BearerAuth
path Parameters
article_id
required
integer <int32>
version
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_syncArticle

最新 revision を未同期の Provider へ反映する。

Authorizations:
BearerAuth
path Parameters
article_id
required
integer <int32>
Request Body schema: application/json
required
providers
Array of strings

省略時は接続済みの全 Provider。

Responses

Request samples

Content type
application/json
{
  • "providers": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_translateArticle

記事を翻訳し、レビュー用のドラフトを返す。保存・公開は行わない。 既定値は backend/src/Config/Ai.php。OPENAI_* 環境変数で上書き可能。 AI_TRANSLATION_ENABLED / AI_TRANSLATION_TRIAL_MODE で利用可否を制御する。 未対応の言語・翻訳元と同じ言語・60,000文字超は 400 VALIDATION_FAILED を返す。

Authorizations:
BearerAuth
path Parameters
article_id
required
integer <int32>
Request Body schema: application/json
required
target_language
string

en / ja / zh / ko / es / fr / de / pt。省略時は en。

language
string

target_language の別名。

provider
string

指定すると接続設定の翻訳先言語を使う。target_language と競合した場合は 400。

Responses

Request samples

Content type
application/json
{
  • "target_language": "string",
  • "language": "string",
  • "provider": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_listTranslations

接続済みProviderごとの翻訳状態を返す。

Authorizations:
BearerAuth
path Parameters
article_id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_saveTranslation

レビュー済みの翻訳をProvider単位で保存する。

Authorizations:
BearerAuth
path Parameters
article_id
required
integer <int32>
provider
required
string
Request Body schema: application/json
required
title
required
string
description
string or null
body
required
string
tags
required
Array of strings
language
string

保存する翻訳先言語。省略時はProviderの既定言語。

model
string or null

生成時に返されたモデル名をそのまま渡せる。

source_language
string

生成時の翻訳元。省略時は現在の記事の値。

source_revision
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "description": "string",
  • "body": "string",
  • "tags": [
    ],
  • "language": "string",
  • "model": "string",
  • "source_language": "string",
  • "source_revision": 0
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_deleteTranslation

保存済みの翻訳を削除する。

Authorizations:
BearerAuth
path Parameters
article_id
required
integer <int32>
provider
required
string

Responses

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string"
}

V1_unpublishArticle

DevCast 上の Publication を破棄する(外部記事は削除しない)。

Authorizations:
BearerAuth
path Parameters
article_id
required
integer <int32>
Request Body schema: application/json
required
providers
Array of strings

省略時は接続済みの全 Provider。

Responses

Request samples

Content type
application/json
{
  • "providers": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_getProviders

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_registerProvider

Authorizations:
BearerAuth
Request Body schema: application/json
required
provider
required
string
token
required
string
expires_at
string or null

ISO-8601 date-time string, parsed with PHP's new \DateTime(...).

object or null

Provider固有設定。 はてなブログは mode=atom(AtomPub)または mode=github(GitHub連携)。 Zenn / はてなGitHub連携は repository が必須。

Responses

Request samples

Content type
application/json
{
  • "provider": "string",
  • "token": "string",
  • "expires_at": "string",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string"
}

V1_updateProvider

Authorizations:
BearerAuth
Request Body schema: application/json
required
provider
required
string
token
required
string
expires_at
string or null

ISO-8601 date-time string, parsed with PHP's new \DateTime(...).

object or null

Provider固有設定。 はてなブログは mode=atom(AtomPub)または mode=github(GitHub連携)。 Zenn / はてなGitHub連携は repository が必須。

Responses

Request samples

Content type
application/json
{
  • "provider": "string",
  • "token": "string",
  • "expires_at": "string",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string"
}

V1_deleteProvider

Authorizations:
BearerAuth
Request Body schema: application/json
required
provider
required
string

Responses

Request samples

Content type
application/json
{
  • "provider": "string"
}

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "string"
}

V1_testProvider

保存済み認証情報で Provider に到達できるかを確認する。

Authorizations:
BearerAuth
Request Body schema: application/json
required
provider
required
string

Responses

Request samples

Content type
application/json
{
  • "provider": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_getTags

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

V1_getArticlesByTag

Authorizations:
BearerAuth
path Parameters
slug
required
string

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

Public Content API

Public_getArticles

認証不要。published 状態の記事だけを返す。

Authorizations:
None
path Parameters
username
required
string

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

Public_getArticle

Authorizations:
None
path Parameters
username
required
string
slug
required
string

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string"
}

Errors

Errors_notFound

path Parameters
path
required
string

Responses

Response samples

Content type
application/json
{
  • "details": {
    },
  • "message": "string",
  • "code": "INVALID_CODE"
}