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

# スケジュールの作成

> 指定された時間にAPIコールを実行する新しいスケジュールを作成します。一度きりの実行とcron式を使用した定期的なスケジュールの両方をサポートしています。自然言語テキストを使用してcron式を自動生成することもできます。



## OpenAPI

````yaml ja/openapi/schedules.json POST /v1/schedules
openapi: 3.0.3
info:
  title: スケジュールAPI
  version: 1.0.0
servers:
  - url: https://api.olostep.com
security: []
paths:
  /v1/schedules:
    post:
      summary: スケジュール作成
      description: >-
        指定された時間にAPIコールを実行する新しいスケジュールを作成します。一度きりの実行とcron式を使用した定期的なスケジュールの両方をサポートしています。また、自然言語テキストを使用してcron式を自動生成することもできます。POSTリクエストの場合、短縮形のOlostepエンドポイント（例:
        'v1/scrapes'）を使用することができ、自動的にプレフィックスが追加されます。または、完全なURLを提供することもできます。ペイロードには送信したい任意のJSON構造を含めることができます。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                  enum:
                    - GET
                    - POST
                  description: スケジュールされたAPIコールのHTTPメソッド。GETまたはPOSTのいずれかでなければなりません。
                endpoint:
                  type: string
                  description: >-
                    スケジュールが実行されたときに呼び出されるエンドポイントURL。Olostepエンドポイントを使用したPOSTリクエストの場合、短縮形（例:
                    'v1/scrapes', 'v1/batches', 'v1/crawls', 'v1/maps',
                    'v1/answers'）を使用することができ、自動的に'https://api.olostep.com/'がプレフィックスされます。他のエンドポイントの場合は、完全なURLを提供してください。
                payload:
                  type: object
                  description: >-
                    APIコールと共に送信するペイロード。必要な任意のJSON構造を含めることができます。GETリクエストの場合、通常は空です。POSTリクエストの場合、エンドポイントに送信したいデータを含める必要があります。
                  default: {}
                cron_expression:
                  type: string
                  description: >-
                    定期的なスケジュールのための6フィールド形式のcron式（分 時 日 月 曜日
                    年）。定期的なスケジュールには必須です。execute_atおよびtextとは相互排他的です。
                execute_at:
                  type: string
                  format: date-time
                  description: >-
                    一度きりのスケジュール実行のためのISO
                    8601日時文字列。有効な未来の日時でなければなりません。一度きりのスケジュールには必須です。cron_expressionとは相互排他的です。
                expression_timezone:
                  type: string
                  description: >-
                    スケジュールのためのIANAタイムゾーン識別子（例: 'UTC', 'America/New_York',
                    'Europe/London'）。定期的なスケジュールには必須で、一度きりのスケジュールにはオプションです。自然言語テキストを使用する場合、デフォルトは'UTC'です。
                text:
                  type: string
                  description: >-
                    自動的にcron式を生成するための自然言語テキスト。システムはあなたのテキストを有効なcron式に変換します。例:
                    'every 3 minutes', 'every day at 10am', 'every Monday at
                    9am'。cron_expressionおよびexecute_atとは相互排他的です。使用する場合、expression_timezoneのデフォルトは'UTC'です。
              required:
                - method
                - endpoint
      responses:
        '200':
          description: スケジュールが正常に作成されました。
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: ユニークなスケジュール識別子
                  type:
                    type: string
                    enum:
                      - recurring
                      - onetime
                    description: >-
                      スケジュールのタイプ:
                      cronベースのスケジュールの場合は'recurring'、単一実行スケジュールの場合は'onetime'
                  method:
                    type: string
                    enum:
                      - GET
                      - POST
                    description: スケジュールされたコールのHTTPメソッド
                  endpoint:
                    type: string
                    description: 呼び出されるエンドポイントURL
                  cron_expression:
                    type: string
                    description: Cron式（定期的なスケジュールの場合のみ存在）
                  execute_at:
                    type: string
                    format: date-time
                    description: 実行日時（一度きりのスケジュールの場合のみ存在）
                  expression_timezone:
                    type: string
                    description: スケジュールのタイムゾーン
                  created:
                    type: string
                    format: date-time
                    description: スケジュールが作成されたISO 8601日時
        '400':
          description: >-
            不正なまたは不足しているパラメータによる不正なリクエスト。一般的なエラー:
            無効なメソッド、エンドポイントの欠如、無効なcron_expression、無効なexecute_at日時、無効なタイムゾーン、または無効なschedule_id形式。
        '401':
          description: 無効なAPIキーです。もう一度確認するか、問題がある場合はinfo@olostep.comに連絡してください。
        '500':
          description: スケジュール作成中に内部サーバーエラーが発生しました。
      security:
        - Authorization: []
components:
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: Bearer <token>形式のBearer認証ヘッダー。<token>はあなたの認証トークンです。

````