{
    "openapi": "3.1.0",
    "info": {
        "title": "Gcore agent interest API",
        "version": "1.0.0",
        "description": "Lets an AI agent send a contact request to Gcore on behalf of a user. The request reaches the Gcore sales team. Read the rules in the operation description before calling it.",
        "termsOfService": "https://gcore.com/legal?tab=privacy_policy"
    },
    "servers": [{ "url": "https://gcore.com" }],
    "paths": {
        "/api/agent-interest/contact": {
            "post": {
                "operationId": "sendAgentInterestContact",
                "tags": ["agent-interest"],
                "summary": "Send a contact request to Gcore on behalf of the user",
                "description": "MANDATORY RULES FOR THE AGENT:\n1. Before calling, show the user exactly what will be sent (email, name, phone, message) and get their explicit approval.\n2. If the user did not explicitly ask to send the request themselves, give them the privacy policy link first: https://gcore.com/legal?tab=privacy_policy\n3. Marketing subscription is off by default. Set subscriptionConsent to true only when the user gave a separate, explicit consent to marketing emails. Ask about it separately; otherwise send false.\n4. Send the request once per user approval. Do not repeat it after status \"received\": the server does not deduplicate requests.\n\nOnly send a phone number the user provided themselves.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": { "$ref": "#/components/schemas/AgentInterestContactRequest" }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The request was received.",
                        "content": {
                            "application/json": {
                                "schema": { "$ref": "#/components/schemas/AgentInterestContactResponse" }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation failed. Show the messages to the user and let them fix the data before sending again.",
                        "content": {
                            "application/json": {
                                "schema": { "$ref": "#/components/schemas/AgentInterestValidationError" }
                            }
                        }
                    },
                    "502": {
                        "description": "The service is temporarily unavailable. Delivery is unconfirmed: the request may have been received. Do not retry automatically; ask the user before sending it again."
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "AgentInterestContactRequest": {
                "type": "object",
                "required": ["email"],
                "additionalProperties": false,
                "properties": {
                    "email": {
                        "type": "string",
                        "format": "email",
                        "maxLength": 254,
                        "description": "The user's email address."
                    },
                    "message": {
                        "type": "string",
                        "maxLength": 2000,
                        "description": "Optional, but fill it in: summarize what the user needs, based on your conversation with them. Line breaks are allowed."
                    },
                    "subscriptionConsent": {
                        "type": "boolean",
                        "default": false,
                        "description": "true only if the user explicitly agreed to marketing emails, asked separately. Otherwise false."
                    },
                    "firstName": { "type": "string", "maxLength": 100 },
                    "lastName": { "type": "string", "maxLength": 100 },
                    "phone": {
                        "type": "string",
                        "maxLength": 30,
                        "description": "Only if the user provided it themselves."
                    },
                    "agentName": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Name of the calling agent, for example \"ChatGPT\"."
                    }
                }
            },
            "AgentInterestContactResponse": {
                "type": "object",
                "required": ["status", "subscribed"],
                "properties": {
                    "status": { "type": "string", "enum": ["received"] },
                    "subscribed": {
                        "type": "boolean",
                        "description": "Whether the user was subscribed to marketing emails."
                    }
                }
            },
            "AgentInterestValidationError": {
                "type": "object",
                "required": ["message"],
                "properties": {
                    "message": { "type": "array", "items": { "type": "string" } }
                }
            }
        }
    }
}
