LegalStack

Согласования

Маршруты и решения по согласованию.

Список согласований

GET
/api/v1/approvals
АвторизацияBearer <токен>

В: header

Параметры запроса

status?string

Фильтр по статусу: in_progress, approved, rejected, revoked

initiator?string

Фильтр по инициатору

participant?string

Фильтр по участнику

Тело ответа

application/json

curl -X GET "https://loading/api/v1/approvals"
[
  {
    "comments": [
      {
        "createdAt": "string",
        "id": "string",
        "text": "string",
        "userId": "string",
        "userName": "string",
        "property1": null,
        "property2": null
      }
    ],
    "completedAt": "string",
    "context": "string",
    "createdAt": "string",
    "currentStage": 0,
    "documentId": "string",
    "documentTitle": "string",
    "history": [
      {
        "property1": null,
        "property2": null
      }
    ],
    "historyChainValid": true,
    "id": "string",
    "initiatorId": "string",
    "initiatorName": "string",
    "participants": [
      {
        "action": "string",
        "comment": "string",
        "id": "string",
        "stageNumber": 0,
        "status": "string",
        "userId": "string",
        "userName": "string",
        "property1": null,
        "property2": null
      }
    ],
    "stages": [
      {
        "approvalMode": "string",
        "id": "string",
        "name": "string",
        "participants": [
          {
            "action": "string",
            "comment": "string",
            "id": "string",
            "stageNumber": 0,
            "status": "string",
            "userId": "string",
            "userName": "string",
            "property1": null,
            "property2": null
          }
        ],
        "stageNumber": 0,
        "status": "string",
        "property1": null,
        "property2": null
      }
    ],
    "status": "string",
    "subjectKind": "string",
    "teamId": "string",
    "totalStages": 0,
    "type": "string",
    "updatedAt": "string",
    "property1": null,
    "property2": null
  }
]

Создать согласование

POST
/api/v1/approvals
АвторизацияBearer <токен>

В: header

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

curl -X POST "https://loading/api/v1/approvals" \  -H "Content-Type: application/json" \  -d '{    "documentTitle": "string",    "stages": [      {        "approvalMode": "sequential",        "name": "string",        "participants": [          {            "action": "approve",            "userId": "string",            "userName": "string"          }        ]      }    ],    "type": "string"  }'
{
  "comments": [
    {
      "createdAt": "string",
      "id": "string",
      "text": "string",
      "userId": "string",
      "userName": "string",
      "property1": null,
      "property2": null
    }
  ],
  "completedAt": "string",
  "context": "string",
  "createdAt": "string",
  "currentStage": 0,
  "documentId": "string",
  "documentTitle": "string",
  "history": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "historyChainValid": true,
  "id": "string",
  "initiatorId": "string",
  "initiatorName": "string",
  "participants": [
    {
      "action": "string",
      "comment": "string",
      "id": "string",
      "stageNumber": 0,
      "status": "string",
      "userId": "string",
      "userName": "string",
      "property1": null,
      "property2": null
    }
  ],
  "stages": [
    {
      "approvalMode": "string",
      "id": "string",
      "name": "string",
      "participants": [
        {
          "action": "string",
          "comment": "string",
          "id": "string",
          "stageNumber": 0,
          "status": "string",
          "userId": "string",
          "userName": "string",
          "property1": null,
          "property2": null
        }
      ],
      "stageNumber": 0,
      "status": "string",
      "property1": null,
      "property2": null
    }
  ],
  "status": "string",
  "subjectKind": "string",
  "teamId": "string",
  "totalStages": 0,
  "type": "string",
  "updatedAt": "string",
  "property1": null,
  "property2": null
}

Входящие согласования

GET
/api/v1/approvals/inbox
АвторизацияBearer <токен>

В: header

Тело ответа

application/json

curl -X GET "https://loading/api/v1/approvals/inbox"
[
  {
    "comments": [
      {
        "createdAt": "string",
        "id": "string",
        "text": "string",
        "userId": "string",
        "userName": "string",
        "property1": null,
        "property2": null
      }
    ],
    "completedAt": "string",
    "context": "string",
    "createdAt": "string",
    "currentStage": 0,
    "documentId": "string",
    "documentTitle": "string",
    "history": [
      {
        "property1": null,
        "property2": null
      }
    ],
    "historyChainValid": true,
    "id": "string",
    "initiatorId": "string",
    "initiatorName": "string",
    "participants": [
      {
        "action": "string",
        "comment": "string",
        "id": "string",
        "stageNumber": 0,
        "status": "string",
        "userId": "string",
        "userName": "string",
        "property1": null,
        "property2": null
      }
    ],
    "stages": [
      {
        "approvalMode": "string",
        "id": "string",
        "name": "string",
        "participants": [
          {
            "action": "string",
            "comment": "string",
            "id": "string",
            "stageNumber": 0,
            "status": "string",
            "userId": "string",
            "userName": "string",
            "property1": null,
            "property2": null
          }
        ],
        "stageNumber": 0,
        "status": "string",
        "property1": null,
        "property2": null
      }
    ],
    "status": "string",
    "subjectKind": "string",
    "teamId": "string",
    "totalStages": 0,
    "type": "string",
    "updatedAt": "string",
    "property1": null,
    "property2": null
  }
]

Получить согласование

GET
/api/v1/approvals/{id}
АвторизацияBearer <токен>

В: header

Параметры пути

id*string

Идентификатор согласования

Тело ответа

application/json

curl -X GET "https://loading/api/v1/approvals/string"
{
  "comments": [
    {
      "createdAt": "string",
      "id": "string",
      "text": "string",
      "userId": "string",
      "userName": "string",
      "property1": null,
      "property2": null
    }
  ],
  "completedAt": "string",
  "context": "string",
  "createdAt": "string",
  "currentStage": 0,
  "documentId": "string",
  "documentTitle": "string",
  "history": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "historyChainValid": true,
  "id": "string",
  "initiatorId": "string",
  "initiatorName": "string",
  "participants": [
    {
      "action": "string",
      "comment": "string",
      "id": "string",
      "stageNumber": 0,
      "status": "string",
      "userId": "string",
      "userName": "string",
      "property1": null,
      "property2": null
    }
  ],
  "stages": [
    {
      "approvalMode": "string",
      "id": "string",
      "name": "string",
      "participants": [
        {
          "action": "string",
          "comment": "string",
          "id": "string",
          "stageNumber": 0,
          "status": "string",
          "userId": "string",
          "userName": "string",
          "property1": null,
          "property2": null
        }
      ],
      "stageNumber": 0,
      "status": "string",
      "property1": null,
      "property2": null
    }
  ],
  "status": "string",
  "subjectKind": "string",
  "teamId": "string",
  "totalStages": 0,
  "type": "string",
  "updatedAt": "string",
  "property1": null,
  "property2": null
}

Переименовать согласование

PATCH
/api/v1/approvals/{id}
АвторизацияBearer <токен>

В: header

Параметры пути

id*string

Идентификатор согласования

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

application/problem+json

application/problem+json

curl -X PATCH "https://loading/api/v1/approvals/string" \  -H "Content-Type: application/json" \  -d '{    "documentTitle": "string"  }'
{
  "comments": [
    {
      "createdAt": "string",
      "id": "string",
      "text": "string",
      "userId": "string",
      "userName": "string",
      "property1": null,
      "property2": null
    }
  ],
  "completedAt": "string",
  "context": "string",
  "createdAt": "string",
  "currentStage": 0,
  "documentId": "string",
  "documentTitle": "string",
  "history": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "historyChainValid": true,
  "id": "string",
  "initiatorId": "string",
  "initiatorName": "string",
  "participants": [
    {
      "action": "string",
      "comment": "string",
      "id": "string",
      "stageNumber": 0,
      "status": "string",
      "userId": "string",
      "userName": "string",
      "property1": null,
      "property2": null
    }
  ],
  "stages": [
    {
      "approvalMode": "string",
      "id": "string",
      "name": "string",
      "participants": [
        {
          "action": "string",
          "comment": "string",
          "id": "string",
          "stageNumber": 0,
          "status": "string",
          "userId": "string",
          "userName": "string",
          "property1": null,
          "property2": null
        }
      ],
      "stageNumber": 0,
      "status": "string",
      "property1": null,
      "property2": null
    }
  ],
  "status": "string",
  "subjectKind": "string",
  "teamId": "string",
  "totalStages": 0,
  "type": "string",
  "updatedAt": "string",
  "property1": null,
  "property2": null
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}

Отозвать согласование

DELETE
/api/v1/approvals/{id}
АвторизацияBearer <токен>

В: header

Параметры пути

id*string

Идентификатор согласования

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

reason?string

Причина отзыва

Тело ответа

application/json

curl -X DELETE "https://loading/api/v1/approvals/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "comments": [
    {
      "createdAt": "string",
      "id": "string",
      "text": "string",
      "userId": "string",
      "userName": "string",
      "property1": null,
      "property2": null
    }
  ],
  "completedAt": "string",
  "context": "string",
  "createdAt": "string",
  "currentStage": 0,
  "documentId": "string",
  "documentTitle": "string",
  "history": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "historyChainValid": true,
  "id": "string",
  "initiatorId": "string",
  "initiatorName": "string",
  "participants": [
    {
      "action": "string",
      "comment": "string",
      "id": "string",
      "stageNumber": 0,
      "status": "string",
      "userId": "string",
      "userName": "string",
      "property1": null,
      "property2": null
    }
  ],
  "stages": [
    {
      "approvalMode": "string",
      "id": "string",
      "name": "string",
      "participants": [
        {
          "action": "string",
          "comment": "string",
          "id": "string",
          "stageNumber": 0,
          "status": "string",
          "userId": "string",
          "userName": "string",
          "property1": null,
          "property2": null
        }
      ],
      "stageNumber": 0,
      "status": "string",
      "property1": null,
      "property2": null
    }
  ],
  "status": "string",
  "subjectKind": "string",
  "teamId": "string",
  "totalStages": 0,
  "type": "string",
  "updatedAt": "string",
  "property1": null,
  "property2": null
}

Комментарии согласования

GET
/api/v1/approvals/{id}/comments
АвторизацияBearer <токен>

В: header

Параметры пути

id*string

Идентификатор согласования

Тело ответа

application/json

curl -X GET "https://loading/api/v1/approvals/string/comments"
[
  {
    "createdAt": "string",
    "id": "string",
    "text": "string",
    "userId": "string",
    "userName": "string",
    "property1": null,
    "property2": null
  }
]

Добавить комментарий к согласованию

POST
/api/v1/approvals/{id}/comments
АвторизацияBearer <токен>

В: header

Параметры пути

id*string

Идентификатор согласования

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

text*string

Текст комментария

Тело ответа

application/json

curl -X POST "https://loading/api/v1/approvals/string/comments" \  -H "Content-Type: application/json" \  -d '{    "text": "string"  }'
{
  "createdAt": "string",
  "id": "string",
  "text": "string",
  "userId": "string",
  "userName": "string",
  "property1": null,
  "property2": null
}

Документ, прикреплённый к согласованию

GET
/api/v1/approvals/{id}/document
АвторизацияBearer <токен>

В: header

Параметры пути

id*string

Идентификатор согласования

Тело ответа

application/json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://loading/api/v1/approvals/string/document"
{
  "blocks": [
    {
      "indentLevel": 0,
      "label": "string",
      "number": "string",
      "text": "string",
      "type": "string"
    }
  ],
  "source": "current",
  "title": "string"
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}
{
  "code": "string",
  "detail": "string",
  "errors": [
    {
      "name": "string",
      "pointer": "string",
      "reason": "string",
      "rule": "string"
    }
  ],
  "instance": "string",
  "request_id": "string",
  "status": 0,
  "title": "string",
  "trace_id": "string",
  "type": "http://example.com",
  "property1": null,
  "property2": null
}

Окончательно удалить согласование

DELETE
/api/v1/approvals/{id}/permanent
АвторизацияBearer <токен>

В: header

Параметры пути

id*string

Идентификатор согласования

Тело ответа

application/json

curl -X DELETE "https://loading/api/v1/approvals/string/permanent"
{
  "success": true
}

Перезапустить согласование

POST
/api/v1/approvals/{id}/restart
АвторизацияBearer <токен>

В: header

Параметры пути

id*string

Идентификатор согласования

Тело ответа

application/json

curl -X POST "https://loading/api/v1/approvals/string/restart"
{
  "comments": [
    {
      "createdAt": "string",
      "id": "string",
      "text": "string",
      "userId": "string",
      "userName": "string",
      "property1": null,
      "property2": null
    }
  ],
  "completedAt": "string",
  "context": "string",
  "createdAt": "string",
  "currentStage": 0,
  "documentId": "string",
  "documentTitle": "string",
  "history": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "historyChainValid": true,
  "id": "string",
  "initiatorId": "string",
  "initiatorName": "string",
  "participants": [
    {
      "action": "string",
      "comment": "string",
      "id": "string",
      "stageNumber": 0,
      "status": "string",
      "userId": "string",
      "userName": "string",
      "property1": null,
      "property2": null
    }
  ],
  "stages": [
    {
      "approvalMode": "string",
      "id": "string",
      "name": "string",
      "participants": [
        {
          "action": "string",
          "comment": "string",
          "id": "string",
          "stageNumber": 0,
          "status": "string",
          "userId": "string",
          "userName": "string",
          "property1": null,
          "property2": null
        }
      ],
      "stageNumber": 0,
      "status": "string",
      "property1": null,
      "property2": null
    }
  ],
  "status": "string",
  "subjectKind": "string",
  "teamId": "string",
  "totalStages": 0,
  "type": "string",
  "updatedAt": "string",
  "property1": null,
  "property2": null
}

Решение участника по этапу

PATCH
/api/v1/approvals/{id}/stages/{stageId}/participants/{participantId}
АвторизацияBearer <токен>

В: header

Параметры пути

id*string

Идентификатор согласования

stageId*string

Идентификатор этапа

participantId*string

Идентификатор участника

Тело запроса

application/json

TypeScript-определения

Используйте тип request body в TypeScript.

Тело ответа

application/json

curl -X PATCH "https://loading/api/v1/approvals/string/stages/string/participants/string" \  -H "Content-Type: application/json" \  -d '{    "action": "approve"  }'
{
  "comments": [
    {
      "createdAt": "string",
      "id": "string",
      "text": "string",
      "userId": "string",
      "userName": "string",
      "property1": null,
      "property2": null
    }
  ],
  "completedAt": "string",
  "context": "string",
  "createdAt": "string",
  "currentStage": 0,
  "documentId": "string",
  "documentTitle": "string",
  "history": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "historyChainValid": true,
  "id": "string",
  "initiatorId": "string",
  "initiatorName": "string",
  "participants": [
    {
      "action": "string",
      "comment": "string",
      "id": "string",
      "stageNumber": 0,
      "status": "string",
      "userId": "string",
      "userName": "string",
      "property1": null,
      "property2": null
    }
  ],
  "stages": [
    {
      "approvalMode": "string",
      "id": "string",
      "name": "string",
      "participants": [
        {
          "action": "string",
          "comment": "string",
          "id": "string",
          "stageNumber": 0,
          "status": "string",
          "userId": "string",
          "userName": "string",
          "property1": null,
          "property2": null
        }
      ],
      "stageNumber": 0,
      "status": "string",
      "property1": null,
      "property2": null
    }
  ],
  "status": "string",
  "subjectKind": "string",
  "teamId": "string",
  "totalStages": 0,
  "type": "string",
  "updatedAt": "string",
  "property1": null,
  "property2": null
}