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

# SignOff REST endpoints

> Reference page for the Atoti Sign-Off adjustments REST API, covering endpoints to retrieve supported adjustment types, submit adjustment requests, and check execution status.

## Supported adjustments

Endpoint: `/adjustments/supported/<_server_name_>`
Method : `GET`
Example endpoint: [http://localhost:9090/adjustments/supported/MR](http://localhost:9090/adjustments/supported/MR)

Result is a serialized array of `SupportedAdjustmentDTOs` [read more about this DTO](.#isignoffsupportedadjustmentsservice)

Example Result:

```
[
   {
       "name": "Add-on",
       "type": "SENSI_ADD_ON",
       "factLevel": true,
       "cube": "Sensitivity Cube",
       "stores": [
           "TradeSensitivities"
       ],
       "filters": [
           {
               "name": "RiskFactorId2",
               "type": "string",
               "optional": false,
               "levelPath": "[Risk].[Risk Factors Secondary].[RiskFactor2]"
           },
           {
               "name": "Ccy",
               "type": "string",
               "optional": false,
               "levelPath": "[Currencies].[Currencies].[Ccy]"
           },
           {
               "name": "MaturityLabels",
               "type": "string",
               "optional": false,
               "levelPath": "[Risk].[Maturities].[Maturity]"
           },
           {
               "name": "TenorDates",
               "type": "string",
               "optional": false,
               "levelPath": "[Risk].[Tenor Dates].[Tenor Date]"
           },
           {
               "name": "TenorLabels",
               "type": "string",
               "optional": false,
               "levelPath": "[Risk].[Tenors].[Tenor]"
           },
           {
               "name": "SensitivityName",
               "type": "string",
               "optional": false,
               "levelPath": "[Sensitivities].[Sensitivity].[SensitivityName]"
           },
           {
               "name": "RiskFactorId",
               "type": "string",
               "optional": false,
               "levelPath": "[Risk].[Risk Factors].[RiskFactor]"
           },
           {
               "name": "AsOfDate",
               "type": "localDate[yyyy-MM-dd]",
               "optional": false,
               "levelPath": "[Dates].[Date].[AsOfDate]"
           },
           {
               "name": "Moneyness",
               "type": "string",
               "optional": false,
               "levelPath": "[Risk].[Moneyness].[Moneyness]"
           },
           {
               "name": "TradeId",
               "type": "string",
               "optional": false,
               "levelPath": "[Booking].[Trades].[TradeId]"
           },
           {
               "name": "MaturityDates",
               "type": "string",
               "optional": false,
               "levelPath": "[Risk].[Maturity Dates].[Maturity Date]"
           }
       ],
       "measures": [
           "CrossGamma Native",
           "Cash Native",
           "Dividend Quantity",
           "Gamma Native",
           "Theta Native",
           "Delta Native",
           "Volga Native",
           "Vega Native",
           "Vanna Native"
       ],
       "input": [
           {
               "name": "Values",
               "type": "double",
               "optional": false,
                "main": true
           }
       ]
   },
   {
       "name": "Add-on",
       "type": "PNL_ADD_ON",
       "factLevel": true,
       "cube": "PLCube",
       "stores": [
           "PnL"
       ],
       "filters": [
           {
               "name": "Ccy",
               "type": "string",
               "optional": false,
               "levelPath": "[Currencies].[Currencies].[Ccy]"
           },
           {
               "name": "RiskFactor",
               "type": "string",
               "optional": false,
               "levelPath": "[Risk].[Risk Factors].[RiskFactor]"
           },
           {
               "name": "AsOfDate",
               "type": "localDate[yyyy-MM-dd]",
               "optional": false,
               "levelPath": "[Dates].[Date].[AsOfDate]"
           },
           {
               "name": "Type",
               "type": "string",
               "optional": false,
               "levelPath": "[PnL].[Types].[Type]"
           },
           {
               "name": "TradeId",
               "type": "string",
               "optional": false,
               "levelPath": "[Booking].[Trades].[TradeId]"
           }
       ],
       "measures": [
           "DTD PnL Native"
       ],
       "input": [
           {
               "name": "Daily",
               "type": "double",
               "optional": false,
                "main": true
           }
       ]
   }
]
```

## Adjustment execution

Endpoint: `/adjustments/request`
Method : `POST`
Example endpoint: [http://localhost:9090/adjustments/request](http://localhost:9090/adjustments/request)

Body is a serialized `AuditableAdjustmentRequestDTO` [read more about this DTO](.#dtos-1)

Example Body:

```
{
   "serverName":"MR",
   "type":"PNL_ADD_ON",
   "user":"User",
   "task":"Task",
   "comment":"Test Comment",
   "filters":[
      {
         "name":"AsOfDate",
         "value":"2018-09-28"
      },
      {
         "name":"TradeId",
         "value":"CDS_Allegheny Energy 3cc00452"
      },
      {
         "name":"Type",
         "value":"Actual PL Attributed"
      },
      {
         "name":"RiskFactor",
         "value":"Allegheny Energy_Credit spread"
      }
   ],
   "measures":[
      "DTD PnL Native"
   ],
   "input":[
      [
         {
            "name":"Daily",
            "value":"10000.0"
         }
      ]
   ]
}
```

Result is the execution ID

Example Result:
`"PNL_ADD_ON_0"`

## Adjustment creation (sign-off server)

The following endpoints are hosted on the sign-off server (not the application server). They create adjustments and return identifiers that can be used to track execution status.

### Bulk creation

Endpoint: `/sign-off/rest/v2/adjustments`
Method: `POST`
Example endpoint: [http://localhost:8080/sign-off/rest/v2/adjustments](http://localhost:8080/sign-off/rest/v2/adjustments)

The request body is a JSON array of adjustment objects. Each object accepts the following fields:

| Field           | Type                     | Description                                      |
| --------------- | ------------------------ | ------------------------------------------------ |
| `signOffTaskId` | number                   | The identifier of the sign-off task.             |
| `type`          | string                   | The adjustment type (for example, `PNL_ADD_ON`). |
| `reason`        | string                   | The reason for the adjustment.                   |
| `comment`       | string                   | A free-text comment.                             |
| `startDate`     | string                   | The start date of the adjustment scope.          |
| `endDate`       | string                   | The end date of the adjustment scope.            |
| `location`      | array of `{name, value}` | The location filters that scope the adjustment.  |
| `measures`      | array of strings         | The measures targeted by the adjustment.         |
| `input`         | array of `{name, value}` | The input values for the adjustment.             |

The response is a JSON array in the same order as the request. Each element contains:

| Field          | Type   | Description                                                                                                                                                                  |
| -------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`           | number | The database id of the created adjustment. Matches the `id` returned by `GET /sign-off/rest/v2/adjustments/{taskId}` and accepted by `DELETE /sign-off/rest/v2/adjustments`. |
| `executionId`  | string | The stable identifier of the adjustment execution. Used by the status endpoints.                                                                                             |
| `definitionId` | string | The identifier of the adjustment definition.                                                                                                                                 |

Example response:

```json theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
[
   { "id": 1, "executionId": "PNL_ADD_ON_0", "definitionId": "0a1b2c3d-..." },
   { "id": 2, "executionId": "PNL_ADD_ON_1", "definitionId": "4e5f6a7b-..." }
]
```

<Note>
  The response body is available from Atoti Sign-Off 6.1.21 (SO-1118). Earlier versions return HTTP 200 with an empty response body.
</Note>

### Single adjustment creation

Endpoint: `/sign-off/rest/v2/adjustment`
Method: `POST`
Example endpoint: [http://localhost:8080/sign-off/rest/v2/adjustment](http://localhost:8080/sign-off/rest/v2/adjustment)

The request body is a single adjustment object using the same fields as the bulk endpoint above.

The response is a single object with the same fields as one element of the bulk response:

```json theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
{ "id": 1, "executionId": "PNL_ADD_ON_0", "definitionId": "0a1b2c3d-..." }
```

<Note>
  The response body is available from Atoti Sign-Off 6.1.21 (SO-1118). Earlier versions return HTTP 200 with an empty response body.
</Note>

### Verifying adjustment executions

After creating adjustments, the following endpoints on the sign-off server allow status tracking.

`GET /sign-off/rest/v2/adjustments/{taskId}` — returns all adjustments for a task, including their `id` and `status` fields.

`GET /adjustments/status/{taskId}` — returns a map of execution ids to status for a task. The `{taskId}` parameter is the workflow process-instance key.

`GET /adjustments/execution-status/{executionId}` — returns the status of a single execution by its `executionId`.

## Execution status

Endpoint: `/adjustments/status/<_server_name_>/<_execution_Id_>`
Method : `GET`
Example endpoint: [http://localhost:9090/adjustments/status/MR/PNL\\\_ADD\\\_ON\\\_0](http://localhost:9090/adjustments/status/MR/PNL\\_ADD\\_ON\\_0)

Result is a Status [read more about this DTO](.#span-idsignoffa2spansignoffadjustmentstatusservice)

Example Result:
`"REQUESTED"`
