Hevn Inc contracts API
The contracts API from Hevn Inc — 28 operation(s) for contracts.
The contracts API from Hevn Inc — 28 operation(s) for contracts.
openapi: 3.1.0
info:
title: HEVN 2FA contracts API
description: Backend API for HEVN mobile neobank
version: 0.1.2
servers:
- url: https://api.hevn.finance
description: Production
tags:
- name: contracts
paths:
/api/v1/documents/contracts:
post:
tags:
- contracts
summary: Create a new contract
operationId: create_contract_api_v1_documents_contracts_post
security:
- HTTPBearer: []
parameters:
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateContractRequest'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
get:
tags:
- contracts
summary: List contracts for current user
operationId: list_contracts_api_v1_documents_contracts_get
security:
- HTTPBearer: []
parameters:
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractListResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/documents/contracts/{contract_id}/attach-document:
post:
tags:
- contracts
summary: Attach a document to a contract
operationId: attach_document_api_v1_documents_contracts__contract_id__attach_document_post
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/app__schemas__routers__invoices__contract__AttachDocumentRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/documents/contracts/templates:
get:
tags:
- contracts
summary: List fillable document templates and their fields
operationId: list_templates_api_v1_documents_contracts_templates_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/TemplateListResponse'
/api/v1/documents/contracts/generate_scope_prefill:
post:
tags:
- contracts
summary: Generate plain-text scope description from a role
operationId: generate_scope_prefill_api_v1_documents_contracts_generate_scope_prefill_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateScopePrefillRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateScopePrefillResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/documents/contracts/prepare_document:
post:
tags:
- contracts
summary: Persist prepared contract markdown as a document
operationId: prepare_contract_document_api_v1_documents_contracts_prepare_document_post
security:
- HTTPBearer: []
parameters:
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PrepareContractDocumentRequest'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/PrepareContractDocumentResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/documents/contracts/{contract_id}/preview_document:
get:
tags:
- contracts
summary: Preview contract document generated from a saved contract
operationId: preview_contract_document_api_v1_documents_contracts__contract_id__preview_document_get
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateContractDocumentResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/documents/contracts/{contract_id}/preview:
get:
tags:
- contracts
summary: Preview contract document generated from a saved contract
operationId: preview_contract_document_api_v1_documents_contracts__contract_id__preview_get
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateContractDocumentResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/documents/contracts/{contract_id}:
get:
tags:
- contracts
summary: Get contract by ID
operationId: get_contract_api_v1_documents_contracts__contract_id__get
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
patch:
tags:
- contracts
summary: Update contract terms and schedule
operationId: update_contract_api_v1_documents_contracts__contract_id__patch
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateContractRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- contracts
summary: Delete contract
operationId: delete_contract_api_v1_documents_contracts__contract_id__delete
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/documents/contracts/{contract_id}/close:
post:
tags:
- contracts
summary: Close contract
operationId: close_contract_api_v1_documents_contracts__contract_id__close_post
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/documents/contracts/{contract_id}/pause:
post:
tags:
- contracts
summary: Pause contract
operationId: pause_contract_api_v1_documents_contracts__contract_id__pause_post
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/documents/contracts/{contract_id}/approve:
post:
tags:
- contracts
summary: Approve contract by client or contractor
operationId: approve_contract_api_v1_documents_contracts__contract_id__approve_post
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/ApproveContractRequest'
- type: 'null'
title: Body
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/documents/contracts/{contract_id}/payment_methods:
put:
tags:
- contracts
summary: Set contractor payment methods for contract
operationId: update_contract_payment_methods_api_v1_documents_contracts__contract_id__payment_methods_put
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateContractPaymentMethodsRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/documents/contracts/{contract_id}/label:
patch:
tags:
- contracts
summary: Update contract label
operationId: update_contract_label_api_v1_documents_contracts__contract_id__label_patch
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateContractLabelRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/documents/contracts/{contract_id}/send-for-signing:
post:
tags:
- contracts
summary: Send contract for signing
operationId: send_for_signing_api_v1_documents_contracts__contract_id__send_for_signing_post
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/invoices/documents/contracts:
post:
tags:
- contracts
summary: Create a new contract
operationId: create_contract_package_alias_api_v1_invoices_documents_contracts_post
security:
- HTTPBearer: []
parameters:
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateContractRequest'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
get:
tags:
- contracts
summary: List contracts for current user
operationId: list_contracts_package_alias_api_v1_invoices_documents_contracts_get
security:
- HTTPBearer: []
parameters:
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractListResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/invoices/documents/contracts/{contract_id}/attach-document:
post:
tags:
- contracts
summary: Attach a document to a contract
operationId: attach_document_package_alias_api_v1_invoices_documents_contracts__contract_id__attach_document_post
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/app__schemas__routers__invoices__contract__AttachDocumentRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/invoices/documents/contracts/templates:
get:
tags:
- contracts
summary: List fillable document templates and their fields
operationId: list_templates_package_alias_api_v1_invoices_documents_contracts_templates_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/TemplateListResponse'
/api/v1/invoices/documents/contracts/generate_scope_prefill:
post:
tags:
- contracts
summary: Generate plain-text scope description from a role
operationId: generate_scope_prefill_package_alias_api_v1_invoices_documents_contracts_generate_scope_prefill_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateScopePrefillRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateScopePrefillResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/invoices/documents/contracts/prepare_document:
post:
tags:
- contracts
summary: Persist prepared contract markdown as a document
operationId: prepare_contract_document_package_alias_api_v1_invoices_documents_contracts_prepare_document_post
security:
- HTTPBearer: []
parameters:
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PrepareContractDocumentRequest'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/PrepareContractDocumentResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/invoices/documents/contracts/{contract_id}/preview_document:
get:
tags:
- contracts
summary: Preview contract document generated from a saved contract
operationId: preview_contract_document_package_alias_api_v1_invoices_documents_contracts__contract_id__preview_document_get
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateContractDocumentResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/invoices/documents/contracts/{contract_id}/preview:
get:
tags:
- contracts
summary: Preview contract document generated from a saved contract
operationId: preview_contract_document_package_alias_api_v1_invoices_documents_contracts__contract_id__preview_get
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateContractDocumentResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/invoices/documents/contracts/{contract_id}:
get:
tags:
- contracts
summary: Get contract by ID
operationId: get_contract_package_alias_api_v1_invoices_documents_contracts__contract_id__get
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
patch:
tags:
- contracts
summary: Update contract terms and schedule
operationId: update_contract_package_alias_api_v1_invoices_documents_contracts__contract_id__patch
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateContractRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- contracts
summary: Delete contract
operationId: delete_contract_package_alias_api_v1_invoices_documents_contracts__contract_id__delete
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/invoices/documents/contracts/{contract_id}/close:
post:
tags:
- contracts
summary: Close contract
operationId: close_contract_package_alias_api_v1_invoices_documents_contracts__contract_id__close_post
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/invoices/documents/contracts/{contract_id}/pause:
post:
tags:
- contracts
summary: Pause contract
operationId: pause_contract_package_alias_api_v1_invoices_documents_contracts__contract_id__pause_post
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/invoices/documents/contracts/{contract_id}/approve:
post:
tags:
- contracts
summary: Approve contract by client or contractor
operationId: approve_contract_package_alias_api_v1_invoices_documents_contracts__contract_id__approve_post
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/ApproveContractRequest'
- type: 'null'
title: Body
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContractResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/invoices/documents/contracts/{contract_id}/payment_methods:
put:
tags:
- contracts
summary: Set contractor payment methods for contract
operationId: update_contract_payment_methods_package_alias_api_v1_invoices_documents_contracts__contract_id__payment_methods_put
security:
- HTTPBearer: []
parameters:
- name: contract_id
in: path
required: true
schema:
type: string
format: uuid
title: Contract Id
- name: x-api-key
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Api-Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateContractPaymentMethodsRequest'
responses:
'200':
description: Successful Response
content:
# --- truncated at 32 KB (65 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/hevn-inc/refs/heads/main/openapi/hevn-inc-contracts-api-openapi.yml