{"openapi":"3.0.0","info":{"title":"Documents","version":"1.0.0","description":"The document upload API is a two-step process. First, the metadata for the document is specified, and the API returns a file identifier so the file can be streamed directly to the next endpoint. You’ll need to look for the document_token returned in the response because that is necessary to pass to the next endpoint for streaming the file."},"components":{"schemas":{"DocumentSummary":{"properties":{"document_token":{"type":"string"},"timestamp":{"type":"number"},"type":{"type":"string"},"name":{"type":"string"}}},"DocumentNotes":{"properties":{"note":{"type":"string"},"note_author_agent_email":{"type":"string"},"created_at":{"type":"number"},"updated_at":{"type":"number"}}},"DocumentNotesBody":{"required":["note","note_author_agent_email"],"properties":{"note":{"type":"string"},"note_author_agent_email":{"type":"string"}}},"Document":{"properties":{"document_token":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"extension":{"type":"string"},"uploaded":{"type":"boolean"},"timestamp":{"type":"number"},"approved":{"type":"string"},"approval_agent_email":{"type":"string"},"approval_timestamp":{"type":"number"},"notes":{"type":"array","items":{"$ref":"#/components/schemas/DocumentNotes"}}}},"DocumentBody":{"required":["name","extension","type"],"properties":{"name":{"type":"string"},"extension":{"type":"string"},"type":{"type":"string"},"note":{"type":"string"},"note_author_agent_email":{"type":"string"}}},"DocumentApprovalBody":{"required":["approved","type","approval_agent_email","name"],"properties":{"approved":{"type":"boolean"},"type":{"type":"string"},"approval_agent_email":{"type":"string"},"name":{"type":"string"}}}}},"paths":{"/documents":{"post":{"tags":["Documents"],"summary":"Describe a Document Before an Entity is Created","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentBody"}}}},"responses":{"200":{"x-summary":"OK","description":"Document","content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/Document"}}}}}}},"/documents/{document_token}":{"parameters":[{"in":"path","name":"document_token","schema":{"type":"string"},"required":true,"description":"Token associated with document."}],"put":{"tags":["Documents"],"summary":"Submit a Document File Before an Enity is Created","description":"Now that that metadata for the file has been specified, you just need to stream the file to the location we’ve allocated for it. The response should be the same as for the preceding `POST` request endpoint except `uploaded` will be true.","requestBody":{"content":{"image":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"x-summary":"OK","description":"Document","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}}}}},"/entities/{entity_token}/documents":{"parameters":[{"in":"path","name":"entity_token","schema":{"type":"string"},"required":true,"description":"Token of entity for associated documents."}],"post":{"tags":["Documents"],"summary":"Describe a Document Before Uploading","description":"The document upload API is a two-step process. First, the metadata for the document is specified, and the API returns a file identifier so the file can be streamed directly to the next endpoint. You’ll need to look for the document_token returned in the response because that is necessary to pass to the next endpoint for streaming the file.","requestBody":{"content":{"image":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"x-summary":"OK","description":"Document","content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/Document"}}}}}},"get":{"tags":["Documents"],"summary":"Get a List of All Documents for an Entity","description":"All documents for an entity can be queried using this endpoint. All metadata for the documents is available, but the documents themselves must be downloaded individually.","responses":{"200":{"x-summary":"OK","description":"Document","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}}}}},"/entities/{entity_token}/documents/{document_token}":{"parameters":[{"in":"path","name":"document_token","schema":{"type":"string"},"required":true,"description":"Token associated with document."},{"in":"path","name":"entity_token","schema":{"type":"string"},"required":true,"description":"Token of entity for associated documents."}],"put":{"tags":["Documents"],"summary":"Submit a Document File for an Entity","description":"Now that that metadata for the file has been specified, you just need to stream the file to the location we’ve allocated for it. The response should be the same as for the preceding `POST` request endpoint except `uploaded` will be true.","requestBody":{"content":{"image":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"x-summary":"OK","description":"Document","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}}}},"patch":{"tags":["Documents"],"summary":"Update Document Metadata","description":"If you want to mark a document as “approved” or “denied” (if you have a document review process), or just change the name or type of a document, you can do so with the PATCH endpoint.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentApprovalBody"}}}},"responses":{"200":{"x-summary":"OK","description":"Document","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}}}},"get":{"tags":["Documents"],"summary":"Download a Document","description":"This endpoint will return a file stream of the requested document.","responses":{"200":{"x-summary":"OK","description":"Document","content":{"image":{"schema":{"type":"string","format":"binary"}}}}}}},"/entities/{entity_token}/documents/{document_token}/notes":{"parameters":[{"in":"path","name":"document_token","schema":{"type":"string"},"required":true,"description":"Token associated with document."},{"in":"path","name":"entity_token","schema":{"type":"string"},"required":true,"description":"Token of entity for associated documents."}],"post":{"tags":["Documents"],"summary":"Add Notes to a Document","description":"You can add an unlimited amount of notes to a document to keep track of whatever information is needed. All you need is to pass the note along with the email of the author of the note (must be a user associated with your customer account) to this API endpoint.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentNotesBody"}}}},"responses":{"200":{"x-summary":"OK","description":"Document","content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/DocumentNotes"}}}}}}}},"x-si-base":"./InternalDocs/docs/documents.yaml","x-github-repo":"UseAlloy/Alloy","x-github-sha":"5fa046ee6f027fda6cbf56f212ef6b42e94c1bfe","x-readme":{"explorer-enabled":true,"proxy-enabled":true}}