# Raise an obligation

Puts a new thing owed on a deal — a stipulation, a document, reporting, a covenant check, insurance, a licence renewal, a review, a repayment. Body: `dueAt` is required and so is a `title`; `dealRowId` (the deal record on our own board) or `facilityId` says what it is for, plus `obligationType` (repayment, document_submit, stipulation, reporting, covenant_check, insurance, license_renewal, review), `priority` (low, medium, high, critical), `responsibleParty` (borrower, lender, broker, system), `description`, `notes`, `assignedToUserId`, `currency`, `amountMinor` (MINOR UNITS), `requiredDocumentType`, `slaHours`, and the `counterpartyId` / `submissionId` / `decisionId` / `parentObligationId` links. With `slaHours` the breach moment is computed once from the due date, so the pair cannot drift. It opens pending.

Access class: `workspace`.

## Endpoint

`POST /v1/obligations`

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "amountMinor": 1,
    "assignedToUserId": 1,
    "counterpartyId": 1,
    "currency": "string",
    "dealRowId": "",
    "decisionId": 1,
    "description": "string",
    "dueAt": "string",
    "facilityId": 1,
    "notes": "string",
    "obligationType": "string",
    "parentObligationId": 1,
    "priority": "string",
    "requiredDocumentType": "string",
    "responsibleParty": "string",
    "slaHours": 1,
    "submissionId": 1,
    "title": "string"
  },
  "params": {},
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "amountMinor": 1,
    "assignedToUserId": 1,
    "breachSeverity": "string",
    "completedAt": "string",
    "completedByUserId": 1,
    "counterpartyId": 1,
    "createdAt": "string",
    "currency": "string",
    "dealRowId": "",
    "decisionId": 1,
    "description": "string",
    "detail": {},
    "documentId": 1,
    "dueAt": "string",
    "escalatedAt": "string",
    "escalatedToUserId": 1,
    "facilityId": 1,
    "id": 1,
    "isRecurring": true,
    "notes": "string",
    "obligationType": "string",
    "parentObligationId": 1,
    "priority": "string",
    "recurrenceRule": "string",
    "requiredDocumentType": "string",
    "responsibleParty": "string",
    "slaBreachAt": "string",
    "slaHours": 1,
    "status": "string",
    "submissionId": 1,
    "title": "string",
    "updatedAt": "string",
    "waivedAt": "string",
    "waivedByUserId": 1,
    "waivedReason": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
