---
title: "Create an on-call binding"
method: POST
path: "/oncall/bindings"
tags: ["On-Call"]
---

# Create an on-call binding

`POST /oncall/bindings`

## Request

- Base URL: `https://api.marboba.com/v1`
- URL: `https://api.marboba.com/v1/oncall/bindings`
- Auth: HTTP bearer

## Request body

- OnCallBindingInput: Create payload for an on-call binding. `scheduleId` is required when `provider` is `pagerduty` or `opsgenie`; ignored for `manual`.
  - `scope` 'team' | 'component' | 'resource', required
  - `targetId` string, required
  - `provider` 'pagerduty' | 'opsgenie' | 'manual', required
  - `scheduleId` string, nullable
  - `label` string, nullable

## Response `201`

Created

- object
  - `binding` OnCallBinding: A binding from a team or component to an on-call provider. Provider credentials live in `_config/oncallIntegration` and are never exposed by /v1.
    - `id` string, required
    - `scope` 'team' | 'component' | 'resource', required
    - `targetId` string, required: Team id when scope=team, app id when scope=component.
    - `provider` 'pagerduty' | 'opsgenie' | 'manual', required
    - `scheduleId` string, nullable: Provider-side schedule id; null for manual bindings.
    - `label` string, nullable
    - `currentlyOnCallUserName` string, nullable
    - `currentlyOnCallUserEmail` string, nullable
    - `currentlyOnCallUserUid` string, nullable: Resolved org employee uid when the on-call email matches.
    - `currentShiftStartsAt` string, date-time, nullable
    - `currentShiftEndsAt` string, date-time, nullable
    - `lastFetchedAt` string, date-time, nullable
    - `lastFetchError` string, nullable
    - `createdAt` string, date-time, nullable
    - `updatedAt` string, date-time, nullable

## Other responses

- `400` (unresolved $ref)
- `409`: A binding for the same (scope, targetId, provider) triple already exists.

---

[API](https://skmtc.dev/marboba/apis/marboba-public-rest-api.md) · [All operations](https://skmtc.dev/marboba/apis/marboba-public-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/marboba/apis/marboba-public-rest-api/revisions/5b96d525d88d?raw)
