EvoHub DocsEvoHub Docs Sign in

Preview a change to a layer

Use with AI
View as MarkdownThis page as plain text, for pasting into an AI tool Open in ClaudeAsk Claude questions about this page Open in ChatGPTAsk ChatGPT questions about this page
Connect to Cursor / VS Code / ClaudeSearch and read these docs from your AI tool (MCP server)

MCP server URL

https://docs.evohub.io/mcp

Claude Code

claude mcp add --transport http evohub-docs https://docs.evohub.io/mcp

Claude (claude.ai and Claude Desktop): Settings → Connectors → Add custom connector, and paste the URL above.

Claude Desktop — claude_desktop_config.json

{
  "mcpServers": {
    "evohub-docs": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://docs.evohub.io/mcp"
      ]
    }
  }
}

Cursor — ~/.cursor/mcp.json

{
  "mcpServers": {
    "evohub-docs": {
      "url": "https://docs.evohub.io/mcp"
    }
  }
}

VS Code — .vscode/mcp.json

{
  "servers": {
    "evohub-docs": {
      "type": "http",
      "url": "https://docs.evohub.io/mcp"
    }
  }
}
POST/api/v1/schedules/{id}/layers/{layerID}/revise/preview

What POST /api/v1/schedules/{id}/layers/{layerID}/revise would do with the same body, without storing anything: when the change would take over, and the next six turns — the layer as it stands until then, the changed layer after.

Permission (API-key scope): oncall:schedule:write.

Authorization

Any one of:

Parameters

Path parameters

  • id string required
    The schedule's id.
    Example: 5b1c7d2e-8f3a-4b9c-a0d1-e2f3a4b5c6d7
  • layerID string required
    The layer's id. It must belong to the schedule in the path.
    Example: 7c3d9e1f-2a4b-4c6d-8e0f-1a2b3c4d5e6f

Request body required

Content type: application/json

Type: ScheduleLayerRevision

A layer as it should be, and when that takes over. name and rotation_type are required. rotation_start is checked but not used; the changed layer starts at the moment the change takes over.

  • name string
  • priority integer
  • rotation_type RotationType
    One of: daily weekly custom
  • rotation_unit string
    What handoff_day counts on a custom rotation; day when left out.
    One of: day hour
  • rotation_start string (date-time)
  • handoff_day integer
    For a custom rotation, the days (1–365) or hours (1–168) each turn lasts.
  • handoff_weekday integer
    The weekday a weekly rotation hands over on, 0 (Sunday) to 6. Left out, it hands over on the weekday rotation_start falls on.
    Minimum: 0 · Maximum: 6
  • handoff_time string
    HH:MM on the schedule's clock.
  • restrict_to_weekdays array of integer
  • restrict_start_time string
  • restrict_end_time string
  • user_ids array of string
    The members in rota order, each once.
  • effective string
    One of: now after_current_shift after_full_rotation at · Default: after_current_shift
  • at string (date-time)
    With effective at, the moment the change takes over; not in the past.
  • restart boolean
    Begin the new list at its first member instead of keeping the current holder.
    Default: false

Responses

200

When the change would take over, and the next six turns.

Content type: application/json

Type: object

  • data object required
    • effective_at string (date-time) required
    • turns array of ScheduleTurn required
      Show ScheduleTurn properties
      • layer_id string
        The layer giving the turn (preview for a layer that is not stored yet).
      • user_id string
        Who holds the turn; empty in a preview with no members.
      • start string (date-time)
      • end string (date-time)
  • success boolean required
    Value: true

400

The body is invalid as for the change itself (INVALID_BODY, VALIDATION_FAILED).

Content type: application/json

Type: ValidationError

  • error object required
    • code string required
      Value: VALIDATION_FAILED
    • message string required
    • request_id string
      The request's X-Request-ID. Quote it to support.
    • details array of object required
      • field string
      • message string

401

No API key was sent, or it is unknown, revoked or expired (UNAUTHORIZED).

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.
    • request_id string
      The request's X-Request-ID. Quote it to support.

403

The key lacks the scope this endpoint needs (FORBIDDEN).

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.
    • request_id string
      The request's X-Request-ID. Quote it to support.

404

No such schedule, or no such layer on it (NOT_FOUND).

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.
    • request_id string
      The request's X-Request-ID. Quote it to support.

409

The layer has ended or has not started yet (LAYER_NOT_IN_EFFECT).

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.
    • request_id string
      The request's X-Request-ID. Quote it to support.

429

Too many requests (RATE_LIMITED). Wait Retry-After seconds.

Headers

  • Retry-After integer
    Seconds to wait.

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.
    • request_id string
      The request's X-Request-ID. Quote it to support.

500

Something went wrong on EvoHub's side (INTERNAL_ERROR). Retry later.

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.
    • request_id string
      The request's X-Request-ID. Quote it to support.

Example request

curl -X POST 'https://evohub.io/api/v1/schedules/5b1c7d2e-8f3a-4b9c-a0d1-e2f3a4b5c6d7/layers/7c3d9e1f-2a4b-4c6d-8e0f-1a2b3c4d5e6f/revise/preview' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <TOKEN>' \
  -d '{
  "name": "Primary",
  "user_ids": [
    "0b8e6c1a-2f4d-4e9b-8a7c-3d5e6f708192",
    "9a7b5c3d-1e2f-4a6b-8c0d-2e4f6a8b0c1d"
  ],
  "effective": "after_full_rotation",
  "handoff_time": "09:00",
  "rotation_type": "weekly",
  "handoff_weekday": 1
}'