LegalStack

Документы

Создание и управление документами.

Получить блоки по списку id

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

В: header

Тело запроса

application/json

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

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

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/blocks/batch" \  -H "Content-Type: application/json" \  -d '{    "blockIds": [      "string"    ]  }'
[
  {
    "documentId": "string",
    "id": "string",
    "label": "string",
    "template": "string",
    "type": "string",
    "variables": {
      "property1": null,
      "property2": null
    },
    "property1": null,
    "property2": null
  }
]

Родительские документы для блоков

POST
/api/v1/smartdoc/blocks/parent-documents
АвторизацияBearer <токен>

В: header

Тело запроса

application/json

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

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

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/blocks/parent-documents" \  -H "Content-Type: application/json" \  -d '{    "parentBlockIds": [      "string"    ]  }'
[
  {
    "documentId": "string",
    "id": "string",
    "label": "string",
    "template": "string",
    "type": "string",
    "variables": {
      "property1": null,
      "property2": null
    },
    "property1": null,
    "property2": null
  }
]

Получить блок по id

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

В: header

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

blockId*string

Идентификатор блока

Тело ответа

application/json

application/problem+json

curl -X GET "https://loading/api/v1/smartdoc/blocks/string"
{
  "documentId": "string",
  "id": "string",
  "label": "string",
  "template": "string",
  "type": "string",
  "variables": {
    "property1": null,
    "property2": null
  },
  "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
}

Ссылки на блок из других документов

GET
/api/v1/smartdoc/blocks/{blockId}/references
АвторизацияBearer <токен>

В: header

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

blockId*string

Идентификатор блока

Тело ответа

application/json

curl -X GET "https://loading/api/v1/smartdoc/blocks/string/references"
[
  {
    "blockLabel": "string",
    "blockType": "string",
    "documentId": "string",
    "documentName": "string",
    "id": "string",
    "meta": null,
    "sourceBlockId": "string"
  }
]

Список документов

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

В: header

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

folderId?string

Фильтр по папке; null — только корень; без параметра — все

Тело ответа

application/json

curl -X GET "https://loading/api/v1/smartdoc/documents"
[
  {
    "childDocIds": [
      "string"
    ],
    "createdAt": "string",
    "folderId": "string",
    "id": "string",
    "parentDocId": "string",
    "shareCount": 0,
    "source": "string",
    "status": "string",
    "teamId": "string",
    "title": "string",
    "updatedAt": "string",
    "userId": "string",
    "property1": null,
    "property2": null
  }
]

Создать документ

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

В: header

Тело запроса

application/json

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

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

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents" \  -H "Content-Type: application/json" \  -d '{    "title": "string"  }'
{
  "blocks": [
    {
      "depth": 0,
      "id": "string",
      "label": "string",
      "order": 0,
      "template": "string",
      "type": "string",
      "variables": {
        "property1": null,
        "property2": null
      },
      "property1": null,
      "property2": null
    }
  ],
  "createdAt": "string",
  "folderId": "string",
  "id": "string",
  "status": "string",
  "title": "string",
  "updatedAt": "string",
  "userId": "string",
  "property1": null,
  "property2": null
}

Создать документ из шаблона

POST
/api/v1/smartdoc/documents/from-template
АвторизацияBearer <токен>

В: header

Тело запроса

application/json

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

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

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents/from-template" \  -H "Content-Type: application/json" \  -d '{    "templateId": "string"  }'
{
  "blocks": [
    {
      "depth": 0,
      "id": "string",
      "label": "string",
      "order": 0,
      "template": "string",
      "type": "string",
      "variables": {
        "property1": null,
        "property2": null
      },
      "property1": null,
      "property2": null
    }
  ],
  "createdAt": "string",
  "folderId": "string",
  "id": "string",
  "status": "string",
  "title": "string",
  "updatedAt": "string",
  "userId": "string",
  "property1": null,
  "property2": null
}

Получить документ

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

В: header

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

id*string

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

Тело ответа

application/json

curl -X GET "https://loading/api/v1/smartdoc/documents/string"
{
  "blocks": [
    {
      "depth": 0,
      "id": "string",
      "label": "string",
      "order": 0,
      "template": "string",
      "type": "string",
      "variables": {
        "property1": null,
        "property2": null
      },
      "property1": null,
      "property2": null
    }
  ],
  "createdAt": "string",
  "folderId": "string",
  "id": "string",
  "status": "string",
  "title": "string",
  "updatedAt": "string",
  "userId": "string",
  "property1": null,
  "property2": null
}

Удалить документ

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

В: header

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

id*string

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

Тело ответа

application/json

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

Обновить документ

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

В: header

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

id*string

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

Тело запроса

application/json

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

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

Тело ответа

application/json

curl -X PUT "https://loading/api/v1/smartdoc/documents/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "blocks": [
    {
      "depth": 0,
      "id": "string",
      "label": "string",
      "order": 0,
      "template": "string",
      "type": "string",
      "variables": {
        "property1": null,
        "property2": null
      },
      "property1": null,
      "property2": null
    }
  ],
  "createdAt": "string",
  "folderId": "string",
  "id": "string",
  "status": "string",
  "title": "string",
  "updatedAt": "string",
  "userId": "string",
  "property1": null,
  "property2": null
}

Добавить блок в документ

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

В: header

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

id*string

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

Тело запроса

application/json

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

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

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents/string/blocks" \  -H "Content-Type: application/json" \  -d '{    "label": "string",    "order": 0,    "template": "string",    "type": "string"  }'
{
  "depth": 0,
  "id": "string",
  "label": "string",
  "order": 0,
  "template": "string",
  "type": "string",
  "variables": {
    "property1": null,
    "property2": null
  },
  "property1": null,
  "property2": null
}

Обновить блок документа

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

В: header

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

id*string

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

blockId*string

Идентификатор блока

Тело запроса

application/json

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

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

Тело ответа

application/json

curl -X PATCH "https://loading/api/v1/smartdoc/documents/string/blocks/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "depth": 0,
  "id": "string",
  "label": "string",
  "order": 0,
  "template": "string",
  "type": "string",
  "variables": {
    "property1": null,
    "property2": null
  },
  "property1": null,
  "property2": null
}

Удалить блок документа

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

В: header

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

id*string

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

blockId*string

Идентификатор блока

Тело ответа

application/json

curl -X DELETE "https://loading/api/v1/smartdoc/documents/string/blocks/string"
{
  "success": true
}

Копировать документ

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

В: header

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

id*string

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

Тело запроса

application/json

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

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

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents/string/copy" \  -H "Content-Type: application/json" \  -d '{}'
{
  "blocks": [
    {
      "depth": 0,
      "id": "string",
      "label": "string",
      "order": 0,
      "template": "string",
      "type": "string",
      "variables": {
        "property1": null,
        "property2": null
      },
      "property1": null,
      "property2": null
    }
  ],
  "createdAt": "string",
  "folderId": "string",
  "id": "string",
  "status": "string",
  "title": "string",
  "updatedAt": "string",
  "userId": "string",
  "property1": null,
  "property2": null
}

Связать дочерний документ

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

В: header

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

id*string

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

Тело запроса

application/json

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

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

childDocId*string

Дочерний документ

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents/string/link" \  -H "Content-Type: application/json" \  -d '{    "childDocId": "string"  }'
{
  "blocks": [
    {
      "depth": 0,
      "id": "string",
      "label": "string",
      "order": 0,
      "template": "string",
      "type": "string",
      "variables": {
        "property1": null,
        "property2": null
      },
      "property1": null,
      "property2": null
    }
  ],
  "createdAt": "string",
  "folderId": "string",
  "id": "string",
  "status": "string",
  "title": "string",
  "updatedAt": "string",
  "userId": "string",
  "property1": null,
  "property2": null
}

Переместить документ в папку

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

В: header

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

id*string

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

Тело запроса

application/json

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

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

Тело ответа

application/json

curl -X PATCH "https://loading/api/v1/smartdoc/documents/string/move" \  -H "Content-Type: application/json" \  -d '{    "folderId": "5b6379a4-2a6c-4085-b184-45838a3b8e7e"  }'
{
  "blocks": [
    {
      "depth": 0,
      "id": "string",
      "label": "string",
      "order": 0,
      "template": "string",
      "type": "string",
      "variables": {
        "property1": null,
        "property2": null
      },
      "property1": null,
      "property2": null
    }
  ],
  "createdAt": "string",
  "folderId": "string",
  "id": "string",
  "status": "string",
  "title": "string",
  "updatedAt": "string",
  "userId": "string",
  "property1": null,
  "property2": null
}

Синхронно спроецировать накопленные Yjs-правки в блоки

POST
/api/v1/smartdoc/documents/{id}/project-now
АвторизацияBearer <токен>

В: header

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

id*string

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

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents/string/project-now"
{
  "success": true
}

Восстановить документ из версии

POST
/api/v1/smartdoc/documents/{id}/restore/{versionId}
АвторизацияBearer <токен>

В: header

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

id*string

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

versionId*string

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

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents/string/restore/string"
{
  "blocks": [
    {
      "depth": 0,
      "id": "string",
      "label": "string",
      "order": 0,
      "template": "string",
      "type": "string",
      "variables": {
        "property1": null,
        "property2": null
      },
      "property1": null,
      "property2": null
    }
  ],
  "createdAt": "string",
  "folderId": "string",
  "id": "string",
  "status": "string",
  "title": "string",
  "updatedAt": "string",
  "userId": "string",
  "property1": null,
  "property2": null
}

Сохранить документ целиком

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

В: header

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

id*string

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

Тело запроса

application/json

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

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

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents/string/save" \  -H "Content-Type: application/json" \  -d '{    "blocks": [      {        "depth": 0,        "label": "string",        "order": 0,        "template": "string",        "type": "string",        "variables": {          "property1": null,          "property2": null        }      }    ],    "title": "string"  }'
{
  "blocks": [
    {
      "depth": 0,
      "id": "string",
      "label": "string",
      "order": 0,
      "template": "string",
      "type": "string",
      "variables": {
        "property1": null,
        "property2": null
      },
      "property1": null,
      "property2": null
    }
  ],
  "createdAt": "string",
  "folderId": "string",
  "id": "string",
  "status": "string",
  "title": "string",
  "updatedAt": "string",
  "userId": "string",
  "property1": null,
  "property2": null
}

Нерассмотренные предложения агента

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

В: header

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

id*string

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

Тело ответа

application/json

curl -X GET "https://loading/api/v1/smartdoc/documents/string/suggestions"
[
  {
    "property1": null,
    "property2": null
  }
]

Принять или отклонить все предложения агента

POST
/api/v1/smartdoc/documents/{id}/suggestions/resolve-all
АвторизацияBearer <токен>

В: header

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

id*string

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

Тело запроса

application/json

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

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

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents/string/suggestions/resolve-all" \  -H "Content-Type: application/json" \  -d '{    "action": "accept"  }'
{
  "property1": null,
  "property2": null
}

Принять предложение агента

POST
/api/v1/smartdoc/documents/{id}/suggestions/{suggestionId}/accept
АвторизацияBearer <токен>

В: header

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

id*string

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

suggestionId*string

Идентификатор предложения агента

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents/string/suggestions/string/accept"
{
  "property1": null,
  "property2": null
}

Отклонить предложение агента

POST
/api/v1/smartdoc/documents/{id}/suggestions/{suggestionId}/reject
АвторизацияBearer <токен>

В: header

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

id*string

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

suggestionId*string

Идентификатор предложения агента

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents/string/suggestions/string/reject"
{
  "property1": null,
  "property2": null
}

Отвязать дочерний документ

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

В: header

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

id*string

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

Тело запроса

application/json

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

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

childDocId*string

Дочерний документ

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents/string/unlink" \  -H "Content-Type: application/json" \  -d '{    "childDocId": "string"  }'
{
  "blocks": [
    {
      "depth": 0,
      "id": "string",
      "label": "string",
      "order": 0,
      "template": "string",
      "type": "string",
      "variables": {
        "property1": null,
        "property2": null
      },
      "property1": null,
      "property2": null
    }
  ],
  "createdAt": "string",
  "folderId": "string",
  "id": "string",
  "status": "string",
  "title": "string",
  "updatedAt": "string",
  "userId": "string",
  "property1": null,
  "property2": null
}

Версии документа

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

В: header

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

id*string

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

Тело ответа

application/json

application/problem+json

curl -X GET "https://loading/api/v1/smartdoc/documents/string/versions"
[
  {
    "comment": "string",
    "createdAt": "string",
    "createdBy": "string",
    "id": "string",
    "versionNumber": 0,
    "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
}

Создать версию документа

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

В: header

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

id*string

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

Тело запроса

application/json

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

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

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/documents/string/versions" \  -H "Content-Type: application/json" \  -d '{}'
{
  "comment": "string",
  "createdAt": "string",
  "createdBy": "string",
  "id": "string",
  "versionNumber": 0,
  "documentId": "string",
  "found": true,
  "snapshot": null,
  "property1": null,
  "property2": null
}

Сравнить две версии документа

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

В: header

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

id*string

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

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

from*string

Версия-основание сравнения

to*string

Целевая версия

Тело ответа

application/json

application/problem+json

application/problem+json

curl -X GET "https://loading/api/v1/smartdoc/documents/string/versions/compare?from=string&to=string"
{
  "diff": null,
  "fromVersionId": "string",
  "fromVersionNumber": 0,
  "toVersionId": "string",
  "toVersionNumber": 0
}
{
  "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
}

Получить версию документа

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

В: header

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

id*string

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

versionId*string

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

Тело ответа

application/json

application/problem+json

curl -X GET "https://loading/api/v1/smartdoc/documents/string/versions/string"
{
  "comment": "string",
  "createdAt": "string",
  "createdBy": "string",
  "id": "string",
  "versionNumber": 0,
  "documentId": "string",
  "found": true,
  "snapshot": null,
  "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
}

Сравнить версию с текущим состоянием

GET
/api/v1/smartdoc/documents/{id}/versions/{versionId}/compare-current
АвторизацияBearer <токен>

В: header

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

id*string

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

versionId*string

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

Тело ответа

application/json

application/problem+json

application/problem+json

curl -X GET "https://loading/api/v1/smartdoc/documents/string/versions/string/compare-current"
{
  "diff": null,
  "fromVersionId": "string",
  "fromVersionNumber": 0,
  "toVersionId": "string",
  "toVersionNumber": 0
}
{
  "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
}

Пересинхронизировать документы команды

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

В: header

Тело ответа

application/json

curl -X POST "https://loading/api/v1/smartdoc/resync"
{
  "property1": null,
  "property2": null
}