/v1/documents/{document_id}/completeAuthentication
Bearer API key or Facily session, subject to permissions and facility scope.
Authentication and scopeRequest example
Replace bracketed path values with real IDs from your environment. The body, where shown, is generated from the schema and uses illustrative values.
curl --request POST \
--url 'https://api.staging.facily.ai/v1/documents/<DOCUMENT_ID>/complete' \
--header "Authorization: Bearer $FACILY_API_KEY"Parameters
document_idpath · stringrequiredFormat: uuid
Responses
Expand a status to inspect its schema. Generated examples show structure and synthetic values.
200Successful Response
{
"data": {
"created_at": "2026-10-29T12:00:00Z",
"document_type": "string",
"documentable_id": "00000000-0000-4000-8000-000000000001",
"documentable_type": "string",
"facility_id": "00000000-0000-4000-8000-000000000001",
"format": "string",
"id": "00000000-0000-4000-8000-000000000001",
"mime_type": "string",
"origin": "string",
"updated_at": "2026-10-29T12:00:00Z",
"file_size_bytes": 0,
"generated_at": "2026-10-29T12:00:00Z"
},
"meta": {
"request_id": "string"
}
}application/json
dataDocumentResponserequiredDocument metadata. Excludes raw S3 key/bucket; downloads use the /download endpoint, which returns a presigned URL.
Show data schema
created_atstringrequiredWhen the document record was created.
Format: date-time
document_typestringrequiredWhat the document is, for example a signed lease, an invoice, or an insurance certificate.
documentable_idstringrequiredIdentifier of the record named by documentable_type.
Format: uuid
documentable_typestringrequiredThe kind of record the document is attached to, for example a lease or a tenant.
facility_idstringrequiredThe facility this document belongs to.
Format: uuid
file_size_bytesinteger | nullSize of the stored file in bytes.
Show file_size_bytes schema
integer | nullSize of the stored file in bytes.
Variant 1: integer
integerVariant 2: null
nullformatstringrequiredDocument format. Generated documents are PDF.
generated_atstring | nullWhen a generated document was rendered. On an imported document, the date the previous system recorded for it.
Format: date-time
Show generated_at schema
string | nullWhen a generated document was rendered. On an imported document, the date the previous system recorded for it.
Variant 1: string
stringVariant 2: null
nullidstringrequiredUnique identifier for this document.
Format: uuid
mime_typestringrequiredMIME type of the stored file.
originstringrequireduploaded when a person uploaded the file, generated when a system produced it. Generated covers documents this platform rendered and documents carried over from a previous system by a data import; only the first kind has a template_version.
template_versionstring | nullVersion of the template a generated document was rendered from, so an old document stays reproducible after the template changes. Null on an upload and on a document carried over by a data import.
Show template_version schema
string | nullVersion of the template a generated document was rendered from, so an old document stays reproducible after the template changes. Null on an upload and on a document carried over by a data import.
Variant 1: string
stringVariant 2: null
nulltitlestring | nullDisplay title of the document.
Show title schema
string | nullDisplay title of the document.
Variant 1: string
stringVariant 2: null
nullupdated_atstringrequiredWhen the document record was last modified.
Format: date-time
uploaded_bystring | nullThe user who uploaded the document, where a person did.
Format: uuid
Show uploaded_by schema
string | nullThe user who uploaded the document, where a person did.
Variant 1: string
stringVariant 2: null
nullmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired400Validation error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired401Unauthenticated
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired403Permission denied
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired404Not found
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired409Business logic error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired503Temporary failure
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired