openapi: 3.0.3
info:
  title: REST API
  description: |
    SalesBrain REST API

    ## 検索条件の指定
    企業検索・求人検索はリクエストの `filter` に同じ形の検索条件（`SearchFilter`）を受け取ります。
    条件は 2 階層で、1 階層目（項目とグループ）とグループの中（項目）をそれぞれ 1 つの結合子
    （`combination`: `and` / `or`、省略時 `and`）でつなぎます。
    項目は `company`（企業の属性）と `job`（求人の属性）に分かれ、使える条件の形は項目ごとに決まっています。
    企業検索での `job` は「その条件を満たす求人を持つ企業」、求人検索での `company` は「その企業の求人」を表します。

    ## クレジット
    企業 1 社の情報を取得すると 1 クレジットを消費します。一度取得した企業は、その後 90 日間は
    企業情報・求人とも追加のクレジットなしで何度でも取得できます（同じテナントの API キー・Web 画面で共通）。
    求人検索・企業の求人一覧はレスポンスに含まれる求人の企業数分を消費し、同じ企業の求人が複数あっても 1 社分です。
    クレジットが不足している場合は結果を返さず HTTP 402 を返します。ボディの `required_credits`（必要数）と `balance`（残高）を見て、`limit` を減らすと 1 回の消費を抑えられます。
    法人番号解決は、法人番号を 1 件に確定できた社（`CONFIRMED`）の数だけ消費します。

    ## レート制限
    検索 API（`/companies/*`, `/jobs/search`）はユーザーあたり 5 req/sec に制限されます。
    マスターデータ API（`/master/*`）と求人詳細（`/jobs/{jobId}`）はレート制限の対象外です。

    制限超過時は HTTP 429 と `Retry-After` ヘッダ（再試行までの秒数）を返します。
    レスポンスヘッダ `X-RateLimit-Limit` / `X-RateLimit-Remaining` / `X-RateLimit-Reset` で現在の状態を確認できます。

    ## 未定義フィールド
    リクエストボディに schema で定義されていないフィールドが含まれている場合、HTTP 400 を返します。
    タイポや旧フィールド名の利用を早期に検知できるよう、未定義フィールドは黙って無視せず明示的にエラーとします。

    ## Enum 値（日本語表記）
    以下の項目はレスポンス・検索条件ともに**日本語表記**で扱います。

    ### 法人種別 `corporateType`
    - 株式会社 / 有限会社 / 合同会社 / 合名会社 / 合資会社 / 外国会社 / 国の機関 / 地方公共団体 / その他

    ### 投資ラウンド `fundingSeries`
    - シード / シリーズA / シリーズB / シリーズC / シリーズD / シリーズE / シリーズF / シリーズG

    ### 給与種別 `salaryType`（求人レスポンスのみ）
    - 年収 / 月給 / 日給 / 時給

    マスターデータ（`/master/markets`、`/master/employment-types` 等）由来の項目は引き続き英語コードまたは ID を識別子として用います。
  version: 4.0.0
servers:
  - url: https://api.salesbrain.jp/rest/v1
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /companies/search:
    post:
      operationId: searchCompanies
      summary: 企業検索
      description: |
        企業情報を検索します。

        検索条件は `filter`（`SearchFilter`）で指定します。`filter` を省略すると全件が対象です。
        企業検索では `job` の項目は「その条件を満たす求人を持つ企業」を表します。
        `and` でつながれた `job` の項目は、1 階層目とグループに分かれていても同一の求人が満たします
        （求人検索で同じ条件を指定したときのヒット求人の企業と一致します）。
        除外（`noneContains` / `notIn`）も同じ求人単位で評価し、除外に当たらない求人を持つ企業がヒットします。

        ## グループ関係フィルターの範囲

        `parentCorporateNumber` / `ultimateParentCorporateNumber` / `groupId` は、
        **この API の企業データベースに収載されている法人のみ**を返します。
        グループ関係そのものは有価証券報告書等から収集しており、収載外の法人（求人掲載実績が無い等）も
        関係先として把握していますが、企業検索の結果には現れません。

        対象企業が 10,000 件を超える場合は、一部だけを返さず HTTP 422 を返します。
      tags:
        - Companies
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanySearchRequest'
      responses:
        '200':
          description: 検索結果
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanySearchResponse'
        '400':
          description: リクエストエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Payment Required - クレジットが不足
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditResponse'
        '422':
          description: |
            Unprocessable Content - グループ関係フィルターの対象企業が 10,000 件を超過。
            リクエスト自体は正しいため、対象のグループを絞り込めば成功します。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /companies/{corporateNumber}:
    get:
      operationId: getCompany
      summary: 企業取得
      description: |
        法人番号を指定して企業情報を 1 件取得します。
        この企業を過去 90 日以内に取得していなければ 1 クレジットを消費します。企業データベースに収載されていない法人番号は 404 になります。
      tags:
        - Companies
      parameters:
        - $ref: '#/components/parameters/CorporateNumber'
      responses:
        '200':
          description: 企業情報
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
        '400':
          description: リクエストエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Payment Required - クレジットが不足
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditResponse'
        '404':
          description: 指定された企業が存在しない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /companies/{corporateNumber}/jobs:
    get:
      operationId: getCompanyJobs
      summary: 企業の求人一覧
      description: |
        法人番号を指定して、その企業の求人を返します。レスポンスは求人検索（`/jobs/search`）と同じ形です。
        並び替えは `sort`（求人検索と同じ項目名）と `order` で指定します。
        この企業を過去 90 日以内に取得していなければ 1 クレジットを消費します（求人の件数によらず 1 社分）。
      tags:
        - Companies
      parameters:
        - $ref: '#/components/parameters/CorporateNumber'
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 25
        - name: offset
          in: query
          description: 先頭からスキップする件数。`offset + limit` は 500,000 以下である必要があります。
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: includeTotalResults
          in: query
          schema:
            type: boolean
            default: true
        - name: sort
          in: query
          description: 並び替え対象の項目名。省略時は `job.createdAt` の降順。
          schema:
            $ref: '#/components/schemas/JobSortField'
        - name: order
          in: query
          description: 並び順（昇順 / 降順）。省略時は `desc`。
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        '200':
          description: 求人一覧
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobSearchResponse'
        '400':
          description: リクエストエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Payment Required - クレジットが不足
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /companies/{corporateNumber}/group-companies:
    get:
      operationId: getGroupCompanies
      summary: グループ企業一覧
      description: |
        法人番号を指定して、その企業のグループ企業を関係種別・根拠・信頼度つきで返します。

        企業検索（`/companies/search`）と違い、**求人実績が無く企業データベースに収載されていない
        グループ会社も返します**。グループの構成を欠落なく把握したい場合はこちらを使用してください。

        指定した企業を過去 90 日以内に取得していなければ 1 クレジットを消費します（返すグループ企業の数によらず 1 社分）。

        関係の出典は有価証券報告書、企業の公式サイト、および既存の企業グループデータです。名寄せできなかった相手は
        `corporateNumber` が null になり、`name` には出典に記載されていた名称が入ります。

        ## scope

        - `direct`（省略時）: 指定した企業と直接の関係がある企業のみ。関係種別・議決権比率・根拠が付きます
        - `group`: `direct` に加えて、同じグループに属する企業（孫会社・兄弟会社）も含めます。
          グループ所属だけでつながる企業は `membership` が `group_member` になり、根拠は付きません

        `relationType` は**指定した企業から見た相手の種別**です。相手の有価証券報告書に
        記載されていた関係も、指定企業から見た向きに揃えて返します。
      tags:
        - Companies
      parameters:
        - $ref: '#/components/parameters/CorporateNumber'
        - name: scope
          in: query
          description: |
            `direct` = 直接の関係がある企業のみ。
            `group` = 同じグループに属する企業（孫会社・兄弟会社）も含める。
          schema:
            type: string
            enum:
              - direct
              - group
            default: direct
      responses:
        '200':
          description: グループ企業一覧
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupCompaniesResponse'
        '400':
          description: リクエストエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Payment Required - クレジットが不足
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditResponse'
        '403':
          description: Forbidden - 指定した企業が未開示
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /jobs/search:
    post:
      operationId: searchJobs
      summary: 求人検索
      description: |
        求人情報を検索します。

        検索条件は `filter`（`SearchFilter`）で指定します。`filter` を省略すると全件が対象です。
        求人検索では `company` の項目は求人を出している企業の属性として評価します。
        企業検索でしか使えない項目（`parentCorporateNumber` / `ultimateParentCorporateNumber` / `groupId` /
        `corporateNumberAssignedAt`）を指定すると 400 になります。

        **勤務地条件の例**

        求人には複数の勤務地（`workLocations[]`）が紐づくことがあり、勤務地条件は
        「いずれかの勤務地が一致すれば結果に含める」と評価されます。どの勤務地で
        ヒットしたかはレスポンスの `workLocations[]` で確認できます。

        東京都渋谷区または大阪市北区の勤務地を持つ求人:

        ```json
        { "filter": { "job": { "workLocationCity": { "in": ["東京都渋谷区", "大阪府大阪市北区"] } } } }
        ```

        市区町村での絞り込みには `workLocationCity`（都道府県名+市区町村名の完全一致）を
        使ってください。値は 1 勤務地 1 値のため、同じ勤務地の中で都道府県と市区町村の
        両方が一致することが保証されます。番地レベルの絞り込みには `workLocationAddress`
        （正規化住所への部分一致）を使えます。指定できる値は `/master/work-location-cities` で取得できます。
      tags:
        - Jobs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobSearchRequest'
      responses:
        '200':
          description: 検索結果
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobSearchResponse'
        '400':
          description: リクエストエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Payment Required - クレジットが不足
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /jobs/{jobId}:
    get:
      operationId: getJobDetail
      summary: 求人取得（全文つき）
      description: |
        求人 ID 指定で求人を 1 件取得します。求人検索（`/jobs/search`）が返す項目に加えて、
        求人詳細の全文 `description` を返します。
        求人の企業を過去 90 日以内に取得していなければ 1 クレジットを消費します。レート制限の対象外です。
        求人詳細を持つのは直近 6 ヶ月に取得した求人のみで、それ以外は `description` が null になります。
      tags:
        - Jobs
      parameters:
        - name: jobId
          in: path
          required: true
          description: 求人 ID（18 文字）。
          schema:
            type: string
            minLength: 18
            maxLength: 18
      responses:
        '200':
          description: 求人（全文つき）
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobDetail'
        '400':
          description: リクエストエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Payment Required - クレジットが不足
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditResponse'
        '404':
          description: 指定された求人が存在しない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /master/prefectures:
    get:
      operationId: getMasterPrefectures
      summary: 都道府県マスターデータ取得
      description: |
        都道府県の一覧を取得します。
        クレジット消費なし。Cache-Control: max-age=86400 でキャッシュ可能。
      tags:
        - Master
      responses:
        '200':
          description: 都道府県一覧
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MasterPrefecture'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /master/industries:
    get:
      operationId: getMasterIndustries
      summary: 業界マスターデータ取得
      description: |
        業界（大分類・小分類）の一覧を取得します。
        クレジット消費なし。Cache-Control: max-age=86400 でキャッシュ可能。
      tags:
        - Master
      responses:
        '200':
          description: 業界一覧
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MasterIndustryCategory'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /master/media:
    get:
      operationId: getMasterMedia
      summary: 媒体マスターデータ取得
      description: |
        媒体の一覧を取得します。
        クレジット消費なし。Cache-Control: max-age=86400 でキャッシュ可能。
      tags:
        - Master
      responses:
        '200':
          description: 媒体一覧
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MasterMedia'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /master/job-categories:
    get:
      operationId: getMasterJobCategories
      summary: 職種マスターデータ取得
      description: |
        職種（大分類・小分類）の一覧を取得します。
        クレジット消費なし。Cache-Control: max-age=86400 でキャッシュ可能。
      tags:
        - Master
      responses:
        '200':
          description: 職種一覧
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MasterJobCategory'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /master/markets:
    get:
      operationId: getMasterMarkets
      summary: 市場区分マスターデータ取得
      description: |
        市場区分の一覧を取得します。
        クレジット消費なし。Cache-Control: max-age=86400 でキャッシュ可能。
      tags:
        - Master
      responses:
        '200':
          description: 市場区分一覧
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MasterMarket'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /master/employment-types:
    get:
      operationId: getMasterEmploymentTypes
      summary: 雇用形態マスターデータ取得
      description: |
        雇用形態の一覧を取得します。
        クレジット消費なし。Cache-Control: max-age=86400 でキャッシュ可能。
      tags:
        - Master
      responses:
        '200':
          description: 雇用形態一覧
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MasterEmploymentType'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /master/work-location-cities:
    get:
      operationId: getMasterWorkLocationCities
      summary: 勤務地の市区町村一覧取得
      description: |
        求人の勤務地に実在する市区町村の一覧を「都道府県名+市区町村名」の複合値（例: `東京都渋谷区`）で取得します。
        `JobFilter.workLocationCity` に指定できる値です。
        クレジット消費なし。Cache-Control: max-age=86400 でキャッシュ可能。
      tags:
        - Master
      responses:
        '200':
          description: 勤務地の市区町村一覧（値順）
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MasterCity'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /master/head-office-cities:
    get:
      operationId: getMasterHeadOfficeCities
      summary: 本社所在地の市区町村一覧取得
      description: |
        企業の本社所在地に実在する市区町村の一覧を「都道府県名+市区町村名」の複合値（例: `東京都渋谷区`）で取得します。
        `CompanyFilter.headOfficeCity` に指定できる値です。
        クレジット消費なし。Cache-Control: max-age=86400 でキャッシュ可能。
      tags:
        - Master
      responses:
        '200':
          description: 本社所在地の市区町村一覧（値順）
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MasterCity'
        '401':
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - レートリミット超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ExchangeCode:
      type: string
      enum:
        - tse
        - nse
        - fse
        - sse
    CorporateType:
      type: string
      description: 法人種別（日本語表記で指定する）
      enum:
        - 株式会社
        - 有限会社
        - 合同会社
        - 合名会社
        - 合資会社
        - 外国会社
        - 国の機関
        - 地方公共団体
        - その他
    FundingSeries:
      type: string
      description: 投資ラウンド（シード〜シリーズ G、日本語表記で指定する）
      enum:
        - シード
        - シリーズA
        - シリーズB
        - シリーズC
        - シリーズD
        - シリーズE
        - シリーズF
        - シリーズG
    FilterCombination:
      type: string
      enum:
        - and
        - or
      default: and
      description: 条件の結合子。`and` = すべて満たす / `or` = いずれかを満たす。省略時は `and`。
    SearchFilter:
      type: object
      additionalProperties: false
      description: |
        検索条件。企業検索・求人検索で同じ形を使います。
        1 階層目の `company` / `job` の項目と `filterGroups` の各グループを `combination` でつなぎます。
        同じ項目は 1 つの階層に 1 つだけ指定できます。中身が空なら条件なし（全件）です。

        `combination` が効くのは項目とグループの間だけで、1 つの項目の値の中の演算子
        （`allContains` と `noneContains`、`in` と `notIn`、`gte` と `lte`）は常に AND です。

        「共通条件 AND（グループ 1 OR グループ 2）」の形は直接書けません。
        `combination` を `or` にして、共通条件を各グループに入れてください。
      properties:
        combination:
          $ref: '#/components/schemas/FilterCombination'
        company:
          $ref: '#/components/schemas/CompanyFilter'
        job:
          $ref: '#/components/schemas/JobFilter'
        filterGroups:
          type: array
          maxItems: 5
          description: 条件グループ。最大 5 個まで指定できます。グループの中にグループは入れられません。
          items:
            $ref: '#/components/schemas/SearchFilterGroup'
    SearchFilterGroup:
      type: object
      additionalProperties: false
      description: |
        条件グループ。`company` / `job` の項目を `combination` でつなぎます。
        条件のないグループは 400 になります。
      properties:
        combination:
          $ref: '#/components/schemas/FilterCombination'
        company:
          $ref: '#/components/schemas/CompanyFilter'
        job:
          $ref: '#/components/schemas/JobFilter'
    TextMatch:
      type: object
      additionalProperties: false
      description: |
        キーワード部分一致。`anyContains`（いずれかを含む）/ `allContains`（すべてを含む）/
        `noneContains`（いずれも含まない）は同時に指定できます（AND）。
      properties:
        anyContains:
          type: array
          description: 指定した文字列のいずれかを含む
          items:
            type: string
            minLength: 1
        allContains:
          type: array
          description: 指定した文字列のすべてを含む
          items:
            type: string
            minLength: 1
        noneContains:
          type: array
          description: 指定した文字列のいずれも含まない
          items:
            type: string
            minLength: 1
    IdMatch:
      type: object
      additionalProperties: false
      description: |
        マスターデータの ID による完全一致。`in`（いずれかに一致）/ `notIn`（いずれにも一致しない）は
        同時に指定できます（AND）。
      properties:
        in:
          type: array
          description: 指定した ID のいずれかに一致する
          items:
            type: integer
        notIn:
          type: array
          description: 指定した ID のいずれにも一致しない
          items:
            type: integer
    CodeMatch:
      type: object
      additionalProperties: false
      description: 文字列コードによる完全一致。
      properties:
        in:
          type: array
          description: 指定した値のいずれかに一致する
          items:
            type: string
    CorporateNumberMatch:
      type: object
      additionalProperties: false
      description: 法人番号（13 桁）による完全一致。
      properties:
        in:
          type: array
          description: 指定した法人番号のいずれかに一致する
          items:
            type: string
            pattern: ^\d{13}$
    WorkLocationIdMatch:
      type: object
      additionalProperties: false
      description: 勤務地の拠点 ID（`loc_` プレフィックス付き）による完全一致。
      properties:
        in:
          type: array
          description: 指定した拠点 ID のいずれかを勤務地に持つ
          items:
            type: string
            pattern: ^loc_[a-z0-9]+$
    CorporateTypeMatch:
      type: object
      additionalProperties: false
      description: 法人種別による完全一致。`in` / `notIn` は同時に指定できます（AND）。
      properties:
        in:
          type: array
          description: 指定した法人種別のいずれかに一致する
          items:
            $ref: '#/components/schemas/CorporateType'
        notIn:
          type: array
          description: 指定した法人種別のいずれにも一致しない
          items:
            $ref: '#/components/schemas/CorporateType'
    FundingSeriesMatch:
      type: object
      additionalProperties: false
      description: 投資ラウンドによる完全一致。`in` / `notIn` は同時に指定できます（AND）。
      properties:
        in:
          type: array
          description: 指定した投資ラウンドのいずれかに該当する
          items:
            $ref: '#/components/schemas/FundingSeries'
        notIn:
          type: array
          description: 指定した投資ラウンドのいずれにも該当しない
          items:
            $ref: '#/components/schemas/FundingSeries'
    CategoryMatch:
      type: object
      additionalProperties: false
      description: |
        大分類 / 小分類を持つマスターデータ（業界・職種）による完全一致。
        `in` / `notIn` は大分類の ID、`subIn` / `notSubIn` は小分類の ID です。
        肯定（`in` / `subIn`）と否定（`notIn` / `notSubIn`）は同時に指定できます（AND）。
      properties:
        in:
          type: array
          description: 指定した大分類のいずれかに一致する
          items:
            type: integer
        subIn:
          type: array
          description: 指定した小分類のいずれかに一致する
          items:
            type: integer
        notIn:
          type: array
          description: 指定した大分類のいずれにも一致しない
          items:
            type: integer
        notSubIn:
          type: array
          description: 指定した小分類のいずれにも一致しない
          items:
            type: integer
    IntegerMatch:
      type: object
      additionalProperties: false
      description: 整数レンジ。片側のみの指定も可能です（`gte` のみ = 以上、`lte` のみ = 以下）。
      properties:
        gte:
          type: integer
          description: 下限（以上）
        lte:
          type: integer
          description: 上限（以下）
    NumberMatch:
      type: object
      additionalProperties: false
      description: 数値レンジ。片側のみの指定も可能です（`gte` のみ = 以上、`lte` のみ = 以下）。
      properties:
        gte:
          type: number
          description: 下限（以上）
        lte:
          type: number
          description: 上限（以下）
    DateMatch:
      type: object
      additionalProperties: false
      description: |
        日付レンジ（YYYY-MM-DD 形式）。片側のみの指定も可能です
        （`gte` のみ = 以降、`lte` のみ = 以前）。
      properties:
        gte:
          type: string
          format: date
          description: 開始日（以降）
        lte:
          type: string
          format: date
          description: 終了日（以前）
    CompanyFilter:
      type: object
      additionalProperties: false
      description: |
        企業の属性の条件。企業検索ではその企業自身、求人検索では求人を出している企業の属性として評価します。
        「企業検索のみ」の項目を求人検索で指定すると 400 になります。
      properties:
        name:
          allOf:
            - $ref: '#/components/schemas/TextMatch'
          description: 企業名のキーワード部分一致。
        corporateNumber:
          allOf:
            - $ref: '#/components/schemas/CorporateNumberMatch'
          description: 法人番号（13 桁・完全一致）。
        parentCorporateNumber:
          allOf:
            - $ref: '#/components/schemas/CorporateNumberMatch'
          description: |
            親会社の法人番号。指定した法人のいずれかを直接の親会社に持つ企業を返します。企業検索のみ。
        ultimateParentCorporateNumber:
          allOf:
            - $ref: '#/components/schemas/CorporateNumberMatch'
          description: |
            最上位の親会社の法人番号。指定した法人のいずれかをグループの頂点に持つ企業を返します。
            頂点の法人自身は含まれません（`groupId` を使うと頂点も含めて取得できます）。企業検索のみ。
        groupId:
          allOf:
            - $ref: '#/components/schemas/CorporateNumberMatch'
          description: |
            グループ識別子。グループ識別子は最上位の親会社の法人番号です。
            指定したグループに属する企業を、頂点の法人も含めて返します。企業検索のみ。
        corporateType:
          allOf:
            - $ref: '#/components/schemas/CorporateTypeMatch'
          description: 法人種別（日本語表記・完全一致）。
        prefectureId:
          allOf:
            - $ref: '#/components/schemas/IdMatch'
          description: 本社所在地の都道府県 ID。`/master/prefectures` で取得できる ID を指定します。
        cityName:
          allOf:
            - $ref: '#/components/schemas/TextMatch'
          description: 本社所在地の市区町村のキーワード部分一致。市区町村を選んで指定するには `headOfficeCity` を使います。
        headOfficeAddress:
          allOf:
            - $ref: '#/components/schemas/TextMatch'
          description: 本社住所（番地以降）のキーワード部分一致。
        industry:
          allOf:
            - $ref: '#/components/schemas/CategoryMatch'
          description: 業界。`/master/industries` で取得できる大分類 ID（`in` / `notIn`）と小分類 ID（`subIn` / `notSubIn`）を指定します。
        employeeCount:
          allOf:
            - $ref: '#/components/schemas/IntegerMatch'
          description: 従業員数（最新月時点）のレンジ。
        workLocationCount:
          allOf:
            - $ref: '#/components/schemas/IntegerMatch'
          description: 勤務地数（求人の勤務地住所から集計した数）のレンジ。
        capitalMillionYen:
          allOf:
            - $ref: '#/components/schemas/NumberMatch'
          deprecated: true
          description: |
            資本金のレンジ（百万円単位で指定し、円単位の capitalYen で検索）。
            非推奨です。`capitalYen`（円単位）を指定してください。`capitalYen` と同時に指定すると 400 になります。
        marketCode:
          allOf:
            - $ref: '#/components/schemas/CodeMatch'
          description: 上場している市場区分のコード。`/master/markets` で取得できるコードを指定します。
        isListed:
          type: boolean
          description: 上場/未上場。true = 上場企業のみ、false = 未上場企業のみ。
        hasPhone:
          type: boolean
          description: 代表電話の有無。
        hasWebsite:
          type: boolean
          description: 企業サイトの有無。
        hasFax:
          type: boolean
          description: FAX 番号の有無。
        hasEmail:
          type: boolean
          description: 代表メールアドレスの有無。
        hasDispatchLicense:
          type: boolean
          description: 労働者派遣事業の許可（派遣免許）の有無。
        hasRecruitmentLicense:
          type: boolean
          description: 有料職業紹介事業の許可（職業紹介免許）の有無。
        fundingSeries:
          allOf:
            - $ref: '#/components/schemas/FundingSeriesMatch'
          description: 直近の投資ラウンド（日本語表記・完全一致）。
        paidMediaId:
          allOf:
            - $ref: '#/components/schemas/IdMatch'
          description: 出稿実績のある掲載課金型媒体の媒体 ID。`/master/media` で取得できる ID を指定します。
        employeeDiff6m:
          allOf:
            - $ref: '#/components/schemas/IntegerMatch'
          description: 直近 6 ヶ月の従業員数増減のレンジ。
        employeeDiff12m:
          allOf:
            - $ref: '#/components/schemas/IntegerMatch'
          description: 直近 12 ヶ月の従業員数増減のレンジ。
        summary:
          allOf:
            - $ref: '#/components/schemas/TextMatch'
          description: |
            事業概要文の全文検索。1 要素内に複数語をスペースで区切って指定した場合
            （例: `"AI 営業"`）は、語単位で一致判定されます。
        foundedAt:
          allOf:
            - $ref: '#/components/schemas/DateMatch'
          description: 設立日のレンジ。
        isClosed:
          type: boolean
          description: 閉鎖状態。false を指定すると閉鎖済み企業（求人検索ではその企業の求人）を除外します。
        corporateNumberAssignedAt:
          allOf:
            - $ref: '#/components/schemas/DateMatch'
          description: |
            法人番号指定日のレンジ。企業検索のみ。
            2015-10-05 時点で既に設立登記が済んでいた法人は、原則としてこの日が一律に入るため、
            新設法人を絞り込む場合は `gte` に 2015-10-06 以降を指定してください。
        capitalYen:
          allOf:
            - $ref: '#/components/schemas/NumberMatch'
          description: 資本金のレンジ（円単位）。
        headOfficeCity:
          allOf:
            - $ref: '#/components/schemas/CodeMatch'
          description: |
            本社所在地の市区町村。「都道府県名+市区町村名」の複合値（例: `東京都渋谷区`）の完全一致で指定します。
            指定できる値は `/master/head-office-cities` で取得できます。
    JobFilter:
      type: object
      additionalProperties: false
      description: |
        求人の属性の条件。求人検索では求人自身、企業検索では「その条件を満たす求人を持つ企業」として評価します。
      properties:
        title:
          allOf:
            - $ref: '#/components/schemas/TextMatch'
          description: 求人タイトルのキーワード部分一致。
        description:
          allOf:
            - $ref: '#/components/schemas/TextMatch'
          description: 求人詳細の全文検索。求人詳細は直近 6 ヶ月に取得した求人のみ対象です。
        mediaId:
          allOf:
            - $ref: '#/components/schemas/IdMatch'
          description: 掲載媒体の媒体 ID。`/master/media` で取得できる ID を指定します。
        mediaPlan:
          allOf:
            - $ref: '#/components/schemas/CodeMatch'
          description: 媒体プラン名（完全一致）。
        employmentTypeId:
          allOf:
            - $ref: '#/components/schemas/IdMatch'
          description: 雇用形態 ID。`/master/employment-types` で取得できる ID を指定します。
        category:
          allOf:
            - $ref: '#/components/schemas/CategoryMatch'
          description: 職種。`/master/job-categories` で取得できる大分類 ID（`in` / `notIn`）と小分類 ID（`subIn` / `notSubIn`）を指定します。
        salary:
          allOf:
            - $ref: '#/components/schemas/IntegerMatch'
          description: 給与のレンジ（円単位）。`gte` は給与下限、`lte` は給与上限に対して評価します。
        openedOn:
          allOf:
            - $ref: '#/components/schemas/DateMatch'
          description: 募集開始日のレンジ。
        deadlineOn:
          allOf:
            - $ref: '#/components/schemas/DateMatch'
          description: 募集終了日のレンジ。
        createdAt:
          allOf:
            - $ref: '#/components/schemas/DateMatch'
          description: 求人の取得日のレンジ。
        hasContactEmail:
          type: boolean
          description: 応募先メールアドレスの有無。
        hasContactPhone:
          type: boolean
          description: 応募先電話番号の有無。
        workLocationId:
          allOf:
            - $ref: '#/components/schemas/WorkLocationIdMatch'
          description: |
            勤務地の拠点 ID（完全一致）。レスポンスの `workLocations[].locationId` と同じ
            `loc_` プレフィックス付きの形式で指定します。
        workLocationName:
          allOf:
            - $ref: '#/components/schemas/TextMatch'
          description: 勤務地の拠点名のキーワード部分一致。拠点名が分かっている勤務地のみが対象です。
        workLocationPrefectureId:
          allOf:
            - $ref: '#/components/schemas/IdMatch'
          description: 勤務地の都道府県 ID。`/master/prefectures` で取得できる ID を指定します。
        workLocationCity:
          allOf:
            - $ref: '#/components/schemas/CodeMatch'
          description: |
            勤務地の市区町村。「都道府県名+市区町村名」の複合値（例: `東京都渋谷区`）の完全一致で指定します。
            1 勤務地 1 値のため、同じ勤務地の中で都道府県と市区町村の両方が一致する求人だけがヒットします。
            指定できる値は `/master/work-location-cities` で取得できます。
        workLocationAddress:
          allOf:
            - $ref: '#/components/schemas/TextMatch'
          description: |
            勤務地の正規化住所のキーワード部分一致。番地レベルの絞り込みに使えます
            （市区町村の指定は `workLocationCity` を推奨します）。
        hasOriginalJobUrl:
          type: boolean
          description: 転載元 URL の有無。
    CompanySortField:
      type: string
      description: |
        企業検索の並び替え項目。
        - 企業基本情報: `company.name`（企業名）, `company.foundedAt`（設立年月日）, `company.corporateNumberAssignedAt`（法人番号指定日）, `company.capitalYen`（資本金・円額で並び替え。`company.capitalMillionYen` は非推奨で、`company.capitalYen` と同じ並びになります）
        - 規模・成長: `company.employeeCount`（従業員数）, `company.workLocationCount`（勤務地数）, `company.employeeDiff6m`（従業員増減 6 ヶ月）, `company.employeeDiff12m`（従業員増減 12 ヶ月）
        - 連絡先: `company.phoneNumber`, `company.fax`, `company.email`, `company.websiteUrl`
      enum:
        - company.name
        - company.foundedAt
        - company.corporateNumberAssignedAt
        - company.capitalMillionYen
        - company.capitalYen
        - company.employeeCount
        - company.workLocationCount
        - company.employeeDiff6m
        - company.employeeDiff12m
        - company.phoneNumber
        - company.fax
        - company.email
        - company.websiteUrl
    JobSortField:
      type: string
      description: |
        求人検索の並び替え項目。
        - 求人: `job.createdAt`（求人取得日）, `job.openedOn`（募集開始日）, `job.deadlineOn`（募集終了日）
        - 給与: `job.salaryMin`（給与下限）, `job.salaryMax`（給与上限）
        - 求人連絡先: `job.contactEmail`, `job.contactPhoneNumber`
        - 企業側の項目: `company.foundedAt`, `company.capitalYen`（`company.capitalMillionYen` は非推奨で、`company.capitalYen` と同じ並びになります）, `company.employeeCount`, `company.employeeDiff6m`, `company.employeeDiff12m`, `company.phoneNumber`, `company.fax`, `company.email`, `company.websiteUrl`
      enum:
        - job.createdAt
        - job.openedOn
        - job.deadlineOn
        - job.salaryMin
        - job.salaryMax
        - job.contactEmail
        - job.contactPhoneNumber
        - company.foundedAt
        - company.capitalMillionYen
        - company.capitalYen
        - company.employeeCount
        - company.employeeDiff6m
        - company.employeeDiff12m
        - company.phoneNumber
        - company.fax
        - company.email
        - company.websiteUrl
    CompanySearchRequest:
      type: object
      additionalProperties: false
      description: 企業検索リクエスト。
      properties:
        limit:
          type: integer
          minimum: 1
          maximum: 1000
          default: 25
        offset:
          type: integer
          minimum: 0
          default: 0
          description: |
            先頭からスキップする件数。`offset + limit` は 500,000 以下である必要があります。
            超過した場合は 400 エラーになります。
        includeTotalResults:
          type: boolean
          default: true
          description: レスポンスに総件数（`total`）を含めるか。false にすると `total` は null になり、応答が速くなります。
        sort:
          type: object
          description: 並び替え指定。省略時は `company.name` の昇順。
          properties:
            field:
              $ref: '#/components/schemas/CompanySortField'
            order:
              type: string
              description: 並び順（昇順 / 降順）
              enum:
                - asc
                - desc
          required:
            - field
            - order
        filter:
          $ref: '#/components/schemas/SearchFilter'
    CompanySearchResponse:
      type: object
      required:
        - total
        - items
      properties:
        total:
          type: integer
          nullable: true
          description: 検索条件にマッチした企業の総件数。リクエストで `includeTotalResults` を `false` にした場合は null。
        items:
          type: array
          description: 検索結果の企業一覧。`limit` / `offset` でページングされる。
          items:
            $ref: '#/components/schemas/Company'
    GroupCompany:
      type: object
      description: グループ企業 1 社。根拠系の項目は直接の関係がある場合のみ入る。
      required:
        - name
        - membership
        - locationStatus
      properties:
        corporateNumber:
          type: string
          nullable: true
          description: 法人番号（13 桁）。出典の記載から企業を特定できなかった場合は null。
        name:
          type: string
          description: 企業名。特定できた場合は企業データベースの名称、できなかった場合は出典に記載されていた名称。
        relationType:
          type: string
          nullable: true
          description: |
            指定した企業から見た相手の種別。`membership` が `group_member` の場合は null。
            取りうる値: `parent`（親会社）/ `consolidated_subsidiary`（連結子会社）/
            `equity_method_affiliate`（持分法適用会社）/ `affiliate`（その他の関係会社）/
            `group_company`（種別を特定できなかった関係）。
        membership:
          type: string
          enum:
            - direct_relation
            - group_member
          description: |
            `direct_relation` = 指定した企業と直接の関係がある。
            `group_member` = 同じグループに属するが直接の関係は確認できていない。
        votingRatio:
          type: number
          nullable: true
          description: 議決権の所有割合（％）。出典に記載がない場合は null。
        locationStatus:
          type: string
          enum:
            - DOMESTIC
            - OVERSEAS
            - UNKNOWN
          description: 所在地の区分。住所の記載がなく判定できない場合は `UNKNOWN`。
        sourceType:
          type: string
          nullable: true
          description: |
            関係の出典。`edinet_yuho`（有価証券報告書）/ `official_web`（企業の公式サイト）/
            `catr`（既存の企業グループデータ）。
        evidenceUrl:
          type: string
          nullable: true
          description: 根拠となる文書の URL。
        fiscalPeriodEnd:
          type: string
          format: date
          nullable: true
          description: 出典が対象とする決算期の末日（YYYY-MM-DD）。
        confidence:
          type: number
          nullable: true
          description: |
            関係の確からしさ（0.00〜1.00）。出典と企業の特定方法で決まる。
            有価証券報告書かつ住所まで照合できた関係が最も高い。
        resolverStatus:
          type: string
          nullable: true
          description: |
            企業を特定できた経路。`CONFIRMED`（名称と住所が一致）/ `GBIZ_RESOLVED`（法人番号 API で特定）/
            `SUGGESTED`（名称は一致したが住所を確認できず未確定）/ `AMBIGUOUS`（候補が複数）/
            `UNRESOLVED`（特定できず）。
    GroupCompaniesResponse:
      type: object
      required:
        - corporateNumber
        - isListedGroup
        - groupCompanies
      properties:
        corporateNumber:
          type: string
          description: リクエストで指定した法人番号。
        groupId:
          type: string
          nullable: true
          description: |
            所属グループの識別子（最上位の親会社の法人番号）。
            親会社・子会社の支配関係でつながるグループに属さない場合は null。
        isListedGroup:
          type: boolean
          description: 自社または同一グループ内に上場企業が含まれるか。
        groupCompanies:
          type: array
          description: |
            グループ企業の一覧。直接の関係がある企業を先に、同じ区分では名称順に並びます。
            指定した企業自身は含まれません。
          items:
            $ref: '#/components/schemas/GroupCompany'
    Company:
      type: object
      description: 企業情報。
      required:
        - corporateNumber
        - name
        - workLocationCount
      properties:
        corporateNumber:
          type: string
          description: 法人番号（13 桁）。国税庁公開の企業識別子。
        name:
          type: string
          description: 企業名（正式名称）。
        furigana:
          type: string
          nullable: true
          description: 企業名のフリガナ（カタカナ）。
        corporateType:
          nullable: true
          description: 法人種別。`/master` のドキュメントを参照。
          allOf:
            - $ref: '#/components/schemas/CorporateType'
        postalCode:
          type: string
          nullable: true
          description: 本社郵便番号（ハイフンなし 7 桁）。
        prefectureId:
          type: integer
          nullable: true
          description: 本社所在地の都道府県 ID。`/master/prefectures` で取得できるマスターに対応。
        prefectureName:
          type: string
          nullable: true
          description: 本社所在地の都道府県名。
        cityName:
          type: string
          nullable: true
          description: 本社所在地の市区町村名。
        headOfficeAddress:
          type: string
          nullable: true
          description: 本社住所（番地以降）。
        industryCategoryId:
          type: integer
          nullable: true
          description: 業界カテゴリ（大分類）の ID。`/master/industries` のマスターに対応。
        industryCategoryName:
          type: string
          nullable: true
          description: 業界カテゴリ（大分類）の名称。
        industrySubCategoryId:
          type: integer
          nullable: true
          description: 業界サブカテゴリ（小分類）の ID。`/master/industries` のサブカテゴリに対応。
        industrySubCategoryName:
          type: string
          nullable: true
          description: 業界サブカテゴリ（小分類）の名称。
        phoneNumber:
          type: string
          nullable: true
          description: 企業の代表電話番号。
        fax:
          type: string
          nullable: true
          description: 企業の FAX 番号。
        websiteUrl:
          type: string
          nullable: true
          description: 企業サイト（コーポレートサイト）の URL。
        email:
          type: string
          nullable: true
          description: 企業の代表メールアドレス。
        employeeCount:
          type: integer
          nullable: true
          description: 従業員数（最新月時点）。
        capitalMillionYen:
          type: number
          nullable: true
          deprecated: true
          description: 非推奨。capitalYen を使う。capitalYen を百万円単位に換算した値
        capitalYen:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          nullable: true
          description: 資本金（円単位）。
        markets:
          type: array
          description: 上場している市場区分の一覧。未上場企業は空配列。
          items:
            $ref: '#/components/schemas/CompanyMarket'
        isListed:
          type: boolean
          description: 上場しているか（`markets` が 1 件以上あるか）。
        ceoName:
          type: string
          nullable: true
          description: 代表者氏名。
        foundedAt:
          type: string
          format: date-time
          nullable: true
          description: 設立年月日。
        corporateNumberAssignedAt:
          type: string
          format: date-time
          nullable: true
          description: |
            法人番号指定日。国税庁が法人番号を指定した日で、設立年月日 (`foundedAt`) とは異なります。
            2015-10-05 時点で既に設立登記が済んでいた法人は、原則としてこの日が一律に入ります。
            登記記録の復活など、新設以外の理由で番号が指定される場合もあります。
        hasDispatchLicense:
          type: boolean
          nullable: true
          description: 労働者派遣事業の許可 (派遣免許) を保有しているか。
        hasRecruitmentLicense:
          type: boolean
          nullable: true
          description: 有料職業紹介事業の許可 (職業紹介免許) を保有しているか。
        isClosed:
          type: boolean
          nullable: true
          description: 閉鎖済みか（国税庁の法人番号公表サイトで閉鎖日が登録されている場合 true）。
        employeeDiff6m:
          type: integer
          nullable: true
          description: 直近 6 ヶ月の従業員数増減（純増減数）。
        employeeDiff12m:
          type: integer
          nullable: true
          description: 直近 12 ヶ月の従業員数増減（純増減数）。
        fundingSeries:
          nullable: true
          description: 直近の資金調達ラウンド。
          allOf:
            - $ref: '#/components/schemas/FundingSeries'
        paidMedias:
          type: array
          description: 掲載課金型媒体（企業単位で出稿実績のあるもの）。
          items:
            $ref: '#/components/schemas/CompanyPaidMedia'
        summary:
          type: string
          nullable: true
          description: 事業概要文。求人情報をもとに要約した事業内容。
        directParentCorporateNumber:
          type: string
          nullable: true
          description: 直接の親会社の法人番号。親会社が確認できない場合は null。
        directParentName:
          type: string
          nullable: true
          description: 直接の親会社の企業名。
        ultimateParentCorporateNumber:
          type: string
          nullable: true
          description: |
            最上位の親会社（グループの頂点）の法人番号。
            自社が頂点の場合と親会社が確認できない場合はいずれも null。
        ultimateParentName:
          type: string
          nullable: true
          description: 最上位の親会社の企業名。
        directGroupCompanyCount:
          type: integer
          description: |
            直接の関係先のうち法人番号まで特定できた企業数。
            同じ相手は関係種別や出典が複数あっても 1 件として数える。
        knownGroupRelationCount:
          type: integer
          description: |
            直接の関係先の総数。法人番号を特定できなかった相手や海外法人も含む。
            `directGroupCompanyCount` 以上の値になる。
        groupMemberCount:
          type: integer
          description: |
            同一グループに属する企業数（自社を含む）。
            親会社・子会社の支配関係でつながるグループに属さない場合は 0 で、
            属する場合は自社を含むため 2 以上になる。
            関連会社だけの関係は支配関係に含めないため、この件数には反映されない。
        hasGroupCompanies:
          type: boolean
          description: |
            法人番号まで特定できたグループ関係が 1 件以上あるか
            （`directGroupCompanyCount` が 1 以上かどうかと一致する）。
            相手を特定できていない関係しか無い企業は false になる。
        isListedGroup:
          type: boolean
          description: |
            自社または同一グループ内に上場企業が含まれるか。
            支配関係のグループに属さない企業では、自社の上場状態がそのまま入る。
        workLocationCount:
          type: integer
          description: |
            求人の勤務地住所から集計した勤務地数。求人票に書かれた勤務地住所は通常その企業の
            事業所・店舗であるという前提に立った推定値で、個別に裏取りしたものではありません。
            登記上の事業所数や店舗の完全な網羅でもありません。勤務地を検知できない場合は 0 を返します。

            判定は住所単位で、その住所に紐づく求人をまとめて評価します。雇用主の拠点と推定できる
            求人が 1 件でもあれば数えます（同じ住所にフルリモートや客先常駐の求人が混在していても
            数えます）。

            逆に、そう推定できる求人が 1 件も無い住所は数えません。主な理由は次のとおりで、
            実際の勤務地の数より少なく見えることがあります。

            - 番地まで特定できない住所しか得られていない
            - フルリモート・客先常駐が明示された求人しかない
            - 単発・日雇いなどスポット性の高い求人しかない
            - 雇用主が労働者派遣・有料職業紹介の許可を持つ、または求人自体が派遣求人である。
              その住所が自社の事業所か派遣先・紹介先かを求人情報から判別できないため数えません。
              実店舗を持つ企業であっても、許可を保有していれば 0 になることがあります
        recruitPhoneNumber:
          type: string
          nullable: true
          description: 求人の応募先から選定した採用の電話番号。代表電話 `phoneNumber` とは別で互いに補完しない。
        recruitPhoneLastSeen:
          type: string
          format: date-time
          nullable: true
          description: '`recruitPhoneNumber` を最後に求人で確認できた日（値の鮮度）。'
    CompanyPaidMedia:
      type: object
      description: 企業が出稿している掲載課金型媒体。
      required:
        - mediaId
        - mediaName
      properties:
        mediaId:
          type: integer
          description: 媒体 ID。`/master/media` のマスターに対応。
        mediaName:
          type: string
          description: 媒体名。
    CompanyMarket:
      type: object
      description: 企業が上場している市場区分。
      properties:
        code:
          type: string
          description: |
            市場区分コード。`/master/markets` のマスターに対応。
            取りうる値: `tse_prime` / `tse_standard` / `tse_growth` / `tse_pro_market` /
            `nse_main` / `nse_premier` / `nse_next` / `fse_main` / `fse_q_board` /
            `fse_pro_market` / `sse_main` / `sse_ambitious`。
        exchangeCode:
          description: 取引所コード（東証 / 名証 / 福証 / 札証）。
          $ref: '#/components/schemas/ExchangeCode'
        name:
          type: string
          description: 市場区分名（日本語表記）。`/master/markets` のマスターから取得した名称。
    JobSearchRequest:
      type: object
      additionalProperties: false
      description: 求人検索リクエスト。
      properties:
        limit:
          type: integer
          minimum: 1
          maximum: 1000
          default: 25
        offset:
          type: integer
          minimum: 0
          default: 0
          description: |
            先頭からスキップする件数。`offset + limit` は 500,000 以下である必要があります。
            超過した場合は 400 エラーになります。
        includeTotalResults:
          type: boolean
          default: true
          description: レスポンスに総件数（`total`）を含めるか。false にすると `total` は null になり、応答が速くなります。
        sort:
          type: object
          description: 並び替え指定。省略時は `job.createdAt` の降順。
          properties:
            field:
              $ref: '#/components/schemas/JobSortField'
            order:
              type: string
              description: 並び順（昇順 / 降順）
              enum:
                - asc
                - desc
          required:
            - field
            - order
        filter:
          $ref: '#/components/schemas/SearchFilter'
    JobSearchResponse:
      type: object
      required:
        - total
        - items
      properties:
        total:
          type: integer
          nullable: true
          description: 検索条件にマッチした求人の総件数。リクエストで `includeTotalResults` を `false` にした場合は null。
        items:
          type: array
          description: 検索結果の求人一覧。`limit` / `offset` でページングされる。
          items:
            $ref: '#/components/schemas/Job'
    JobDetail:
      description: 求人 1 件（`Job` と同じ項目）に求人詳細の全文を加えたもの。
      allOf:
        - $ref: '#/components/schemas/Job'
        - type: object
          required:
            - description
          properties:
            description:
              type: string
              nullable: true
              description: 求人詳細（全文）。求人詳細を持たない求人（直近 6 ヶ月より前に取得した求人）では null。
    Job:
      type: object
      description: 求人情報。
      required:
        - id
        - company
        - mediaId
        - mediaName
        - title
        - jobPostingUrl
        - jobCreatedAt
        - workLocations
      properties:
        id:
          type: string
          minLength: 18
          maxLength: 18
          description: 求人 ID（18 文字）。求人を一意に識別する ID。
        company:
          allOf:
            - $ref: '#/components/schemas/JobCompany'
          description: 求人を出している企業。
        mediaId:
          type: integer
          description: 媒体 ID。`/master/media` のマスターに対応。
        mediaName:
          type: string
          description: 媒体名。`/master/media` のマスターから取得した名称。
        title:
          type: string
          description: 求人タイトル。
        jobPostingUrl:
          type: string
          description: 取得媒体上の求人 URL。取得元の媒体に掲載されている求人ページの URL で、必ず値を持つ。
        originalJobUrl:
          type: string
          nullable: true
          description: 転載元の求人 URL。アグリゲーション媒体に転載された求人で、転載元メディアの URL が取得できた場合のみ値を持つ（取得できない場合は null）。
        jobCategoryId:
          type: integer
          nullable: true
          description: 職種カテゴリ（大分類）の ID。`/master/job-categories` に対応。
        jobCategoryName:
          type: string
          nullable: true
          description: 職種カテゴリ（大分類）の名称。
        jobSubCategoryId:
          type: integer
          nullable: true
          description: 職種サブカテゴリ（小分類）の ID。`/master/job-categories` のサブカテゴリに対応。
        jobSubCategoryName:
          type: string
          nullable: true
          description: 職種サブカテゴリ（小分類）の名称。
        employmentTypes:
          type: array
          description: 雇用形態（正社員 / 契約社員 / アルバイト など）。複数可。
          items:
            $ref: '#/components/schemas/JobEmploymentType'
        mediaPlan:
          type: string
          nullable: true
          description: 媒体プラン名（媒体ごとに付与されるプラン識別子）。
        salaryType:
          type: string
          nullable: true
          description: 給与種別（日本語表記）。`salaryMin` / `salaryMax` の金額の単位を表す。
          enum:
            - 年収
            - 月給
            - 日給
            - 時給
        salaryMin:
          type: integer
          nullable: true
          description: 給与下限（`salaryType` の単位に従った金額）。
        salaryMax:
          type: integer
          nullable: true
          description: 給与上限（`salaryType` の単位に従った金額）。
        contactEmail:
          type: string
          nullable: true
          description: 対象の求人ページに掲載されたメールアドレス。
        contactPhoneNumber:
          type: string
          nullable: true
          description: 対象の求人ページに掲載された電話番号。
        workLocation:
          type: array
          nullable: true
          description: |
            勤務地（構造化された文字列の配列）。求人票に記載された勤務地の原文です。
            拠点マスターに解決済みの構造化データは `workLocations` を参照してください。
          items:
            type: string
        workLocations:
          type: array
          description: |
            拠点マスターに解決できた勤務地の一覧。勤務地の原文（`workLocation`）から住所を正規化し、
            企業の拠点として名寄せしたものです。`locationEligibility` が `INCLUDE`（雇用主の拠点と
            確認済み）と `REVIEW`（判定保留）の拠点を含みます。確定拠点のみ必要な場合は
            `locationEligibility = INCLUDE` で絞り込んでください。
            住所を番地まで特定できなかった勤務地は含まれないため、空配列になることがあります。
          items:
            $ref: '#/components/schemas/JobWorkLocation'
        openedOn:
          type: string
          format: date-time
          nullable: true
          description: 求人の募集開始日。検索・ソートでは `job.openedOn` を指定します。
        deadlineOn:
          type: string
          format: date-time
          nullable: true
          description: 求人の募集終了日（応募締切）。検索・ソートでは `job.deadlineOn` を指定します。
        jobCreatedAt:
          type: string
          format: date-time
          description: SalesBrain が本求人を取得した日時。
        descriptionSnippets:
          type: array
          description: |
            求人詳細の抜粋。求人詳細キーワード検索を指定した場合はマッチ箇所ごとに、
            マッチ部分を `<mark>` 〜 `</mark>` で囲んだ前後の抜粋を返します（上限 5 件）。
            指定しない場合は求人詳細冒頭の抜粋を 1 件返します。
            求人詳細を持たない求人（直近 6 ヶ月より前に取得した求人）では空配列。全文は `GET /jobs/{jobId}` で取得できます。
          items:
            type: string
    JobCompany:
      type: object
      description: 求人を出している企業の属性（`Company` の一部）。
      required:
        - corporateNumber
        - name
      properties:
        corporateNumber:
          type: string
          description: 法人番号（13 桁）。`Company.corporateNumber` に対応。
        name:
          type: string
          description: 企業名（正式名称）。
        prefectureName:
          type: string
          nullable: true
          description: 本社所在地（都道府県）。
        cityName:
          type: string
          nullable: true
          description: 本社所在地（市区町村）。
        headOfficeAddress:
          type: string
          nullable: true
          description: 本社住所（番地以降）。
        employeeCount:
          type: integer
          nullable: true
          description: 従業員数（最新月時点）。
        isClosed:
          type: boolean
          nullable: true
          description: 閉鎖済みか（国税庁の法人番号公表サイトで閉鎖日が登録されている場合 true）。
    JobEmploymentType:
      type: object
      description: 求人の雇用形態。
      properties:
        id:
          type: integer
          description: 雇用形態 ID。`/master/employment-types` のマスターに対応。
        code:
          type: string
          description: |
            雇用形態コード（英字）。取りうる値: `full_time` / `contract` / `part_time` /
            `temporary` / `freelance` / `side_job` / `intern` / `new_graduate` /
            `other` / `unknown`。
        name:
          type: string
          description: 雇用形態名（日本語表記）。`/master/employment-types` のマスターから取得した名称。
    JobWorkLocation:
      type: object
      description: 求人の勤務地から拠点マスターに解決した拠点。
      required:
        - locationId
        - normalizedAddress
        - prefectureName
        - cityName
        - confidence
        - locationEligibility
        - firstSeenAt
        - lastSeenAt
      properties:
        locationId:
          type: string
          description: |
            拠点 ID（`loc_` プレフィックス付き）。法人番号と住所（ビル名・階数を除いた番地まで）の
            組で同一性を判定します。したがって同一企業の同じ拠点は求人をまたいで同じ ID になり、
            同じ住所でも法人番号が異なれば別 ID になります。
            拠点が統合された場合は、常に統合先の ID を返します。
        normalizedAddress:
          type: string
          description: |
            正規化した住所。表記ゆれを揃えた住所文字列で、元の求人表記に
            ビル名・階数が含まれていた場合はそれらも含みます。
        prefectureName:
          type: string
          description: 拠点住所の都道府県名。
        cityName:
          type: string
          description: 拠点住所の市区町村名。
        confidence:
          type: string
          enum:
            - exact_address
            - extracted_address
          description: |
            住所確度。`exact_address` は番地まで住所を確定できた拠点、
            `extracted_address` は勤務地の原文から抽出した番地に基づく拠点。
        locationEligibility:
          type: string
          enum:
            - INCLUDE
            - REVIEW
          description: |
            雇用主の拠点としての判定状態。判定は拠点単位で、その拠点に紐づく求人すべてを
            まとめて評価します。`INCLUDE` は勤務先がその企業の事業所・店舗であると推定できる
            求人が 1 件以上ある拠点、`REVIEW` はそう推定できる求人が 1 件も無い拠点です。
            推定は「除外すべきシグナルが見つからなかった」ことに基づくもので、個別に裏取り
            されたものではありません。`Company.workLocationCount` には `INCLUDE` の拠点のみが
            数えられます。

            `REVIEW` になる主な理由は、雇用主が労働者派遣・有料職業紹介の許可を持つ、または
            求人自体が派遣求人であることです。その住所が自社の事業所か派遣先・紹介先かを
            求人情報から判別できないため保留にしています。フルリモート・客先常駐が明示された
            求人しかない拠点も `REVIEW` になります。
        firstSeenAt:
          type: string
          format: date-time
          description: この拠点を求人から初めて確認した日時。
        lastSeenAt:
          type: string
          format: date-time
          description: この拠点を求人で最後に確認した日時。
    MasterPrefecture:
      type: object
      description: 都道府県マスター。
      required:
        - id
        - name
      properties:
        id:
          type: integer
          description: 都道府県 ID（JIS コード 1〜47）。
        name:
          type: string
          description: 都道府県名（日本語表記）。
    MasterIndustryCategory:
      type: object
      description: 業界カテゴリ（大分類）。配下に複数のサブカテゴリを持つ。
      required:
        - id
        - name
        - subCategories
      properties:
        id:
          type: integer
          description: 業界カテゴリ ID。
        name:
          type: string
          description: 業界カテゴリ名（日本語表記）。
        subCategories:
          type: array
          description: 配下のサブカテゴリ一覧。
          items:
            $ref: '#/components/schemas/MasterSubCategory'
    MasterMedia:
      type: object
      description: 求人媒体マスター。
      required:
        - id
        - name
      properties:
        id:
          type: integer
          description: 媒体 ID。
        name:
          type: string
          description: 媒体名。
    MasterJobCategory:
      type: object
      description: 職種カテゴリ（大分類）。配下に複数のサブカテゴリを持つ。
      required:
        - id
        - name
        - subCategories
      properties:
        id:
          type: integer
          description: 職種カテゴリ ID。
        name:
          type: string
          description: 職種カテゴリ名（日本語表記）。
        subCategories:
          type: array
          description: 配下のサブカテゴリ一覧。
          items:
            $ref: '#/components/schemas/MasterSubCategory'
    MasterSubCategory:
      type: object
      description: 業界 / 職種のサブカテゴリ（小分類）。
      required:
        - id
        - name
      properties:
        id:
          type: integer
          description: サブカテゴリ ID。
        name:
          type: string
          description: サブカテゴリ名。
    MasterMarket:
      type: object
      description: 株式市場の市場区分マスター（東証プライム / スタンダード等）。
      required:
        - id
        - code
        - exchangeCode
        - name
      properties:
        id:
          type: integer
          description: 市場区分 ID。
        code:
          type: string
          description: |
            市場区分コード。取りうる値: `tse_prime` / `tse_standard` / `tse_growth` /
            `tse_pro_market` / `nse_main` / `nse_premier` / `nse_next` /
            `fse_main` / `fse_q_board` / `fse_pro_market` / `sse_main` / `sse_ambitious`。
        exchangeCode:
          description: 取引所コード（東証 / 名証 / 福証 / 札証）。
          $ref: '#/components/schemas/ExchangeCode'
        name:
          type: string
          description: 市場区分名（日本語表記）。
    MasterEmploymentType:
      type: object
      description: 雇用形態マスター。
      required:
        - id
        - code
        - name
      properties:
        id:
          type: integer
          description: 雇用形態 ID。
        code:
          type: string
          description: |
            雇用形態コード（英字）。取りうる値: `full_time` / `contract` / `part_time` /
            `temporary` / `freelance` / `side_job` / `intern` / `new_graduate` /
            `other` / `unknown`。
        name:
          type: string
          description: 雇用形態名（日本語表記）。
    MasterCity:
      type: string
      description: |
        市区町村。「都道府県名+市区町村名」の複合値（例: `東京都渋谷区`）。
      example: 東京都渋谷区
    ErrorResponse:
      type: object
      description: エラーレスポンス共通形式。バリデーションエラーや認証失敗、内部エラー時に返される。
      required:
        - message
      properties:
        message:
          type: string
          description: 人間可読のエラーメッセージ。
        errors:
          type: array
          description: バリデーションエラーの詳細（フィールド単位の内訳）。`message` が `Validation failed` 系のときに付与される。
          items:
            $ref: '#/components/schemas/ValidationError'
    InsufficientCreditResponse:
      type: object
      description: クレジット不足（402）のレスポンス。必要数と残高を見て `limit` を下げるなど、消費を抑えて再試行できる。
      required:
        - message
      properties:
        message:
          type: string
          description: 人間可読のエラーメッセージ。
        required_credits:
          type: integer
          description: このリクエストに必要だったクレジット数。
        balance:
          type: integer
          description: リクエスト時点のクレジット残高。
    ValidationError:
      type: object
      description: フィールド単位のバリデーションエラー詳細。
      required:
        - field
        - message
      properties:
        field:
          type: string
          description: エラーが発生したフィールドのパス（`filter.company.corporateNumber.in.0` のような形式）。
        message:
          type: string
          description: 当該フィールドのエラーメッセージ。
  parameters:
    CorporateNumber:
      name: corporateNumber
      in: path
      required: true
      description: 法人番号（13 桁）。
      schema:
        type: string
        pattern: ^\d{13}$
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
