{"openapi":"3.1.0","info":{"title":"Localpoint Data Service Ops API","version":"1.0.0","description":"Agent-friendly operations API for Localpoint services. Mutating runs default to dry-run and require explicit confirmation for real sends."},"servers":[{"url":"https://api.localpoint.ai"}],"paths":{"/openapi.json":{"get":{"operationId":"get_openapi_contract","summary":"Get the OpenAPI contract","responses":{"200":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/ops/manifest":{"get":{"operationId":"get_ops_manifest","summary":"List available services, actions, config, and safety rules","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Unauthorized or missing ops token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/ops/config":{"get":{"operationId":"get_redacted_config","summary":"Get the redacted parsed Localpoint config","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Unauthorized or missing ops token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/ops/config/validate":{"post":{"operationId":"validate_config","summary":"Validate a proposed Localpoint client config object","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpsConfigValidateRequest"}}}},"responses":{"200":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Unauthorized or missing ops token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/ops/client/onboarding-plan":{"post":{"operationId":"create_client_onboarding_plan","summary":"Create a client config block, checklist, and test commands","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientOnboardingPlanRequest"}}}},"responses":{"200":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Unauthorized or missing ops token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/ops/run":{"post":{"operationId":"run_service","summary":"Run a Localpoint service action","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpsRunRequest"}}}},"responses":{"200":{"description":"Workflow created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpsRunResponse"}}}},"400":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Unauthorized or missing ops token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/ops/runs/{id}":{"get":{"operationId":"get_run_status","summary":"Get workflow run status across services","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Unauthorized or missing ops token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/ops/google-business/connect-link":{"post":{"operationId":"create_google_business_connect_link","summary":"Create or preview a Google Business Profile connect link","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleBusinessConnectLinkRequest"}}}},"responses":{"200":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Unauthorized or missing ops token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/ops/meta/connect-link":{"post":{"operationId":"create_meta_connect_link","summary":"Create or preview a Meta Facebook and Instagram connect link","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetaConnectLinkRequest"}}}},"responses":{"200":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Unauthorized or missing ops token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/ops/social-posts/schedule":{"post":{"operationId":"schedule_social_post","summary":"Schedule an approved Facebook and Instagram social post","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialPostScheduleRequest"}}}},"responses":{"200":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Unauthorized or missing ops token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/google-business/connect/{token}":{"get":{"operationId":"get_google_business_connect_status","summary":"Get public Google Business connect link status","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/google-business/oauth/start/{token}":{"get":{"operationId":"start_google_business_oauth","summary":"Start Google Business Profile OAuth for a connect token","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect"}}}},"/google-business/oauth/callback":{"get":{"operationId":"handle_google_business_oauth_callback","summary":"Handle Google Business Profile OAuth callback","responses":{"302":{"description":"Redirect"},"400":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/meta/connect/{token}":{"get":{"operationId":"get_meta_connect_status","summary":"Get public Meta connect link status","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"404":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/meta/oauth/start/{token}":{"get":{"operationId":"start_meta_oauth","summary":"Start Meta OAuth for a connect token","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect"}}}},"/meta/oauth/callback":{"get":{"operationId":"handle_meta_oauth_callback","summary":"Handle Meta OAuth callback","responses":{"302":{"description":"Redirect"},"400":{"description":"JSON response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"LocalpointConfig":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"default":1,"type":"number","const":1},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[a-z0-9][a-z0-9_-]*$"},"name":{"type":"string","minLength":1,"maxLength":160},"timezone":{"default":"UTC","type":"string","minLength":1},"contacts":{"type":"object","properties":{"primaryEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"ccEmails":{"default":[],"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}},"required":["primaryEmail"]},"brand":{"type":"object","properties":{"accentColor":{"default":"#111827","type":"string","minLength":1,"maxLength":40},"backgroundImage":{"type":"string","minLength":1},"logoUrl":{"type":"string","minLength":1},"fontFamily":{"type":"string","minLength":1},"thankYouTone":{"default":"Warm, concise, and appreciative.","type":"string","maxLength":300}},"required":["backgroundImage","logoUrl","fontFamily"]},"services":{"type":"object","properties":{"socialPostReviews":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"googleBusinessAccountId":{"type":"string","minLength":1},"googleBusinessLocationId":{"type":"string","minLength":1},"refreshTokenSecretName":{"default":"GOOGLE_BUSINESS_REFRESH_TOKEN","type":"string","minLength":1},"schedule":{"type":"object","properties":{"frequency":{"default":"daily","type":"string","enum":["daily","weekly"]},"dayOfWeek":{"default":"monday","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"hour":{"default":9,"type":"integer","minimum":0,"maximum":23},"lookbackDays":{"default":30,"type":"integer","minimum":1,"maximum":365}}},"templateVersion":{"default":"v1","type":"string","minLength":1},"maxReviewsPerRun":{"default":1,"type":"integer","minimum":1,"maximum":10},"maxReviewLength":{"default":420,"type":"integer","minimum":80,"maximum":1200},"showReviewerPhoto":{"default":false,"type":"boolean"}},"required":["googleBusinessAccountId","googleBusinessLocationId","schedule"]},"clientReports":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"schedule":{"type":"object","properties":{"dayOfWeek":{"default":"sunday","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"hour":{"default":18,"type":"integer","minimum":0,"maximum":23},"reportDays":{"default":7,"type":"integer","minimum":1,"maximum":31}}},"sections":{"default":[],"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"cloudflare-web-analytics"},"id":{"default":"website","type":"string","minLength":1,"maxLength":80},"label":{"default":"Website analytics","type":"string","minLength":1,"maxLength":120},"host":{"type":"string","minLength":1,"maxLength":255},"siteTag":{"type":"string","minLength":1,"maxLength":120},"topLimit":{"default":5,"type":"integer","minimum":1,"maximum":25}},"required":["type","host"]}}},"required":["schedule"]},"contentCurator":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"brandNotes":{"default":"","type":"string","maxLength":4000},"postingGoal":{"default":"Create a useful, polished social post for a local business.","type":"string","maxLength":1000},"platforms":{"default":["Instagram","Facebook"],"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"lookbackHours":{"default":36,"type":"integer","minimum":1,"maximum":336},"maxAssetsToAnalyze":{"default":12,"type":"integer","minimum":1,"maximum":20},"maxSelections":{"default":3,"type":"integer","minimum":1,"maximum":5},"maxImageBytes":{"default":8000000,"type":"integer","minimum":100000,"maximum":15000000},"maxVideoBytes":{"default":80000000,"type":"integer","minimum":1000000,"maximum":250000000},"sendEmptyReport":{"default":false,"type":"boolean"},"sources":{"default":[],"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"google-drive"},"id":{"type":"string","minLength":1,"maxLength":80},"label":{"type":"string","minLength":1,"maxLength":120},"folderId":{"type":"string","minLength":1},"includeSubfolders":{"default":true,"type":"boolean"},"includeSharedDrives":{"default":true,"type":"boolean"},"maxFolders":{"default":40,"type":"integer","minimum":1,"maximum":200},"pageSize":{"default":50,"type":"integer","minimum":1,"maximum":100},"serviceAccountSecretName":{"default":"GOOGLE_DRIVE_SERVICE_ACCOUNT_JSON","type":"string","minLength":1}},"required":["type","id","folderId"]}}}},"socialScheduler":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"platforms":{"default":["facebook","instagram"],"minItems":1,"type":"array","items":{"type":"string","enum":["facebook","instagram"]}},"approvalMode":{"default":"agency_approved","type":"string","const":"agency_approved"},"facebookPageId":{"type":"string","minLength":1},"instagramAccountId":{"type":"string","minLength":1}},"required":["facebookPageId","instagramAccountId"]},"seoBlogAutomation":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"siteBaseUrl":{"type":"string","minLength":1},"blogPath":{"default":"/blog","type":"string","minLength":1},"schedule":{"type":"object","properties":{"cadence":{"default":"two_per_month","type":"string","enum":["two_per_month","weekly","manual"]},"hour":{"default":9,"type":"integer","minimum":0,"maximum":23},"twoPerMonthSlots":{"default":[{"weekOfMonth":1,"dayOfWeek":"tuesday"},{"weekOfMonth":3,"dayOfWeek":"thursday"}],"minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"weekOfMonth":{"type":"integer","minimum":1,"maximum":5},"dayOfWeek":{"type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]}},"required":["weekOfMonth","dayOfWeek"]}},"weeklyDays":{"default":["tuesday"],"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]}},"minDaysBetweenPosts":{"default":3,"type":"integer","minimum":1,"maximum":30},"approvalLeadDays":{"default":2,"type":"integer","minimum":0,"maximum":30},"jitterMinutes":{"default":12,"type":"integer","minimum":0,"maximum":120},"refreshEveryDays":{"default":120,"type":"integer","minimum":30,"maximum":365}}},"primaryServices":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"serviceAreas":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"audience":{"default":"Local customers.","type":"string","maxLength":500},"expertiseNotes":{"default":"","type":"string","maxLength":2000},"brandVoice":{"default":"Useful, clear, locally specific, professional, and not hype-driven.","type":"string","maxLength":1000},"regulatedIndustry":{"default":false,"type":"boolean"},"topicSeeds":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"title":{"type":"string","minLength":1,"maxLength":180},"targetKeyword":{"type":"string","minLength":1,"maxLength":120},"supportingKeywords":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"targetLocation":{"type":"string","minLength":1,"maxLength":120},"businessGoal":{"type":"string","minLength":1,"maxLength":500},"localAngle":{"type":"string","minLength":1,"maxLength":600},"evidence":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"score":{"default":75,"type":"integer","minimum":0,"maximum":100},"sourceSignalType":{"default":"scheduled","type":"string","minLength":1,"maxLength":80},"sourceSignalId":{"type":"string","minLength":1,"maxLength":160}},"required":["title","targetKeyword","businessGoal","localAngle"]}},"requiredInternalLinks":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","minLength":1,"maxLength":500},"context":{"type":"string","minLength":1,"maxLength":300}},"required":["label","url"]}},"imagePolicy":{"type":"object","properties":{"preferClientImages":{"default":true,"type":"boolean"},"allowGeneratedImages":{"default":true,"type":"boolean"},"requireImageBeforeApproval":{"default":true,"type":"boolean"},"sourceNotes":{"default":"Use real client job photos first. Generated images are only for abstract or educational visuals and must not imply completed real-world client work.","type":"string","maxLength":800}}},"approvalMode":{"default":"human_required","type":"string","const":"human_required"}},"required":["siteBaseUrl","schedule","imagePolicy"]}},"required":["socialPostReviews","clientReports","contentCurator","socialScheduler","seoBlogAutomation"]}},"required":["id","name","contacts","brand","services"]}}}},"OpsConfigValidateRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"config":{"type":"object","properties":{"version":{"default":1,"type":"number","const":1},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[a-z0-9][a-z0-9_-]*$"},"name":{"type":"string","minLength":1,"maxLength":160},"timezone":{"default":"UTC","type":"string","minLength":1},"contacts":{"type":"object","properties":{"primaryEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"ccEmails":{"default":[],"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}},"required":["primaryEmail"]},"brand":{"type":"object","properties":{"accentColor":{"default":"#111827","type":"string","minLength":1,"maxLength":40},"backgroundImage":{"type":"string","minLength":1},"logoUrl":{"type":"string","minLength":1},"fontFamily":{"type":"string","minLength":1},"thankYouTone":{"default":"Warm, concise, and appreciative.","type":"string","maxLength":300}},"required":["backgroundImage","logoUrl","fontFamily"]},"services":{"type":"object","properties":{"socialPostReviews":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"googleBusinessAccountId":{"type":"string","minLength":1},"googleBusinessLocationId":{"type":"string","minLength":1},"refreshTokenSecretName":{"default":"GOOGLE_BUSINESS_REFRESH_TOKEN","type":"string","minLength":1},"schedule":{"type":"object","properties":{"frequency":{"default":"daily","type":"string","enum":["daily","weekly"]},"dayOfWeek":{"default":"monday","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"hour":{"default":9,"type":"integer","minimum":0,"maximum":23},"lookbackDays":{"default":30,"type":"integer","minimum":1,"maximum":365}}},"templateVersion":{"default":"v1","type":"string","minLength":1},"maxReviewsPerRun":{"default":1,"type":"integer","minimum":1,"maximum":10},"maxReviewLength":{"default":420,"type":"integer","minimum":80,"maximum":1200},"showReviewerPhoto":{"default":false,"type":"boolean"}},"required":["googleBusinessAccountId","googleBusinessLocationId","schedule"]},"clientReports":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"schedule":{"type":"object","properties":{"dayOfWeek":{"default":"sunday","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"hour":{"default":18,"type":"integer","minimum":0,"maximum":23},"reportDays":{"default":7,"type":"integer","minimum":1,"maximum":31}}},"sections":{"default":[],"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"cloudflare-web-analytics"},"id":{"default":"website","type":"string","minLength":1,"maxLength":80},"label":{"default":"Website analytics","type":"string","minLength":1,"maxLength":120},"host":{"type":"string","minLength":1,"maxLength":255},"siteTag":{"type":"string","minLength":1,"maxLength":120},"topLimit":{"default":5,"type":"integer","minimum":1,"maximum":25}},"required":["type","host"]}}},"required":["schedule"]},"contentCurator":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"brandNotes":{"default":"","type":"string","maxLength":4000},"postingGoal":{"default":"Create a useful, polished social post for a local business.","type":"string","maxLength":1000},"platforms":{"default":["Instagram","Facebook"],"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"lookbackHours":{"default":36,"type":"integer","minimum":1,"maximum":336},"maxAssetsToAnalyze":{"default":12,"type":"integer","minimum":1,"maximum":20},"maxSelections":{"default":3,"type":"integer","minimum":1,"maximum":5},"maxImageBytes":{"default":8000000,"type":"integer","minimum":100000,"maximum":15000000},"maxVideoBytes":{"default":80000000,"type":"integer","minimum":1000000,"maximum":250000000},"sendEmptyReport":{"default":false,"type":"boolean"},"sources":{"default":[],"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"google-drive"},"id":{"type":"string","minLength":1,"maxLength":80},"label":{"type":"string","minLength":1,"maxLength":120},"folderId":{"type":"string","minLength":1},"includeSubfolders":{"default":true,"type":"boolean"},"includeSharedDrives":{"default":true,"type":"boolean"},"maxFolders":{"default":40,"type":"integer","minimum":1,"maximum":200},"pageSize":{"default":50,"type":"integer","minimum":1,"maximum":100},"serviceAccountSecretName":{"default":"GOOGLE_DRIVE_SERVICE_ACCOUNT_JSON","type":"string","minLength":1}},"required":["type","id","folderId"]}}}},"socialScheduler":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"platforms":{"default":["facebook","instagram"],"minItems":1,"type":"array","items":{"type":"string","enum":["facebook","instagram"]}},"approvalMode":{"default":"agency_approved","type":"string","const":"agency_approved"},"facebookPageId":{"type":"string","minLength":1},"instagramAccountId":{"type":"string","minLength":1}},"required":["facebookPageId","instagramAccountId"]},"seoBlogAutomation":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"siteBaseUrl":{"type":"string","minLength":1},"blogPath":{"default":"/blog","type":"string","minLength":1},"schedule":{"type":"object","properties":{"cadence":{"default":"two_per_month","type":"string","enum":["two_per_month","weekly","manual"]},"hour":{"default":9,"type":"integer","minimum":0,"maximum":23},"twoPerMonthSlots":{"default":[{"weekOfMonth":1,"dayOfWeek":"tuesday"},{"weekOfMonth":3,"dayOfWeek":"thursday"}],"minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"weekOfMonth":{"type":"integer","minimum":1,"maximum":5},"dayOfWeek":{"type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]}},"required":["weekOfMonth","dayOfWeek"]}},"weeklyDays":{"default":["tuesday"],"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]}},"minDaysBetweenPosts":{"default":3,"type":"integer","minimum":1,"maximum":30},"approvalLeadDays":{"default":2,"type":"integer","minimum":0,"maximum":30},"jitterMinutes":{"default":12,"type":"integer","minimum":0,"maximum":120},"refreshEveryDays":{"default":120,"type":"integer","minimum":30,"maximum":365}}},"primaryServices":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"serviceAreas":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"audience":{"default":"Local customers.","type":"string","maxLength":500},"expertiseNotes":{"default":"","type":"string","maxLength":2000},"brandVoice":{"default":"Useful, clear, locally specific, professional, and not hype-driven.","type":"string","maxLength":1000},"regulatedIndustry":{"default":false,"type":"boolean"},"topicSeeds":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"title":{"type":"string","minLength":1,"maxLength":180},"targetKeyword":{"type":"string","minLength":1,"maxLength":120},"supportingKeywords":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"targetLocation":{"type":"string","minLength":1,"maxLength":120},"businessGoal":{"type":"string","minLength":1,"maxLength":500},"localAngle":{"type":"string","minLength":1,"maxLength":600},"evidence":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"score":{"default":75,"type":"integer","minimum":0,"maximum":100},"sourceSignalType":{"default":"scheduled","type":"string","minLength":1,"maxLength":80},"sourceSignalId":{"type":"string","minLength":1,"maxLength":160}},"required":["title","targetKeyword","businessGoal","localAngle"]}},"requiredInternalLinks":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","minLength":1,"maxLength":500},"context":{"type":"string","minLength":1,"maxLength":300}},"required":["label","url"]}},"imagePolicy":{"type":"object","properties":{"preferClientImages":{"default":true,"type":"boolean"},"allowGeneratedImages":{"default":true,"type":"boolean"},"requireImageBeforeApproval":{"default":true,"type":"boolean"},"sourceNotes":{"default":"Use real client job photos first. Generated images are only for abstract or educational visuals and must not imply completed real-world client work.","type":"string","maxLength":800}}},"approvalMode":{"default":"human_required","type":"string","const":"human_required"}},"required":["siteBaseUrl","schedule","imagePolicy"]}},"required":["socialPostReviews","clientReports","contentCurator","socialScheduler","seoBlogAutomation"]}},"required":["id","name","contacts","brand","services"]}}}}},"required":["config"]},{"type":"object","properties":{"version":{"default":1,"type":"number","const":1},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[a-z0-9][a-z0-9_-]*$"},"name":{"type":"string","minLength":1,"maxLength":160},"timezone":{"default":"UTC","type":"string","minLength":1},"contacts":{"type":"object","properties":{"primaryEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"ccEmails":{"default":[],"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}},"required":["primaryEmail"]},"brand":{"type":"object","properties":{"accentColor":{"default":"#111827","type":"string","minLength":1,"maxLength":40},"backgroundImage":{"type":"string","minLength":1},"logoUrl":{"type":"string","minLength":1},"fontFamily":{"type":"string","minLength":1},"thankYouTone":{"default":"Warm, concise, and appreciative.","type":"string","maxLength":300}},"required":["backgroundImage","logoUrl","fontFamily"]},"services":{"type":"object","properties":{"socialPostReviews":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"googleBusinessAccountId":{"type":"string","minLength":1},"googleBusinessLocationId":{"type":"string","minLength":1},"refreshTokenSecretName":{"default":"GOOGLE_BUSINESS_REFRESH_TOKEN","type":"string","minLength":1},"schedule":{"type":"object","properties":{"frequency":{"default":"daily","type":"string","enum":["daily","weekly"]},"dayOfWeek":{"default":"monday","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"hour":{"default":9,"type":"integer","minimum":0,"maximum":23},"lookbackDays":{"default":30,"type":"integer","minimum":1,"maximum":365}}},"templateVersion":{"default":"v1","type":"string","minLength":1},"maxReviewsPerRun":{"default":1,"type":"integer","minimum":1,"maximum":10},"maxReviewLength":{"default":420,"type":"integer","minimum":80,"maximum":1200},"showReviewerPhoto":{"default":false,"type":"boolean"}},"required":["googleBusinessAccountId","googleBusinessLocationId","schedule"]},"clientReports":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"schedule":{"type":"object","properties":{"dayOfWeek":{"default":"sunday","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"hour":{"default":18,"type":"integer","minimum":0,"maximum":23},"reportDays":{"default":7,"type":"integer","minimum":1,"maximum":31}}},"sections":{"default":[],"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"cloudflare-web-analytics"},"id":{"default":"website","type":"string","minLength":1,"maxLength":80},"label":{"default":"Website analytics","type":"string","minLength":1,"maxLength":120},"host":{"type":"string","minLength":1,"maxLength":255},"siteTag":{"type":"string","minLength":1,"maxLength":120},"topLimit":{"default":5,"type":"integer","minimum":1,"maximum":25}},"required":["type","host"]}}},"required":["schedule"]},"contentCurator":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"brandNotes":{"default":"","type":"string","maxLength":4000},"postingGoal":{"default":"Create a useful, polished social post for a local business.","type":"string","maxLength":1000},"platforms":{"default":["Instagram","Facebook"],"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"lookbackHours":{"default":36,"type":"integer","minimum":1,"maximum":336},"maxAssetsToAnalyze":{"default":12,"type":"integer","minimum":1,"maximum":20},"maxSelections":{"default":3,"type":"integer","minimum":1,"maximum":5},"maxImageBytes":{"default":8000000,"type":"integer","minimum":100000,"maximum":15000000},"maxVideoBytes":{"default":80000000,"type":"integer","minimum":1000000,"maximum":250000000},"sendEmptyReport":{"default":false,"type":"boolean"},"sources":{"default":[],"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"google-drive"},"id":{"type":"string","minLength":1,"maxLength":80},"label":{"type":"string","minLength":1,"maxLength":120},"folderId":{"type":"string","minLength":1},"includeSubfolders":{"default":true,"type":"boolean"},"includeSharedDrives":{"default":true,"type":"boolean"},"maxFolders":{"default":40,"type":"integer","minimum":1,"maximum":200},"pageSize":{"default":50,"type":"integer","minimum":1,"maximum":100},"serviceAccountSecretName":{"default":"GOOGLE_DRIVE_SERVICE_ACCOUNT_JSON","type":"string","minLength":1}},"required":["type","id","folderId"]}}}},"socialScheduler":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"platforms":{"default":["facebook","instagram"],"minItems":1,"type":"array","items":{"type":"string","enum":["facebook","instagram"]}},"approvalMode":{"default":"agency_approved","type":"string","const":"agency_approved"},"facebookPageId":{"type":"string","minLength":1},"instagramAccountId":{"type":"string","minLength":1}},"required":["facebookPageId","instagramAccountId"]},"seoBlogAutomation":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"siteBaseUrl":{"type":"string","minLength":1},"blogPath":{"default":"/blog","type":"string","minLength":1},"schedule":{"type":"object","properties":{"cadence":{"default":"two_per_month","type":"string","enum":["two_per_month","weekly","manual"]},"hour":{"default":9,"type":"integer","minimum":0,"maximum":23},"twoPerMonthSlots":{"default":[{"weekOfMonth":1,"dayOfWeek":"tuesday"},{"weekOfMonth":3,"dayOfWeek":"thursday"}],"minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"weekOfMonth":{"type":"integer","minimum":1,"maximum":5},"dayOfWeek":{"type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]}},"required":["weekOfMonth","dayOfWeek"]}},"weeklyDays":{"default":["tuesday"],"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]}},"minDaysBetweenPosts":{"default":3,"type":"integer","minimum":1,"maximum":30},"approvalLeadDays":{"default":2,"type":"integer","minimum":0,"maximum":30},"jitterMinutes":{"default":12,"type":"integer","minimum":0,"maximum":120},"refreshEveryDays":{"default":120,"type":"integer","minimum":30,"maximum":365}}},"primaryServices":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"serviceAreas":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"audience":{"default":"Local customers.","type":"string","maxLength":500},"expertiseNotes":{"default":"","type":"string","maxLength":2000},"brandVoice":{"default":"Useful, clear, locally specific, professional, and not hype-driven.","type":"string","maxLength":1000},"regulatedIndustry":{"default":false,"type":"boolean"},"topicSeeds":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"title":{"type":"string","minLength":1,"maxLength":180},"targetKeyword":{"type":"string","minLength":1,"maxLength":120},"supportingKeywords":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"targetLocation":{"type":"string","minLength":1,"maxLength":120},"businessGoal":{"type":"string","minLength":1,"maxLength":500},"localAngle":{"type":"string","minLength":1,"maxLength":600},"evidence":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"score":{"default":75,"type":"integer","minimum":0,"maximum":100},"sourceSignalType":{"default":"scheduled","type":"string","minLength":1,"maxLength":80},"sourceSignalId":{"type":"string","minLength":1,"maxLength":160}},"required":["title","targetKeyword","businessGoal","localAngle"]}},"requiredInternalLinks":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","minLength":1,"maxLength":500},"context":{"type":"string","minLength":1,"maxLength":300}},"required":["label","url"]}},"imagePolicy":{"type":"object","properties":{"preferClientImages":{"default":true,"type":"boolean"},"allowGeneratedImages":{"default":true,"type":"boolean"},"requireImageBeforeApproval":{"default":true,"type":"boolean"},"sourceNotes":{"default":"Use real client job photos first. Generated images are only for abstract or educational visuals and must not imply completed real-world client work.","type":"string","maxLength":800}}},"approvalMode":{"default":"human_required","type":"string","const":"human_required"}},"required":["siteBaseUrl","schedule","imagePolicy"]}},"required":["socialPostReviews","clientReports","contentCurator","socialScheduler","seoBlogAutomation"]}},"required":["id","name","contacts","brand","services"]}}}}]},"ClientOnboardingPlanRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[a-z0-9][a-z0-9_-]*$"},"name":{"type":"string","minLength":1,"maxLength":160},"primaryEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"ccEmails":{"default":[],"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"timezone":{"default":"Australia/Brisbane","type":"string","minLength":1},"brand":{"default":{"accentColor":"#111827","thankYouTone":"Warm, concise, and appreciative."},"type":"object","properties":{"accentColor":{"default":"#111827","type":"string","minLength":1,"maxLength":40},"backgroundImage":{"type":"string","minLength":1},"logoUrl":{"type":"string","minLength":1},"thankYouTone":{"default":"Warm, concise, and appreciative.","type":"string","maxLength":300}}},"services":{"default":{},"type":"object","properties":{"socialPostReviews":{"type":"object","properties":{"enabled":{"default":true,"type":"boolean"},"googleBusinessLocationId":{"type":"string","minLength":1},"refreshTokenSecretName":{"type":"string","minLength":1},"schedule":{"type":"object","properties":{"frequency":{"default":"daily","type":"string","enum":["daily","weekly"]},"dayOfWeek":{"default":"monday","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"hour":{"default":9,"type":"integer","minimum":0,"maximum":23},"lookbackDays":{"default":30,"type":"integer","minimum":1,"maximum":365}}}}},"clientReports":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"websiteHost":{"type":"string","minLength":1}}},"contentCurator":{"type":"object","properties":{"enabled":{"default":false,"type":"boolean"},"googleDriveFolderId":{"type":"string","minLength":1}}}}},"requestId":{"type":"string","minLength":1,"maxLength":160}},"required":["clientId","name","primaryEmail"]},"OpsRunRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"service":{"type":"string","enum":["client-reports","content-curator","seo-blog-automation","social-post-reviews"]},"clientId":{"type":"string","minLength":1},"dryRun":{"default":true,"type":"boolean"},"confirm":{"type":"string"},"requestId":{"type":"string","minLength":1,"maxLength":160},"periodStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"periodEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"since":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"reviewId":{"type":"string","minLength":1},"force":{"default":false,"type":"boolean"},"topicOverride":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":180},"targetKeyword":{"type":"string","minLength":1,"maxLength":120},"supportingKeywords":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"targetLocation":{"type":"string","minLength":1,"maxLength":120},"businessGoal":{"type":"string","minLength":1,"maxLength":500},"localAngle":{"type":"string","minLength":1,"maxLength":600},"evidence":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"score":{"default":75,"type":"integer","minimum":0,"maximum":100},"sourceSignalType":{"default":"manual","type":"string","minLength":1,"maxLength":80},"sourceSignalId":{"type":"string","minLength":1,"maxLength":160}},"required":["title","targetKeyword","businessGoal","localAngle"]}},"required":["service"]},"OpsRunResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"service":{"type":"string","enum":["client-reports","content-curator","seo-blog-automation","social-post-reviews"]},"clientId":{"type":"string"},"dryRun":{"type":"boolean"},"workflowId":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}},"nextActions":{"type":"array","items":{"type":"string"}}},"required":["ok","service","clientId","dryRun","workflowId","warnings","nextActions"]},"GoogleBusinessConnectLinkRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"type":"string","minLength":1},"recipientEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"dryRun":{"default":true,"type":"boolean"},"confirm":{"type":"string"},"requestId":{"type":"string","minLength":1,"maxLength":160}},"required":["clientId"]},"MetaConnectLinkRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"type":"string","minLength":1},"recipientEmail":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"dryRun":{"default":true,"type":"boolean"},"confirm":{"type":"string"},"requestId":{"type":"string","minLength":1,"maxLength":160}},"required":["clientId"]},"SocialPostScheduleRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"type":"string","minLength":1},"caption":{"type":"string","minLength":1,"maxLength":2200},"scheduledAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"platforms":{"minItems":1,"type":"array","items":{"type":"string","enum":["facebook","instagram"]}},"media":{"default":[],"maxItems":10,"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"type":{"type":"string","enum":["image","video"]},"altText":{"type":"string","maxLength":1000}},"required":["url","type"]}},"sourceType":{"type":"string","minLength":1,"maxLength":80},"sourceId":{"type":"string","minLength":1,"maxLength":160},"requestedBy":{"type":"string","minLength":1,"maxLength":160},"dryRun":{"default":true,"type":"boolean"},"confirm":{"type":"string"},"requestId":{"type":"string","minLength":1,"maxLength":160}},"required":["clientId","caption","scheduledAt"]}}}}