search
Query the OVH API specification with custom JavaScript. Discover endpoints, request bodies, and schemas by executing code against the OpenAPI definition.
Instructions
Search the OVH API OpenAPI 3.1 spec. All configured services are included. The spec is passed as argument to your function.
Your code must be a function that receives spec and returns a value:
(spec) => { ... }
Types available:
interface ParameterObject {
name: string; in: "path" | "query"; required: boolean;
description: string; schema: SchemaObject;
}
interface OperationObject {
summary: string; parameters: ParameterObject[];
requestBody?: { content: { "application/json": { schema: SchemaObject } } };
responses: { "200": { content: { "application/json": { schema: SchemaObject } } } };
}
declare function yourCode(spec: {
paths: Record<string, Record<string, OperationObject>>;
components: { schemas: Record<string, SchemaObject> };
}): any;Examples:
// Find account-related endpoints
(spec) => {
const results = [];
for (const [path, methods] of Object.entries(spec.paths)) {
if (path.includes("/account")) {
for (const [method, op] of Object.entries(methods)) {
results.push({ method: method.toUpperCase(), path, summary: op.summary });
}
}
}
return results;
}// Inspect a model schema
(spec) => spec.components.schemas["email.domain.Account"]// Get request body for creating an account
(spec) => {
const op = spec.paths["/email/domain/{domain}/account"]?.post;
return { summary: op?.summary, requestBody: op?.requestBody, parameters: op?.parameters };
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript function to execute. |