Get Document
Retrieve details of a specific document using the Docstron API. This endpoint allows you to fetch document metadata, including the template used and the data attributes.
Endpoint
Section titled “Endpoint”GET https://api.docstron.com/v1/documents/{document_id}
Authentication
Section titled “Authentication”This endpoint requires authentication using a Bearer token. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Parameters
Section titled “Parameters”Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
document_id | string | Yes | The unique identifier of the document (e.g., document-517145ce-5a09-4e47-a257-887e239ecb36 ) |
Request Examples
Section titled “Request Examples”curl --location 'https://api.docstron.com/v1/documents/template-c2465c0b-fc54-4672-b9ac-7446886cd6de' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_API_KEY' \ --data ''
Response
Section titled “Response”200 - Success Response
{ "success": true, "message": "Request successful", "data": { "document_id": "document-517145ce-5a09-4e47-a257-887e239ecb36", "template_id": "template-c2465c0b-fc54-4672-b9ac-7446886cd6de", "attributes": { "customer_name": "John Doe", "amount": "$299.00" }, "created_at": "2025-10-15T18:19:48", "updated_at": "2025-10-15T18:19:48" }}
Response Fields
Section titled “Response Fields”Field | Type | Description |
---|---|---|
success | boolean | Indicates if the request was successful |
message | string | A message describing the response |
data.document_id | string | Unique identifier of the document |
data.template_id | string | The template used to generate this document |
data.attributes | string | JSON string containing the data used to generate the document |
data.created_at | string | Timestamp when the document was created (ISO 8601 format) |
data.updated_at | string | Timestamp when the document was last updated (ISO 8601 format) |
Error Responses
Section titled “Error Responses”404 - Document Not Found
Returned when the provided document_id
does not exist or is invalid.
{ "success": false, "message": "Document not found.", "data": []}
Common causes:
- Invalid or mistyped
document_id
- Document has been deleted
- The document belongs to a different account
Solution: Verify the document_id
is correct. Ensure the document hasn’t been deleted.
500 - Internal Server Error
Returned when an unexpected server error occurs while retrieving the document.
{ "success": false, "message": "Failed to get the document.", "data": []}
Common causes:
- Temporary server issue
- Database connectivity problem
- Service maintenance
Solution: Wait a few moments and retry the request. If the problem persists, contact support@docstron.com.
Need Help?
Section titled “Need Help?”If you have questions about applications or need assistance:
- 📧 Email: support@docstron.com
- 💬 Live Chat: Available in your dashboard
- 📚 Documentation: You’re reading it!