execute
Run custom JavaScript code to interact with the OVH API, enabling automation of API requests and data processing tasks.
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
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript function to execute. |