execute
Execute JavaScript code to call and process OVH API endpoints. Use async functions with ovh.request for GET, POST, PUT, DELETE operations.
Instructions
Execute JavaScript against the OVH API. Use 'search' first to find endpoints.
Your code must be an async arrow function: async () => { ... }
Available:
declare const ovh: {
request(options: {
method: "GET" | "POST" | "PUT" | "DELETE";
path: string;
query?: Record<string, string | number | boolean>;
body?: unknown;
}): Promise<any>;
};Authentication is automatic. Errors (HTTP >= 400) throw exceptions. Examples:
// List email domains
async () => await ovh.request({ method: "GET", path: "/email/domain" })// List accounts then get details
async () => {
const accounts = await ovh.request({ method: "GET", path: "/email/domain/example.com/account" });
const details = [];
for (const name of accounts.slice(0, 5)) {
const d = await ovh.request({ method: "GET", path: `/email/domain/example.com/account/${name}` });
details.push(d);
}
return details;
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript function to execute. |