{"openapi":"3.1.0","info":{"title":"Secure Automation API v2","version":"1.0.0","description":"A secure, account-scoped gateway for NextGen CRM sub-accounts, communities, members, contacts, and membership areas. Gateway tokens are never valid against NextGen CRM directly."},"servers":[{"url":"https://api-v2.secureautomation.app","description":"Production"}],"tags":[{"name":"Authentication"},{"name":"Onboarding"},{"name":"Sub-accounts"},{"name":"Sub-account users"},{"name":"Communities"},{"name":"Community events"},{"name":"Community groups"},{"name":"Community members"},{"name":"Community roles"},{"name":"Membership areas"},{"name":"Contacts"},{"name":"Contact memberships"},{"name":"Contact access"}],"paths":{"/v1/auth/token":{"post":{"tags":["Authentication"],"summary":"Generate a short-lived gateway token","description":"Uses the client_credentials grant. The returned JWT is accepted by this gateway only; it is not a NextGen CRM token.","operationId":"postV1AuthToken","responses":{"200":{"description":"Gateway token issued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"},"example":{"grant_type":"client_credentials","client_id":"YOUR_CLIENT_ID","client_secret":"YOUR_CLIENT_SECRET"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}}}}},"/v1/onboarding/submissions":{"post":{"tags":["Onboarding"],"summary":"Create a NextGen sub-account from the onboarding form","description":"Validates a same-origin onboarding submission, checks for an existing business or administrator, and provisions the NextGen sub-account without exposing parent credentials.","operationId":"postV1OnboardingSubmissions","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"business_name":"Example Client","business_website":"https://example.com","industry":"Professional services","team_size":"2-10","administrator_first_name":"Avery","administrator_last_name":"Customer","administrator_email":"avery@example.com","administrator_phone":"+15555550123","country":"United States","timezone":"America/New_York","region":"US","terms_accepted":true,"form_started_at":0}}}}}},"/v1/onboarding/email-availability":{"post":{"tags":["Onboarding"],"summary":"Check whether an administrator email is available","description":"Same-origin check used by the onboarding form. It returns only availability and never exposes NextGen user records.","operationId":"postV1OnboardingEmailAvailability","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"email":"avery@example.com"}}}}}},"/v1/subaccounts":{"get":{"tags":["Sub-accounts"],"summary":"List accessible NextGen sub-accounts","description":"List accessible NextGen sub-accounts","operationId":"getV1Subaccounts","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum records per page"}]},"post":{"tags":["Sub-accounts"],"summary":"Create a NextGen sub-account","description":"Create a NextGen sub-account","operationId":"postV1Subaccounts","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"name":"Example Client","admin_first_name":"Avery","admin_last_name":"Customer","admin_email":"avery@example.com","admin_password":"CHANGE_ME","assigned_plan_id":"PLAN_ID","region_id":"REGION_ID","role_id":"ROLE_ID"}}}}}},"/v1/subaccounts/{accountId}":{"get":{"tags":["Sub-accounts"],"summary":"Get a sub-account","description":"Get a sub-account","operationId":"getV1SubaccountsAccountId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}]},"patch":{"tags":["Sub-accounts"],"summary":"Update a sub-account","description":"Update a sub-account","operationId":"patchV1SubaccountsAccountId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"name":"Updated Client Name"}}}}},"delete":{"tags":["Sub-accounts"],"summary":"Soft-delete a sub-account","description":"Soft-delete a sub-account","operationId":"deleteV1SubaccountsAccountId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}]}},"/v1/subaccounts/{accountId}/status":{"patch":{"tags":["Sub-accounts"],"summary":"Update a sub-account status","description":"Update a sub-account status","operationId":"patchV1SubaccountsAccountIdStatus","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"status":"active"}}}}}},"/v1/subaccounts/{accountId}/inherit-access":{"patch":{"tags":["Sub-accounts"],"summary":"Enable or disable inherited parent access","description":"Enable or disable inherited parent access","operationId":"patchV1SubaccountsAccountIdInheritAccess","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"enabled":true}}}}}},"/v1/subaccounts/{accountId}/role":{"patch":{"tags":["Sub-accounts"],"summary":"Apply a role to a user in a sub-account","description":"Apply a role to a user in a sub-account","operationId":"patchV1SubaccountsAccountIdRole","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"user_id":"USER_ID","role_id":"ROLE_ID"}}}}}},"/v1/subaccounts/{accountId}/primary-admin":{"get":{"tags":["Sub-accounts"],"summary":"Get the primary administrator","description":"Get the primary administrator","operationId":"getV1SubaccountsAccountIdPrimaryAdmin","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}]}},"/v1/subaccounts/{accountId}/plan":{"get":{"tags":["Sub-accounts"],"summary":"Get the assigned plan","description":"Get the assigned plan","operationId":"getV1SubaccountsAccountIdPlan","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}]},"patch":{"tags":["Sub-accounts"],"summary":"Assign a plan","description":"Assign a plan","operationId":"patchV1SubaccountsAccountIdPlan","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"plan_id":"PLAN_ID","billing_mode":"keep","wallet_mode":"keep"}}}}}},"/v1/subaccounts/{accountId}/plan-items":{"patch":{"tags":["Sub-accounts"],"summary":"Update assigned plan items","description":"Update assigned plan items","operationId":"patchV1SubaccountsAccountIdPlanItems","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"items":[{"resource_id":"RESOURCE_ID","is_enabled":true}]}}}}}},"/v1/subaccounts/{accountId}/users":{"get":{"tags":["Sub-account users"],"summary":"List users in a sub-account","description":"List users in a sub-account The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdUsers","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum records per page"}]},"post":{"tags":["Sub-account users"],"summary":"Add a user to a sub-account","description":"Add a user to a sub-account The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdUsers","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"email":"team@example.com","role":"admin"}}}}}},"/v1/subaccounts/{accountId}/users/bulk":{"post":{"tags":["Sub-account users"],"summary":"Add users to a sub-account in bulk","description":"Add users to a sub-account in bulk The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdUsersBulk","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"users":[{"email":"team@example.com","role":"member"}]}}}}}},"/v1/subaccounts/{accountId}/users/{email}":{"delete":{"tags":["Sub-account users"],"summary":"Remove a user from a sub-account","description":"Remove a user from a sub-account The gateway selects the account server-side and never returns the NextGen credential.","operationId":"deleteV1SubaccountsAccountIdUsersEmail","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"accounts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"email","in":"path","required":true,"schema":{"type":"string"},"description":"email identifier"}]}},"/v1/subaccounts/{accountId}/communities":{"get":{"tags":["Communities"],"summary":"List communities","description":"List communities The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdCommunities","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum records per page"}]},"post":{"tags":["Communities"],"summary":"Create a community","description":"Create a community The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdCommunities","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"name":"Customer Community","description":"Private customer community","slug":"customer-community"}}}}}},"/v1/subaccounts/{accountId}/communities/{communityId}":{"get":{"tags":["Communities"],"summary":"Get a community","description":"Get a community The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdCommunitiesCommunityId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"}]},"patch":{"tags":["Communities"],"summary":"Update a community","description":"Update a community The gateway selects the account server-side and never returns the NextGen credential.","operationId":"patchV1SubaccountsAccountIdCommunitiesCommunityId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"name":"Updated Community","description":"Updated description"}}}}},"delete":{"tags":["Communities"],"summary":"Delete a community","description":"Delete a community The gateway selects the account server-side and never returns the NextGen credential.","operationId":"deleteV1SubaccountsAccountIdCommunitiesCommunityId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"}]}},"/v1/subaccounts/{accountId}/communities/{communityId}/publish":{"post":{"tags":["Communities"],"summary":"Publish a community","description":"Publish a community The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdCommunitiesCommunityIdPublish","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{}}}}}},"/v1/subaccounts/{accountId}/communities/{communityId}/public":{"get":{"tags":["Communities"],"summary":"Get the public community representation","description":"Get the public community representation The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdCommunitiesCommunityIdPublic","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"}]}},"/v1/subaccounts/{accountId}/communities/{communityId}/public-events":{"get":{"tags":["Community events"],"summary":"List public community events","description":"List public community events The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdCommunitiesCommunityIdPublicEvents","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"}]}},"/v1/subaccounts/{accountId}/communities/{communityId}/groups":{"get":{"tags":["Community groups"],"summary":"List community groups or rooms","description":"List community groups or rooms The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdCommunitiesCommunityIdGroups","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"}]},"post":{"tags":["Community groups"],"summary":"Create a community group or room","description":"Create a community group or room The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdCommunitiesCommunityIdGroups","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"name":"General","description":"General discussion","color":"#4F46E5","icon":"messages"}}}}}},"/v1/subaccounts/{accountId}/communities/{communityId}/groups/{groupId}":{"delete":{"tags":["Community groups"],"summary":"Delete a community group or room","description":"Delete a community group or room The gateway selects the account server-side and never returns the NextGen credential.","operationId":"deleteV1SubaccountsAccountIdCommunitiesCommunityIdGroupsGroupId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"},{"name":"groupId","in":"path","required":true,"schema":{"type":"string"},"description":"groupId identifier"}]}},"/v1/subaccounts/{accountId}/communities/{communityId}/events":{"get":{"tags":["Community events"],"summary":"List community events","description":"List community events The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdCommunitiesCommunityIdEvents","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"}]},"post":{"tags":["Community events"],"summary":"Create a community event","description":"Create a community event The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdCommunitiesCommunityIdEvents","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"title":"Welcome call","description":"Meet the community","event_date":"2026-11-01","start_time":"10:00","end_time":"11:00","recurring_type":"none","visible":true}}}}}},"/v1/subaccounts/{accountId}/communities/{communityId}/events/{eventId}":{"patch":{"tags":["Community events"],"summary":"Update a community event","description":"Update a community event The gateway selects the account server-side and never returns the NextGen credential.","operationId":"patchV1SubaccountsAccountIdCommunitiesCommunityIdEventsEventId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"},{"name":"eventId","in":"path","required":true,"schema":{"type":"string"},"description":"eventId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"title":"Updated welcome call","visible":true}}}}},"delete":{"tags":["Community events"],"summary":"Delete a community event","description":"Delete a community event The gateway selects the account server-side and never returns the NextGen credential.","operationId":"deleteV1SubaccountsAccountIdCommunitiesCommunityIdEventsEventId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"},{"name":"eventId","in":"path","required":true,"schema":{"type":"string"},"description":"eventId identifier"}]}},"/v1/subaccounts/{accountId}/communities/{communityId}/members":{"get":{"tags":["Community members"],"summary":"List community members","description":"List community members The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdCommunitiesCommunityIdMembers","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"members:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum records per page"}]},"post":{"tags":["Community members"],"summary":"Add an existing member or user to a community","description":"Adds an existing NextGen member_id or user_id to a community. To create a customer first, use the Contacts and Contact memberships endpoints. The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdCommunitiesCommunityIdMembers","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"members:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"member_id":"MEMBER_ID","role":"member"}}}}}},"/v1/subaccounts/{accountId}/communities/{communityId}/members/{memberId}":{"patch":{"tags":["Community members"],"summary":"Update a community member","description":"Update a community member The gateway selects the account server-side and never returns the NextGen credential.","operationId":"patchV1SubaccountsAccountIdCommunitiesCommunityIdMembersMemberId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"members:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"},{"name":"memberId","in":"path","required":true,"schema":{"type":"string"},"description":"memberId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"role":"moderator","status":"active"}}}}},"delete":{"tags":["Community members"],"summary":"Remove a community member","description":"Remove a community member The gateway selects the account server-side and never returns the NextGen credential.","operationId":"deleteV1SubaccountsAccountIdCommunitiesCommunityIdMembersMemberId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"members:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"communityId","in":"path","required":true,"schema":{"type":"string"},"description":"communityId identifier"},{"name":"memberId","in":"path","required":true,"schema":{"type":"string"},"description":"memberId identifier"}]}},"/v1/subaccounts/{accountId}/community-roles":{"get":{"tags":["Community roles"],"summary":"List account community roles","description":"List account community roles The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdCommunityRoles","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}]},"post":{"tags":["Community roles"],"summary":"Create a community role","description":"Create a community role The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdCommunityRoles","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"name":"Coach","permissions":{"can_post":true,"can_comment":true}}}}}}},"/v1/subaccounts/{accountId}/community-roles/{roleId}":{"patch":{"tags":["Community roles"],"summary":"Update a community role","description":"Update a community role The gateway selects the account server-side and never returns the NextGen credential.","operationId":"patchV1SubaccountsAccountIdCommunityRolesRoleId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"roleId","in":"path","required":true,"schema":{"type":"string"},"description":"roleId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"name":"Lead Coach","permissions":{"can_post":true,"can_comment":true,"can_pin":true}}}}}},"delete":{"tags":["Community roles"],"summary":"Delete a community role","description":"Delete a community role The gateway selects the account server-side and never returns the NextGen credential.","operationId":"deleteV1SubaccountsAccountIdCommunityRolesRoleId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"communities:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"roleId","in":"path","required":true,"schema":{"type":"string"},"description":"roleId identifier"}]}},"/v1/subaccounts/{accountId}/memberships":{"get":{"tags":["Membership areas"],"summary":"List membership areas","description":"List membership areas The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdMemberships","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"memberships:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum records per page"}]},"post":{"tags":["Membership areas"],"summary":"Create a membership area","description":"Create a membership area The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdMemberships","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"memberships:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"name":"Customer Membership","description":"Customer courses and community","slug":"customers","status":"draft","course_ids":[],"settings":{"community_id":"COMMUNITY_ID"}}}}}}},"/v1/subaccounts/{accountId}/memberships/{membershipId}":{"get":{"tags":["Membership areas"],"summary":"Get a membership area","description":"Get a membership area The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdMembershipsMembershipId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"memberships:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"membershipId","in":"path","required":true,"schema":{"type":"string"},"description":"membershipId identifier"}]},"patch":{"tags":["Membership areas"],"summary":"Update a membership area","description":"Update a membership area The gateway selects the account server-side and never returns the NextGen credential.","operationId":"patchV1SubaccountsAccountIdMembershipsMembershipId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"memberships:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"membershipId","in":"path","required":true,"schema":{"type":"string"},"description":"membershipId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"name":"Updated Membership","status":"published","settings":{"community_id":"COMMUNITY_ID"}}}}}},"delete":{"tags":["Membership areas"],"summary":"Delete a membership area","description":"Delete a membership area The gateway selects the account server-side and never returns the NextGen credential.","operationId":"deleteV1SubaccountsAccountIdMembershipsMembershipId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"memberships:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"membershipId","in":"path","required":true,"schema":{"type":"string"},"description":"membershipId identifier"}]}},"/v1/subaccounts/{accountId}/memberships/{membershipId}/publish":{"post":{"tags":["Membership areas"],"summary":"Publish a membership area","description":"Publish a membership area The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdMembershipsMembershipIdPublish","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"memberships:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"membershipId","in":"path","required":true,"schema":{"type":"string"},"description":"membershipId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{}}}}}},"/v1/subaccounts/{accountId}/contacts":{"get":{"tags":["Contacts"],"summary":"List contacts","description":"List contacts The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdContacts","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"contacts:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1},"description":"Maximum records per page"}]},"post":{"tags":["Contacts"],"summary":"Create a contact or customer","description":"Create a contact or customer The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdContacts","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"contacts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"first_name":"Avery","last_name":"Customer","email":"avery@example.com","phone":"+15555550123","source":"secure-automation-v2"}}}}}},"/v1/subaccounts/{accountId}/contacts/{contactId}":{"get":{"tags":["Contacts"],"summary":"Get a contact","description":"Get a contact The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdContactsContactId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"contacts:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"contactId","in":"path","required":true,"schema":{"type":"string"},"description":"contactId identifier"}]},"patch":{"tags":["Contacts"],"summary":"Update a contact","description":"Update a contact The gateway selects the account server-side and never returns the NextGen credential.","operationId":"patchV1SubaccountsAccountIdContactsContactId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"contacts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"contactId","in":"path","required":true,"schema":{"type":"string"},"description":"contactId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"first_name":"Updated","status":"active"}}}}},"delete":{"tags":["Contacts"],"summary":"Delete a contact","description":"Delete a contact The gateway selects the account server-side and never returns the NextGen credential.","operationId":"deleteV1SubaccountsAccountIdContactsContactId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"contacts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"contactId","in":"path","required":true,"schema":{"type":"string"},"description":"contactId identifier"}]}},"/v1/subaccounts/{accountId}/contacts/{contactId}/memberships":{"get":{"tags":["Contact memberships"],"summary":"List a contact's memberships","description":"List a contact's memberships The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdContactsContactIdMemberships","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"memberships:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"contactId","in":"path","required":true,"schema":{"type":"string"},"description":"contactId identifier"}]},"post":{"tags":["Contact memberships"],"summary":"Grant membership access to a contact","description":"Grant membership access to a contact The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdContactsContactIdMemberships","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"memberships:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"contactId","in":"path","required":true,"schema":{"type":"string"},"description":"contactId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"membership_id":"MEMBERSHIP_ID","email":"avery@example.com","first_name":"Avery","last_name":"Customer","password":"CHANGE_ME","role":"member","status":"active","plan_tier":"standard"}}}}}},"/v1/subaccounts/{accountId}/contacts/{contactId}/memberships/{membershipId}":{"patch":{"tags":["Contact memberships"],"summary":"Update a contact membership","description":"Update a contact membership The gateway selects the account server-side and never returns the NextGen credential.","operationId":"patchV1SubaccountsAccountIdContactsContactIdMembershipsMembershipId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"memberships:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"contactId","in":"path","required":true,"schema":{"type":"string"},"description":"contactId identifier"},{"name":"membershipId","in":"path","required":true,"schema":{"type":"string"},"description":"membershipId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"role":"member","status":"active","plan_tier":"premium"}}}}},"delete":{"tags":["Contact memberships"],"summary":"Revoke a contact membership","description":"Revoke a contact membership The gateway selects the account server-side and never returns the NextGen credential.","operationId":"deleteV1SubaccountsAccountIdContactsContactIdMembershipsMembershipId","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"memberships:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"contactId","in":"path","required":true,"schema":{"type":"string"},"description":"contactId identifier"},{"name":"membershipId","in":"path","required":true,"schema":{"type":"string"},"description":"membershipId identifier"}]}},"/v1/subaccounts/{accountId}/contact-memberships/bulk":{"post":{"tags":["Contact memberships"],"summary":"Grant membership access to contacts in bulk","description":"Grant membership access to contacts in bulk The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdContactMembershipsBulk","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"memberships:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"contact_ids":["CONTACT_ID"],"membership_id":"MEMBERSHIP_ID","role":"member","plan_tier":"standard","course_access":"all"}}}}}},"/v1/subaccounts/{accountId}/contacts/{contactId}/access":{"get":{"tags":["Contact access"],"summary":"Get a contact's resource access","description":"Get a contact's resource access The gateway selects the account server-side and never returns the NextGen credential.","operationId":"getV1SubaccountsAccountIdContactsContactIdAccess","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"contacts:read","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"contactId","in":"path","required":true,"schema":{"type":"string"},"description":"contactId identifier"}]},"post":{"tags":["Contact access"],"summary":"Grant resource access to a contact","description":"Grant resource access to a contact The gateway selects the account server-side and never returns the NextGen credential.","operationId":"postV1SubaccountsAccountIdContactsContactIdAccess","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"201":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"contacts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"contactId","in":"path","required":true,"schema":{"type":"string"},"description":"contactId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"resource_id":"RESOURCE_ID","resource_type":"community"}}}}},"delete":{"tags":["Contact access"],"summary":"Revoke a contact's resource access","description":"Revoke a contact's resource access The gateway selects the account server-side and never returns the NextGen credential.","operationId":"deleteV1SubaccountsAccountIdContactsContactIdAccess","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"contacts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"contactId","in":"path","required":true,"schema":{"type":"string"},"description":"contactId identifier"}]}},"/v1/subaccounts/{accountId}/contacts/{contactId}/access-credentials":{"patch":{"tags":["Contact access"],"summary":"Update contact login credentials","description":"Update contact login credentials The gateway selects the account server-side and never returns the NextGen credential.","operationId":"patchV1SubaccountsAccountIdContactsContactIdAccessCredentials","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"bearerAuth":[]}],"x-required-scope":"contacts:write","parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"Authorized NextGen CRM sub-account ID"},{"name":"contactId","in":"path","required":true,"schema":{"type":"string"},"description":"contactId identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{"username":"avery@example.com","password":"CHANGE_ME"}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Short-lived token returned by POST /v1/auth/token. This token is accepted only by Secure Automation API v2."}},"schemas":{"TokenRequest":{"type":"object","required":["grant_type"],"properties":{"grant_type":{"type":"string","const":"client_credentials"},"client_id":{"type":"string","description":"May instead be sent with HTTP Basic authentication."},"client_secret":{"type":"string","format":"password","description":"May instead be sent with HTTP Basic authentication."},"scope":{"type":"string","description":"Optional space-separated subset of configured scopes."}}},"TokenResponse":{"type":"object","required":["access_token","token_type","expires_in","scope"],"properties":{"access_token":{"type":"string"},"token_type":{"type":"string","const":"Bearer"},"expires_in":{"type":"integer"},"scope":{"type":"string"}}},"Error":{"type":"object","required":["error","request_id"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}},"request_id":{"type":"string","format":"uuid"}}}},"responses":{"BadRequest":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or invalid gateway credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The token lacks the required scope or account access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UpstreamError":{"description":"NextGen CRM rejected the request or was unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}