Download OpenAPI specification:Download
API for Scheduled O&M (Operation & Maintenance) on vServer — schedule a daily START, STOP or REBOOT of your servers, run a task on demand, and track what happened on every server.
Authentication. All endpoints use the standard VNG Cloud OAuth2 flow. See the Authorization section
on the API documentation home page: obtain a client ID and client secret
from VNG Cloud IAM, exchange them at the authorization server for an access_token, then send
Authorization: Bearer <access_token> with every request.
Activate the service first. Scheduled O&M runs actions on your servers through a service account created
in your IAM account. Call POST /v1/om/activation once before creating any task. Every write operation
(create, update, duplicate, cancel, delete, trigger) is rejected with 403 and an error_code until the
activation status is ACTIVE. Read operations keep working, so you can still see tasks and history
while the service is not active.
Typical flow.
GET /v1/om/activation — if status is not ACTIVE, call POST /v1/om/activation.GET /v1/om/quota — check how many tasks you can still create.POST /api/v1/scheduled-tasks — create a task. The response returns the task id.POST /api/v1/scheduled-tasks/{taskId}/trigger — optionally run it now.GET /api/v1/scheduled-tasks/{taskId}/histories then GET .../histories/{executionId} — check the result
on each server.Schedule. A task runs once a day at the hour:minute you set in config, between effective_from and
effective_until. Hourly, weekly and monthly schedules are not supported yet. Once effective_until has passed
the task becomes EXPIRED and stops running.
Region. There is a single endpoint for all regions. A task belongs to exactly one region (HCM-03 or
HAN-01), chosen with the region field, and can only target servers and tags in that region. To cover both
regions, create one task per region.
Asynchronous actions. Write operations return 202 once the task is saved. The action on your servers is
performed later by a background worker — at the scheduled time, or a few seconds after a manual trigger. Read
the execution history to see the outcome.
Conventions.
yyyy-MM-dd HH:mm:ss, in UTC+7 (Asia/Ho_Chi_Minh), both in
requests and in responses — for example 2026-12-01 08:00:00.page (starts at 1, default 1) and size (default 20) and return
listData, page, pageSize, totalPage and totalItem.st-, execution ids with exec- and history ids with his-. Server ids are vServer
instance ids (ins-...).Errors. Every error response has the shape {"message": "...", "error_code": "..."}. error_code is
only filled for activation errors (see the Activation section) and is null otherwise. For status 500 the
message is usually the literal Internal Server Error. Branch on the HTTP status code and error_code; do not
parse message.
A missing, invalid or expired token is rejected before reaching the service with 401 and a different shape:
{"errors": [{"code": "IAM_UNAUTHORIZED", "message": "You are not authorized."}]}. Get a new access_token
and retry.
Turn Scheduled O&M on for your account and check that it is still healthy.
Activation creates a service account in your IAM account and attaches the O&M policy to it. Scheduled
tasks act on your servers with this service account. Do not delete or disable it — if you do, executions
fail and the status becomes SA_BROKEN until you activate again.
When a write operation is rejected because of activation, the response is 403 with one of these
error_code values:
error_code |
Meaning | What to do |
|---|---|---|
OM_NOT_ACTIVATED |
The service has never been activated | Call POST /v1/om/activation |
SA_BROKEN |
The service account is missing or unusable | Call POST /v1/om/activation again — it repairs the account |
OM_DEACTIVATED |
The service has been de-activated | Call POST /v1/om/activation again |
Returns whether Scheduled O&M is active for your account. The check verifies that the service account still exists, is enabled and can obtain a token.
ACTIVE — you can create and manage tasks. If health is SA_SECRET_STALE, the stored credentials are out
of date but will be repaired automatically at the next execution; no action is needed.NOT_ACTIVATED — call POST /v1/om/activation.SA_BROKEN — the service account was deleted, disabled, or is unusable. Call POST /v1/om/activation
to repair it. This status is also returned when IAM is temporarily unreachable; retry the check later.const request = require('request'); const options = { method: 'GET', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/v1/om/activation', headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "status": "ACTIVE"
}Creates the O&M service account in your IAM account and attaches the O&M policy to it. Takes a few seconds.
The call is idempotent and is also the way to repair a broken activation: if the service account already exists, it only fixes what is wrong (re-attaches the policy, renews the credentials, or recreates the account if you deleted it). Existing tasks are kept.
If you disabled the service account in the IAM console, enable it there first — this call cannot enable
it and returns 409 with OM_SA_DISABLED.
const request = require('request'); const options = { method: 'POST', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/v1/om/activation', headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "status": "ACTIVE"
}Returns your Scheduled O&M quotas. Today there is one quota, OM_TASK: the number of tasks you can keep
(default 20). Creating or duplicating a task uses one unit; deleting a task releases it. Canceled and
expired tasks still count until you delete them.
const request = require('request'); const options = { method: 'GET', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/v1/om/quota', headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "quotaName": "OM_TASK",
- "limit": 20,
- "used": 3,
- "description": "count",
- "type": "OM_SCHEDULE"
}
]Create, list, update, duplicate, cancel, delete and manually run scheduled tasks.
Task status.
status |
Meaning | Allowed operations |
|---|---|---|
ACTIVE |
The task runs on schedule | update, cancel, duplicate, trigger |
CANCELED |
Stopped by you — it never runs again | duplicate, delete |
EXPIRED |
effective_until has passed |
duplicate, delete |
A canceled task cannot be resumed. To run it again, duplicate it (POST .../{taskId}/duplicate).
Creates a task that runs action_type on the target servers every day at config.hour:config.minute
(UTC+7), from effective_from to effective_until. The task is ACTIVE immediately and uses one unit of
the OM_TASK quota.
Rules checked before the task is saved:
403 otherwise — see Activation).targets must contain at least one server or one tag. Every server must exist in region, and every tag
key and value must exist in region.effective_until must be later than effective_from. If effective_from is in the past, it is moved to
the current time. If both are on the same day and effective_until is not later (for example
00:00:00), effective_until is moved to 23:59:59 of that day.Schedule cannot produce a next execution within the effective window.To run the task right away, call POST /api/v1/scheduled-tasks/{taskId}/trigger after creating it.
| name required | string (TaskName) ^[a-zA-Z0-9_.-]{5,50}$ 5-50 characters: letters a-z A-Z, digits 0-9, |
| description | string (TaskDescription) <= 1024 characters ^[a-zA-Z0-9.@_\-\s]*$ Optional. Letters a-z A-Z, digits 0-9, spaces, |
| region required | string (Region) Enum: "HCM-03" "HAN-01" Region of the task and of all its targets |
| action_type required | string (ActionType) Enum: "START" "STOP" "REBOOT" Action performed on every target server. A server already in the target state (for example already stopped for |
required | object (ScheduleConfig) Daily run time, in UTC+7. Only the daily schedule is supported: sending |
| effective_from required | string Start of the window, |
| effective_until required | string End of the window, |
required | object (Targets) Servers and tags to act on. At least one server or one tag is required. Every server and every tag key/value must exist in the task's region |
{- "name": "stop-dev-servers-nightly",
- "description": "Stop dev servers every night",
- "region": "HCM-03",
- "action_type": "STOP",
- "config": {
- "hour": 22,
- "minute": 0
}, - "effective_from": "2026-12-01 00:00:00",
- "effective_until": "2027-06-01 00:00:00",
- "targets": {
- "instances": [
- {
- "instance_id": "ins-0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}, - {
- "instance_id": "ins-5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9"
}
], - "tags": [
- {
- "tag_key": "env",
- "tag_value": "dev"
}
]
}
}{- "id": "st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35"
}Lists your tasks (deleted tasks excluded), newest first by default. Each item carries a summary of its most
recent run in the last_execution_* fields. Targets are not included — use GET .../{taskId} or the
Task Targets endpoints.
If a task has no run in its history — it has never run, or its runs are older than 3 months and were
removed — last_execution_time is absent, last_execution_status is RUNNING and both counters are 0.
Check that last_execution_time is present before reading last_execution_status.
| page | integer >= 1 Default: 1 Example: page=1 Page number, starting at 1 |
| size | integer >= 1 Default: 20 Example: size=20 Items per page |
| name | string Example: name=nightly Filter by task name — partial match |
| status | string Enum: "ACTIVE" "CANCELED" "EXPIRED" Example: status=ACTIVE Filter by task status |
| action_type | string Enum: "START" "STOP" "REBOOT" Example: action_type=STOP Filter by action |
| sort_by | string Value: "last_execution_status" Example: sort_by=last_execution_status Only |
| sort_dir | string Enum: "asc" "desc" Example: sort_dir=asc Sort direction for |
const request = require('request'); const options = { method: 'GET', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks', qs: { page: '1', size: '20', name: 'nightly', status: 'ACTIVE', action_type: 'STOP', sort_by: 'last_execution_status', sort_dir: 'asc' }, headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "listData": [
- {
- "id": "st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35",
- "name": "stop-dev-servers-nightly",
- "description": "Stop dev servers every night",
- "region": "HCM-03",
- "action_type": "STOP",
- "effective_from": "2026-12-01 00:00:00",
- "effective_until": "2027-06-01 00:00:00",
- "next_execution_time": "2026-12-02 22:00:00",
- "user_id": 53539,
- "status": "ACTIVE",
- "instance_count": 2,
- "tag_count": 1,
- "run_at": "22:00",
- "last_execution_time": "2026-12-01 22:00:00",
- "last_execution_status": "SUCCESS",
- "last_execution_success_count": 5,
- "last_execution_failed_count": 0,
- "created_at": "2026-11-30 15:12:40",
- "updated_at": "2026-11-30 15:12:40"
}
], - "page": 1,
- "pageSize": 20,
- "totalPage": 1,
- "totalItem": 1
}Returns a task with its schedule window and its full list of targets. The last_execution_* fields are not
included here — use GET .../{taskId}/histories.
| taskId required | string Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35 Task id, from |
const request = require('request'); const options = { method: 'GET', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35', headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "data": {
- "id": "st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35",
- "name": "stop-dev-servers-nightly",
- "description": "Stop dev servers every night",
- "region": "HCM-03",
- "action_type": "STOP",
- "effective_from": "2026-12-01 00:00:00",
- "effective_until": "2027-06-01 00:00:00",
- "next_execution_time": "2026-12-02 22:00:00",
- "user_id": 53539,
- "status": "ACTIVE",
- "instance_count": 2,
- "tag_count": 1,
- "run_at": "22:00",
- "created_at": "2026-11-30 15:12:40",
- "updated_at": "2026-11-30 15:12:40",
- "targets": {
- "instances": [
- {
- "instance_id": "ins-0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}, - {
- "instance_id": "ins-5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9"
}
], - "tags": [
- {
- "tag_key": "env",
- "tag_value": "dev"
}
]
}
}
}Changes an ACTIVE task. Send only the fields you want to change; the others keep their value.
config: send hour and/or minute; the missing one keeps its current value.targets: replaces the whole target list. To add one server, send the full list including the
existing ones (get them from GET .../{taskId}).region: changing the region removes all current targets, so targets for the new region are required
in the same request.effective_until, if sent, must be in the future and later than effective_from.Changing the schedule or the effective window recomputes next_execution_time.
| taskId required | string Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35 Task id, from |
| name | string (TaskName) ^[a-zA-Z0-9_.-]{5,50}$ 5-50 characters: letters a-z A-Z, digits 0-9, |
| description | string (TaskDescription) <= 1024 characters ^[a-zA-Z0-9.@_\-\s]*$ Optional. Letters a-z A-Z, digits 0-9, spaces, |
| region | string Enum: "HCM-03" "HAN-01" Moving the task to another region removes all its targets — send |
| action_type | string (ActionType) Enum: "START" "STOP" "REBOOT" Action performed on every target server. A server already in the target state (for example already stopped for |
object New run time. Send | |
| effective_from | string New start of the window, |
| effective_until | string New end of the window, |
object Replaces the whole target list. Send every server and tag the task should keep |
{- "config": {
- "hour": 23,
- "minute": 30
}, - "effective_until": "2027-12-31 23:59:59"
}{- "id": "st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35"
}Deletes a CANCELED or EXPIRED task and releases one unit of the OM_TASK quota. An ACTIVE task must be
canceled first (POST .../{taskId}/cancel). A deleted task no longer appears in any endpoint.
| taskId required | string Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35 Task id, from |
const request = require('request'); const options = { method: 'DELETE', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35', headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "message": "Cannot delete ACTIVE task. Cancel it first",
- "error_code": null
}Stops an ACTIVE task: its status becomes CANCELED and it never runs again. A run that has already started
is not interrupted. The history is kept.
Canceling cannot be undone. To run the same task again, duplicate it. Canceled tasks still count towards the quota until you delete them.
| taskId required | string Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35 Task id, from |
const request = require('request'); const options = { method: 'POST', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35/cancel', headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "id": "st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35"
}Creates a new ACTIVE task from an existing one, in any status (ACTIVE, CANCELED or EXPIRED). Uses one
unit of the OM_TASK quota.
The body is optional. Every field you send overrides the copied value; every field you omit is copied from
the original task, including its targets and its effective window. If the original window has already
ended, send a new effective_from and effective_until, otherwise the request fails because the schedule
has no run time left.
To duplicate into another region, send region together with targets for that region.
| taskId required | string Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35 Task id, from |
| name | string (TaskName) ^[a-zA-Z0-9_.-]{5,50}$ 5-50 characters: letters a-z A-Z, digits 0-9, |
| description | string (TaskDescription) <= 1024 characters ^[a-zA-Z0-9.@_\-\s]*$ Optional. Letters a-z A-Z, digits 0-9, spaces, |
| region | string Enum: "HCM-03" "HAN-01" Region of the new task. If it differs from the original, |
| action_type | string (ActionType) Enum: "START" "STOP" "REBOOT" Action performed on every target server. A server already in the target state (for example already stopped for |
object (ScheduleConfig) Daily run time, in UTC+7. Only the daily schedule is supported: sending | |
| effective_from | string
|
| effective_until | string
|
object Targets of the new task. Omit to copy the original targets |
{- "name": "start-dev-servers-morning",
- "action_type": "START",
- "config": {
- "hour": 7,
- "minute": 30
}
}{- "id": "st-a3b4c5d6-e7f8-4a9b-8c0d-1e2f3a4b5c6d"
}Runs an ACTIVE task immediately, outside its schedule. The run has trigger_type = MANUAL and does not
change next_execution_time.
The response returns as soon as the run is queued. Follow it with
GET .../{taskId}/histories?trigger_type=MANUAL.
Rate limit. A task can be triggered at most once every 60 seconds. A second trigger within that
window returns 429 with the number of seconds to wait.
| taskId required | string Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35 Task id, from |
const request = require('request'); const options = { method: 'POST', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35/trigger', headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "id": "st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35"
}The servers and tags a task acts on.
A task targets servers directly (targets.instances), by tag (targets.tags), or both. A tag target is
resolved at every run: every server carrying that tag key and value at that moment is included. Servers
deleted from vServer are skipped automatically.
Lists the servers the task targets directly, in the order they were added. Tag targets are listed by GET .../{taskId}/tags.
| taskId required | string Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35 Task id, from |
| page | integer >= 1 Default: 1 Example: page=1 Page number, starting at 1 |
| size | integer >= 1 Default: 20 Example: size=20 Items per page |
| search | string Example: search=web Filter by server name or server id — partial match, case-insensitive |
const request = require('request'); const options = { method: 'GET', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35/instances', qs: {page: '1', size: '20', search: 'web'}, headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "listData": [
- {
- "id": "st-ins-1d2e3f4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
- "instance_id": "ins-0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
- "instance_name": "web-dev-01"
}, - {
- "id": "st-ins-6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9e",
- "instance_id": "ins-5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
- "instance_name": "web-dev-02"
}
], - "page": 1,
- "pageSize": 20,
- "totalPage": 1,
- "totalItem": 2
}Lists the tag targets of the task, in the order they were added.
| taskId required | string Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35 Task id, from |
| page | integer >= 1 Default: 1 Example: page=1 Page number, starting at 1 |
| size | integer >= 1 Default: 20 Example: size=20 Items per page |
| search | string Example: search=env Filter by tag key or tag value — partial match, case-insensitive |
const request = require('request'); const options = { method: 'GET', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35/tags', qs: {page: '1', size: '20', search: 'env'}, headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "listData": [
- {
- "id": "st-tag-7c8d9e0f-1a2b-4c3d-8e4f-5a6b7c8d9e0f",
- "tag_key": "env",
- "tag_value": "dev"
}
], - "page": 1,
- "pageSize": 20,
- "totalPage": 1,
- "totalItem": 1
}What happened each time a task ran.
An execution is one run of a task (scheduled or manual). It has one history row per target server.
Execution status.
status |
Meaning |
|---|---|
PENDING |
The run is queued |
RUNNING |
The run is in progress |
SUCCESS |
No server failed (a server already in the target state counts as success) |
PARTIAL_FAILED |
Some servers succeeded, some failed |
FAILED |
Every server failed, or the run could not start (see error_message) |
SKIPPED |
The run was skipped, for example because it started too late (see error_message) |
Per-server status (histories[].status): SUCCESS, FAILED, TIMEOUT or SKIPPED.
Common per-server error_code values. The list may grow; display error_message for anything
you do not recognize.
error_code |
Meaning |
|---|---|
VM_NOT_FOUND |
The server no longer exists |
VM_IN_PROCESS |
The server is busy with another operation |
VM_MIGRATING |
The server is being migrated |
PERMISSION_DENIED |
The O&M service account is not allowed to act on the server |
API_TIMEOUT |
vServer did not answer in time |
API_ERROR |
vServer returned an unexpected error |
SA_BROKEN |
The O&M service account is unusable — activate again |
Lists the runs of a task, most recent scheduled_time first. Each item is a summary; the per-server result is
in GET .../{taskId}/histories/{executionId}.
History older than 3 months is removed automatically.
| taskId required | string Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35 Task id, from |
| page | integer >= 1 Default: 1 Example: page=1 Page number, starting at 1 |
| size | integer >= 1 Default: 20 Example: size=20 Items per page |
| status | string Enum: "PENDING" "RUNNING" "SUCCESS" "PARTIAL_FAILED" "FAILED" "SKIPPED" Example: status=PARTIAL_FAILED Filter by execution status |
| trigger_type | string Enum: "SCHEDULED" "MANUAL" Example: trigger_type=MANUAL Filter by how the run was started |
const request = require('request'); const options = { method: 'GET', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35/histories', qs: {page: '1', size: '20', status: 'PARTIAL_FAILED', trigger_type: 'MANUAL'}, headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "listData": [
- {
- "id": "exec-0193f2a4-7c1e-7b2a-9e44-5d6c7a8b9f01",
- "trigger_type": "SCHEDULED",
- "scheduled_time": "2026-12-01 22:00:00",
- "status": "PARTIAL_FAILED",
- "total_instances": 3,
- "success_count": 2,
- "failed_count": 1,
- "duration_ms": 18342,
- "error_message": "Some target servers failed: VM_IN_PROCESS: Server is processing another action"
}
], - "page": 1,
- "pageSize": 20,
- "totalPage": 1,
- "totalItem": 1
}Returns one run of the task and the result on each server in histories.
When the run failed before reaching any server (for example because the service account is broken),
histories is empty and the reason is in the top-level error_message.
| taskId required | string Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35 Task id, from |
| executionId required | string Example: exec-0193f2a4-7c1e-7b2a-9e44-5d6c7a8b9f01 Execution id, from |
const request = require('request'); const options = { method: 'GET', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35/histories/exec-0193f2a4-7c1e-7b2a-9e44-5d6c7a8b9f01', headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "data": {
- "id": "exec-0193f2a4-7c1e-7b2a-9e44-5d6c7a8b9f01",
- "scheduled_task_id": "st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35",
- "task_name": "stop-dev-servers-nightly",
- "region": "HCM-03",
- "action_type": "STOP",
- "trigger_type": "SCHEDULED",
- "status": "PARTIAL_FAILED",
- "total_instances": 3,
- "success_count": 2,
- "failed_count": 1,
- "error_message": "Some target servers failed: VM_IN_PROCESS: Server is processing another action",
- "histories": [
- {
- "id": "his-0193f2a4-7c1f-7d3e-8a55-6e7d8b9c0a12",
- "instance_id": "ins-0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
- "instance_name": "web-dev-01",
- "source_type": "INSTANCE",
- "tag_key": null,
- "tag_value": null,
- "status": "SUCCESS",
- "error_code": null,
- "error_message": null,
- "duration_ms": 6120
}, - {
- "id": "his-0193f2a4-7c20-7e4f-9b66-7f8e9d0a1b23",
- "instance_id": "ins-5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
- "instance_name": "web-dev-02",
- "source_type": "INSTANCE",
- "tag_key": null,
- "tag_value": null,
- "status": "FAILED",
- "error_code": "VM_IN_PROCESS",
- "error_message": "Server is processing another action",
- "duration_ms": 1204
}, - {
- "id": "his-0193f2a4-7c21-7f50-8c77-8a9f0e1b2c34",
- "instance_id": "ins-9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
- "instance_name": "worker-dev-01",
- "source_type": "TAG",
- "tag_key": "env",
- "tag_value": "dev",
- "status": "SUCCESS",
- "error_code": null,
- "error_message": null,
- "duration_ms": 5987
}
]
}
}Lists every action Scheduled O&M performed on one server, across all your tasks, most recent first. Useful to answer "why did my server stop last night?".
An unknown instanceId returns an empty list, not 404.
| instanceId required | string Example: ins-0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d vServer server id |
| page | integer >= 1 Default: 1 Example: page=1 Page number, starting at 1 |
| size | integer >= 1 Default: 20 Example: size=20 Items per page |
| status | string Enum: "SUCCESS" "FAILED" "TIMEOUT" "SKIPPED" Example: status=FAILED Filter by per-server result |
const request = require('request'); const options = { method: 'GET', url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/instances/ins-0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/histories', qs: {page: '1', size: '20', status: 'FAILED'}, headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "listData": [
- {
- "id": "his-0193f2a4-7c1f-7d3e-8a55-6e7d8b9c0a12",
- "execution_id": "exec-0193f2a4-7c1e-7b2a-9e44-5d6c7a8b9f01",
- "scheduled_task_id": "st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35",
- "task_name": "stop-dev-servers-nightly",
- "action_type": "STOP",
- "trigger_type": "SCHEDULED",
- "source_type": "INSTANCE",
- "status": "SUCCESS",
- "error_code": null,
- "error_message": null,
- "duration_ms": 6120,
- "started_at": "2026-12-01 22:00:02"
}
], - "page": 1,
- "pageSize": 20,
- "totalPage": 1,
- "totalItem": 1
}