Skip to main content
The Company Docs API provides your organization with a secure document repository — files are organized in folder hierarchies, stored in cloud object storage, and delivered via time-limited signed CDN URLs. All endpoints require a valid JWT containing an OrganizationId claim; your data is always isolated to your own organization. Base URL: https://api.achievemomentum.com/api/companydocs
Document CDN URLs expire after 1 hour. If a URL was generated more than an hour ago, call refresh-url before presenting the link to your users.

Authentication

All endpoints require a valid JWT in the Authorization header:
Authorization: Bearer {your-jwt-token}

Folders

POST /api/companydocs/folders

Creates a new folder in your organization’s document hierarchy. Folders can be nested by supplying a parentId.

Request body

name
string
required
Folder name. Maximum 255 characters. Cannot contain / or \.
parentId
string
Parent folder ID. Omit or pass null to create the folder at the root level.

Response

folder
object
The created folder.
Example request
{
  "name": "HR Documents",
  "parentId": null
}
Example response
{
  "folder": {
    "folderId": "folder_abc123",
    "organizationId": "org_xyz789",
    "name": "HR Documents",
    "parentId": null,
    "path": "/HR Documents",
    "externalId": null,
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-15T10:00:00Z"
  }
}
curl example
curl -X POST \
  "https://api.achievemomentum.com/api/companydocs/folders" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{ "name": "HR Documents", "parentId": null }'

GET /api/companydocs/folders

Returns all folders in your organization’s document hierarchy.

Response

folders
array
Array of folder objects.
curl example
curl -X GET \
  "https://api.achievemomentum.com/api/companydocs/folders" \
  -H "Authorization: Bearer <your_token>"

GET /api/companydocs/folders/

Returns a specific folder by its ID.

Path parameters

folderId
string
required
The folder’s unique identifier.

Response

folder
object
The requested folder object. Shape is identical to the create folder response.
curl example
curl -X GET \
  "https://api.achievemomentum.com/api/companydocs/folders/folder_abc123" \
  -H "Authorization: Bearer <your_token>"

DELETE /api/companydocs/folders/

Permanently deletes a folder. The folder must be empty — it cannot contain any documents or subfolders.
You must move or delete all documents and subfolders before deleting the parent folder. A 400 error is returned if the folder is not empty.

Path parameters

folderId
string
required
The folder’s unique identifier.

Response

Returns 204 No Content on success.
StatusDescription
204Folder deleted successfully.
400Folder is not empty.
404Folder not found.
curl example
curl -X DELETE \
  "https://api.achievemomentum.com/api/companydocs/folders/folder_abc123" \
  -H "Authorization: Bearer <your_token>"

Documents

POST /api/companydocs/documents/upload

Uploads a document to your organization’s storage. Send the request as multipart/form-data. The response includes a signed CDN URL valid for 1 hour.
The maximum file size is 50 MB. Check file size client-side before uploading to provide a better user experience.

Request (multipart/form-data)

file
file
required
The file to upload.
folderId
string
Target folder ID. Omit to upload to the root level.

Response

document
object
The uploaded document record.
curl example
curl -X POST \
  "https://api.achievemomentum.com/api/companydocs/documents/upload" \
  -H "Authorization: Bearer <your_token>" \
  -F "file=@/path/to/document.pdf" \
  -F "folderId=folder_abc123"
Example response
{
  "document": {
    "documentId": "doc_xyz789",
    "organizationId": "org_xyz789",
    "name": "document.pdf",
    "fileExtension": ".pdf",
    "mimeType": "application/pdf",
    "size": 204800,
    "folderId": "folder_abc123",
    "cdnUrl": "https://cdn.achievemomentum.com/signed/doc_xyz789?token=...",
    "path": "/HR Documents/document.pdf",
    "externalId": null,
    "createdAt": "2024-01-15T11:00:00Z",
    "updatedAt": "2024-01-15T11:00:00Z"
  }
}

GET /api/companydocs/documents

Returns all documents in your organization, optionally filtered to a specific folder.

Query parameters

folderId
string
Filter documents by folder ID. Omit to list all documents across all folders.

Response

documents
array
Array of document objects. Shape is identical to the upload response document object.
curl example — all documents
curl -X GET \
  "https://api.achievemomentum.com/api/companydocs/documents" \
  -H "Authorization: Bearer <your_token>"
curl example — documents in a folder
curl -X GET \
  "https://api.achievemomentum.com/api/companydocs/documents?folderId=folder_abc123" \
  -H "Authorization: Bearer <your_token>"

GET /api/companydocs/documents/

Returns metadata for a specific document by its ID. Includes a signed CDN URL valid for 1 hour.

Path parameters

documentId
string
required
The document’s unique identifier.

Response

document
object
The document metadata object. Shape is identical to the upload response document object.
curl example
curl -X GET \
  "https://api.achievemomentum.com/api/companydocs/documents/doc_xyz789" \
  -H "Authorization: Bearer <your_token>"

GET /api/companydocs/documents//download

Downloads the raw file content for a specific document. Returns a binary stream with appropriate Content-Type and Content-Disposition headers.

Path parameters

documentId
string
required
The document’s unique identifier.

Response

Returns a binary file stream.
HeaderValue
Content-TypeDocument MIME type (e.g. application/pdf)
Content-Dispositionattachment; filename="document.pdf"
Content-LengthFile size in bytes
curl example
curl -X GET \
  "https://api.achievemomentum.com/api/companydocs/documents/doc_xyz789/download" \
  -H "Authorization: Bearer <your_token>" \
  --output document.pdf

PUT /api/companydocs/documents//move

Moves a document to a different folder. Pass null as targetFolderId to move the document to the root level.

Path parameters

documentId
string
required
The document’s unique identifier.

Request body

targetFolderId
string | null
required
The ID of the destination folder, or null to move to the root level.

Response

Returns 204 No Content on success.
StatusDescription
204Document moved successfully.
400Invalid operation.
404Document or target folder not found.
curl example
curl -X PUT \
  "https://api.achievemomentum.com/api/companydocs/documents/doc_xyz789/move" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{ "targetFolderId": "folder_def456" }'

DELETE /api/companydocs/documents/

Permanently deletes a document and removes its file from cloud storage.
This action permanently deletes the file and cannot be undone.

Path parameters

documentId
string
required
The document’s unique identifier.

Response

Returns 204 No Content on success.
curl example
curl -X DELETE \
  "https://api.achievemomentum.com/api/companydocs/documents/doc_xyz789" \
  -H "Authorization: Bearer <your_token>"

POST /api/companydocs/documents/bulk-delete

Deletes up to 100 documents in a single request.

Request body

documentIds
string[]
required
Array of document IDs to delete. Maximum 100 IDs per request.

Response

Returns 204 No Content on success.
StatusDescription
204All specified documents deleted.
400Validation error (e.g. more than 100 IDs supplied, or an empty array).
curl example
curl -X POST \
  "https://api.achievemomentum.com/api/companydocs/documents/bulk-delete" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "documentIds": ["doc_001", "doc_002", "doc_003"]
  }'

POST /api/companydocs/documents/bulk-move

Moves up to 100 documents to a target folder in a single request. Pass null as targetFolderId to move documents to the root level.

Request body

documentIds
string[]
required
Array of document IDs to move. Maximum 100 IDs per request.
targetFolderId
string | null
required
The ID of the destination folder, or null to move documents to the root level.

Response

Returns 204 No Content on success.
StatusDescription
204All specified documents moved.
400Validation error (e.g. more than 100 IDs, or target folder not found).
curl example
curl -X POST \
  "https://api.achievemomentum.com/api/companydocs/documents/bulk-move" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "documentIds": ["doc_001", "doc_002", "doc_003"],
    "targetFolderId": "folder_def456"
  }'

POST /api/companydocs/documents//refresh-url

Generates a new signed CDN URL for a document. Use this endpoint when an existing URL has expired (CDN URLs expire after 1 hour) or is about to expire.

Path parameters

documentId
string
required
The document’s unique identifier.

Response

cdnUrl
string
A new signed CDN URL, valid for 1 hour from the time of this request.
Example response
{
  "cdnUrl": "https://cdn.achievemomentum.com/signed/doc_xyz789?token=new_signed_token..."
}
curl example
curl -X POST \
  "https://api.achievemomentum.com/api/companydocs/documents/doc_xyz789/refresh-url" \
  -H "Authorization: Bearer <your_token>"

Statistics

GET /api/companydocs/stats/storage

Returns storage usage statistics for your organization.

Response

stats
object
Storage usage summary.
Example response
{
  "stats": {
    "totalFiles": 1247,
    "totalSize": 5368709120,
    "maxSize": 10737418240,
    "usedPercentage": 50.0,
    "availableSize": 5368709120
  }
}
curl example
curl -X GET \
  "https://api.achievemomentum.com/api/companydocs/stats/storage" \
  -H "Authorization: Bearer <your_token>"

Error responses

All endpoints return standard error shapes:
400 — Validation error
{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
  "title": "One or more validation errors occurred",
  "status": 400,
  "errors": {
    "Name": ["Folder name is required"],
    "DocumentIds": ["Cannot delete more than 100 documents at once"]
  }
}
404 — Not found
{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
  "title": "Not Found",
  "status": 404
}
500 — Server error
{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.6.1",
  "title": "An error occurred while processing your request",
  "status": 500
}