Skip to content

Authentication

The RAMSdoc API uses bearer token authentication. All API requests must include a valid token in the Authorization header.

  1. Log in to RAMSdoc and go to Settings > API.
  2. Click Create API Token.
  3. Enter a name for the token (e.g. “CI/CD Integration” or “Reporting Dashboard”).
  4. Select the scopes — which API actions this token can perform (see scopes below).
  5. Click Create.
  6. Copy the token immediately — it is only shown once. Store it securely.

[Screenshot: API token creation dialog with name and scope selection]

Include the token in the Authorization header of every request:

Terminal window
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
https://api.ramsdoc.com/api/v1/documents
const response = await fetch('https://api.ramsdoc.com/api/v1/documents', {
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.ramsdoc.com/api/v1/documents',
headers={
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
}
)
data = response.json()

When creating a token, select which actions it can perform:

ScopePermissions
documents:readList and view documents
documents:writeCreate, update, and delete documents
projects:readList and view projects and sites
projects:writeCreate and update projects and sites
ai:useTrigger AI features (uses your organisation’s credits)
users:readList and view organisation users
webhooks:manageConfigure webhook endpoints

Use the minimum scopes required for your integration. A reporting dashboard only needs documents:read and projects:read. A CI/CD pipeline generating RAMS might need documents:write and ai:use.

All API requests use the base URL:

https://api.ramsdoc.com/api/v1/
  • Content-Type: application/json for request bodies
  • Accept: application/json for all requests
  • All request bodies must be valid JSON
  • All responses are JSON

Successful responses follow this structure:

{
"data": { ... },
"meta": {
"current_page": 1,
"per_page": 25,
"total": 142
}
}

Single resources return data as an object. Collections return data as an array with pagination in meta.

Errors return an appropriate HTTP status code with a JSON body:

{
"error": {
"code": "validation_error",
"message": "The title field is required.",
"details": {
"title": ["The title field is required."]
}
}
}
Status codeMeaning
400Bad request — invalid parameters or request body
401Unauthorised — missing or invalid token
403Forbidden — token does not have the required scope
404Not found — resource does not exist
422Validation error — request body failed validation
429Rate limited — too many requests (see rate limits)
500Server error — something went wrong on our end

API requests are rate limited per token:

PlanRequests per minute
Pro60
Team120
EnterpriseCustom

Rate limit information is included in response headers:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1711382400

If you exceed the limit, you will receive a 429 response. Wait until the X-RateLimit-Reset timestamp before retrying.

Collection endpoints return paginated results. Use query parameters to control pagination:

ParameterDefaultDescription
page1Page number
per_page25Items per page (max 100)

Example:

Terminal window
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
"https://api.ramsdoc.com/api/v1/documents?page=2&per_page=50"

The meta object in the response includes current_page, per_page, total, last_page, and navigation links.

To revoke a token:

  1. Go to Settings > API.
  2. Find the token in the list.
  3. Click Revoke.

The token is immediately invalidated. Any requests using it will receive a 401 response.