{"openapi":"3.0.0","paths":{"/tokens":{"get":{"operationId":"getPartnerTokens","parameters":[{"name":"org_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"tags":["Tokens"],"security":[{"bearer":[]}]},"post":{"operationId":"createPartnerToken","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePartnerToken"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Tokens"],"security":[{"bearer":[]}]}},"/tokens/{token_id}":{"put":{"operationId":"renamePartnerToken","parameters":[{"name":"token_id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenamePartnerTokenDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Tokens"],"security":[{"bearer":[]}]},"delete":{"operationId":"deletePartnerToken","parameters":[{"name":"token_id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Tokens"],"security":[{"bearer":[]}]}},"/oauth/token":{"post":{"operationId":"token","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuth2Request"}}}},"responses":{"201":{"description":"Successful Authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuth2Response"}}}}},"tags":["OAuth"]}},"/white-label/generate-session":{"post":{"operationId":"generateSSOSession","parameters":[{"name":"partner_id","required":false,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateSSOSession"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateSSOSessionResponse"}}}}},"security":[{"bearer":[]}],"tags":["White Label - SSO"]}},"/onboarding/integrations":{"post":{"operationId":"createOnboardingIntegration","summary":"Initialize OAuth integration flow","description":"Initializes OAuth flow and returns an entry_url to begin authorization.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateIntegrationDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateIntegrationResponseDto"}}}}},"tags":["Onboarding - Integrations"],"security":[{"bearer":[]}]}},"/onboarding/integrations/{id}":{"get":{"operationId":"getOnboardingIntegration","summary":"Get OAuth integration status","description":"Retrieves current status and details of an onboarding integration.","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerOnboarding"}}}}},"tags":["Onboarding - Integrations"],"security":[{"bearer":[]}]},"put":{"operationId":"connectOnboardingIntegration","summary":"Complete OAuth integration","description":"Exchanges OAuth code from redirect URL and activates the integration.","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectIntegrationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerOnboarding"}}}}},"tags":["Onboarding - Integrations"],"security":[{"bearer":[]}]},"delete":{"operationId":"disconnectOnboardingIntegration","summary":"Revoke OAuth integration","description":"Revokes OAuth access and deprovisions the active integration.","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Onboarding - Integrations"],"security":[{"bearer":[]}]}},"/onboarding/locations":{"get":{"operationId":"getOnboardingLocations","summary":"List onboarding locations","description":"Retrieves locations associated with an onboarding integration","parameters":[{"name":"onboarding_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOnboardingLocationsResponseDto"}}}}},"tags":["Onboarding - Locations"],"security":[{"bearer":[]}]}},"/onboarding/locations/ingest":{"post":{"operationId":"ingestOnboardingLocations","summary":"Ingest POS locations","description":"Imports location data from the point-of-sale system","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestOnboardingLocationsDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestOnboardingLocationResponseDto"}}}}},"tags":["Onboarding - Locations"],"security":[{"bearer":[]}]}},"/onboarding/locations/bind":{"post":{"operationId":"bindOnboardingLocations","summary":"Bind DSP locations","description":"Associates DSP locations with POS locations","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindOnboardingLocationsDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindOnboardingLocationResponseDto"}}}}},"tags":["Onboarding - Locations"],"security":[{"bearer":[]}]}},"/onboarding/org":{"post":{"operationId":"createUserOrg","summary":"Create organization","description":"Creates a new organization in the partner whitelabel","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserOrgDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserOrgResponseDto"}}}}},"tags":["Onboarding - Org"],"security":[{"bearer":[]}]}},"/onboarding/org/{id}/locations":{"get":{"operationId":"getOrgLocations","summary":"List organization locations","description":"Returns POS or DSP locations for an organization","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"location_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrgLocationsResponseDto"}}}}},"tags":["Onboarding - Org"],"security":[{"bearer":[]}]}},"/billing/reports":{"get":{"operationId":"getBillingReports","parameters":[{"name":"partner_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/billing/reports/raw":{"get":{"operationId":"getRawReportData","parameters":[{"name":"file_name","required":true,"in":"query","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerBillingReport"}}}}}}},"/billing/reports/invoice":{"get":{"operationId":"getBillingReportInvoice","parameters":[{"name":"file_name","required":true,"in":"query","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/features/flags":{"get":{"operationId":"listFlags","summary":"List all feature flags visible to the authenticated partner","parameters":[{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFlagsResponseDto"}}}}},"tags":["Feature Flags"],"security":[{"bearer":[]}]}},"/features/flags/{flagKey}":{"get":{"operationId":"getFlag","summary":"Get details of a specific feature flag","parameters":[{"name":"flagKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetFlagResponseDto"}}}},"403":{"description":"Flag not accessible to partner"},"404":{"description":"Flag not found"}},"tags":["Feature Flags"],"security":[{"bearer":[]}]}},"/features/flags/{flagKey}/contexts":{"get":{"operationId":"listFlagContexts","summary":"List all contexts targeted by a flag","parameters":[{"name":"flagKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFlagContextsResponseDto"}}}},"403":{"description":"Flag not accessible to partner"}},"tags":["Feature Flags"],"security":[{"bearer":[]}]},"post":{"operationId":"addContextsToFlag","summary":"Add contexts to a flag's targeting","parameters":[{"name":"flagKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddContextsToFlagDto"}}}},"responses":{"200":{"description":"Contexts added successfully"},"403":{"description":"Flag not accessible to partner"}},"tags":["Feature Flags"],"security":[{"bearer":[]}]},"delete":{"operationId":"removeContextsFromFlag","summary":"Remove contexts from a flag's targeting","parameters":[{"name":"flagKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveContextsFromFlagDto"}}}},"responses":{"200":{"description":"Contexts removed successfully"},"403":{"description":"Flag not accessible to partner"}},"tags":["Feature Flags"],"security":[{"bearer":[]}]}},"/features/segments":{"get":{"operationId":"listSegments","summary":"List all segments visible to the authenticated partner","parameters":[{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSegmentsResponseDto"}}}}},"tags":["Feature Flags - Segments"],"security":[{"bearer":[]}]}},"/features/segments/{segmentKey}":{"get":{"operationId":"getSegment","summary":"Get details of a specific segment","parameters":[{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSegmentResponseDto"}}}},"403":{"description":"Segment not accessible to partner"},"404":{"description":"Segment not found"}},"tags":["Feature Flags - Segments"],"security":[{"bearer":[]}]}},"/features/segments/{segmentKey}/contexts":{"get":{"operationId":"listSegmentContexts","summary":"List all contexts in a segment","parameters":[{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSegmentContextsResponseDto"}}}},"403":{"description":"Segment not accessible to partner"}},"tags":["Feature Flags - Segments"],"security":[{"bearer":[]}]},"post":{"operationId":"addContextsToSegment","summary":"Add contexts to a segment","parameters":[{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddContextsToSegmentDto"}}}},"responses":{"200":{"description":"Contexts added successfully"},"403":{"description":"Segment not accessible to partner"}},"tags":["Feature Flags - Segments"],"security":[{"bearer":[]}]},"delete":{"operationId":"removeContextsFromSegment","summary":"Remove contexts from a segment","parameters":[{"name":"segmentKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveContextsFromSegmentDto"}}}},"responses":{"200":{"description":"Contexts removed successfully"},"403":{"description":"Segment not accessible to partner"}},"tags":["Feature Flags - Segments"],"security":[{"bearer":[]}]}},"/features/contexts/search":{"get":{"operationId":"searchContexts","summary":"Search contexts accessible to the partner across flags and segments","parameters":[{"name":"q","required":false,"in":"query","description":"Substring match on context key","schema":{"type":"string"}},{"name":"kind","required":false,"in":"query","description":"Context kind filter","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of results (1-50)","example":20,"schema":{"type":"string"}},{"name":"partner_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchContextsResponseDto"}}}}},"tags":["Feature Flags - Contexts"],"security":[{"bearer":[]}]}},"/features/contexts/{flagKey}/evaluate":{"post":{"operationId":"evaluateFlagForContext","summary":"Evaluate a flag for a given context key/kind","parameters":[{"name":"flagKey","required":true,"in":"path","schema":{"type":"string"}},{"name":"partner_id","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateFlagForContextDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateFlagForContextResponseDto"}}}}},"tags":["Feature Flags - Contexts"],"security":[{"bearer":[]}]}}},"info":{"title":"Stream Partner API","description":"The Enterprise API for all Stream Partners.","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"CreatePartnerToken":{"type":"object","properties":{"org_id":{"type":"string"},"token_name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["user","onboarding","legacy_onboarding","sso","billing"]}}},"required":["org_id","token_name","scopes"]},"RenamePartnerTokenDto":{"type":"object","properties":{"token_name":{"type":"string"}},"required":["token_name"]},"OAuth2Request":{"type":"object","properties":{"grant_type":{"enum":["client_credentials","refresh_token"],"type":"string","description":"The type of grant you are requesting, must be \"client_credentials\" or \"refresh_token\""},"client_id":{"type":"string","description":"The API Key given by the application"},"client_secret":{"type":"string","description":"The API Token given by the application"},"exp":{"type":"number","description":"The expiration time of the assertion, specified as seconds since 00:00:00 UTC, January 1, 1970. This value has a maximum of 1 hour after the issued time."},"scopes":{"type":"array","items":{"type":"string","enum":["user","onboarding","legacy_onboarding","sso","billing"]},"description":"The list of the permissions that the application requests."},"refresh_token":{"type":"string","description":"The refresh token only when grant_type is set to \"refresh_token\""}},"required":["grant_type","client_id","client_secret"]},"OAuth2Response":{"type":"object","properties":{"access_token":{"type":"string","description":"The generated access token"},"token_type":{"type":"string","default":"bearer","description":"The type of token, in our case should always be \"bearer\""},"refresh_token":{"type":"string","description":"The generated refresh token"},"expires_in":{"type":"number","description":"Number of seconds until the acess token expires"},"refresh_token_expires_in":{"type":"number","description":"Number of seconds until the refresh token expires"},"scopes":{"type":"array","items":{"type":"string","enum":["user","onboarding","legacy_onboarding","sso","billing"]},"description":"Scopes requested for the token"}},"required":["access_token","token_type","refresh_token","expires_in","refresh_token_expires_in"]},"GenerateSSOSession":{"type":"object","properties":{"email":{"type":"string"},"full_name":{"type":"string"},"phone_number":{"type":"string"},"role":{"type":"string","enum":["owner","admin","manager","team_member","custom"]},"provider_org_id":{"type":"string"},"provider_org_name":{"type":"string"}},"required":["email","full_name","phone_number"]},"GenerateSSOSessionResponse":{"type":"object","properties":{"sso_login_token":{"type":"string","description":"test"}},"required":["sso_login_token"]},"CreateIntegrationDto":{"type":"object","properties":{"org_id":{"type":"string"},"source":{"type":"string"},"type":{"type":"string","enum":["pos","dsp"]},"return_url":{"type":"string"}},"required":["org_id","source","type","return_url"]},"PartnerOnboarding":{"type":"object","properties":{"_id":{"type":"string"},"org_id":{"type":"string","description":"User Org that the onboarding relates to"},"merchant_id":{"type":"string"},"type":{"enum":["pos","dsp"],"type":"string"},"status":{"enum":["pending","waiting_for_oauth","active","deprovisioned"],"type":"string"},"partner_id":{"type":"string","description":"Partner ID of the partner that the user org belongs to"},"partner_org_id":{"type":"string","description":"Partner Org ID of the partner that the user org belongs to"},"source":{"type":"string","description":"Source of the platform for onboarding"},"entry_url":{"type":"string","description":"URL that the merchant will navigated to perform onboarding"},"return_url":{"type":"string","description":"URL that the merchant will be redirected to after onboarding"},"integration_id":{"type":"string"}},"required":["_id","org_id","merchant_id","type","status","partner_id","partner_org_id","source","entry_url"]},"CreateIntegrationResponseDto":{"type":"object","properties":{"onboarding":{"$ref":"#/components/schemas/PartnerOnboarding"}},"required":["onboarding"]},"ConnectIntegrationDto":{"type":"object","properties":{"code":{"type":"string"}},"required":["code"]},"Address":{"type":"object","properties":{"formatted_address":{"type":"string","description":"address all in one line, required by google"},"address_line_1":{"type":"string"},"address_line_2":{"type":"string"},"address_line_3":{"type":"string"},"postal_code":{"type":"string"},"locality":{"type":"string"},"administrative_district_level_1":{"type":"string","description":"state in ISO 3166-2 format"},"country":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"}},"required":["address_line_1"]},"GetOnboardingLocation":{"type":"object","properties":{"provider_id":{"type":"string"},"name":{"type":"string"},"address":{"$ref":"#/components/schemas/Address"},"source":{"type":"string"}},"required":["provider_id","name","address","source"]},"GetOnboardingLocationsResponseDto":{"type":"object","properties":{"locations":{"type":"array","items":{"$ref":"#/components/schemas/GetOnboardingLocation"}}},"required":["locations"]},"IngestOnboardingLocation":{"type":"object","properties":{"provider_id":{"type":"string"}},"required":["provider_id"]},"IngestOnboardingLocationsDto":{"type":"object","properties":{"onboarding_id":{"type":"string"},"locations":{"type":"array","items":{"$ref":"#/components/schemas/IngestOnboardingLocation"}}},"required":["onboarding_id","locations"]},"IngestOnboardingResponseLocation":{"type":"object","properties":{"_id":{"type":"string"},"provider_id":{"type":"string"}},"required":["_id"]},"IngestOnboardingLocationResponseDto":{"type":"object","properties":{"locations":{"type":"array","items":{"$ref":"#/components/schemas/IngestOnboardingResponseLocation"}}},"required":["locations"]},"BindOnboardingLocation":{"type":"object","properties":{"pos_location_id":{"type":"string"},"dsp_provider_id":{"type":"string"},"dsp_store_name":{"type":"string"}},"required":["pos_location_id","dsp_provider_id","dsp_store_name"]},"BindOnboardingLocationsDto":{"type":"object","properties":{"onboarding_id":{"type":"string"},"locations":{"type":"array","items":{"$ref":"#/components/schemas/BindOnboardingLocation"}}},"required":["onboarding_id","locations"]},"BindOnboardingResponseLocation":{"type":"object","properties":{"_id":{"type":"string"},"dsp_provider_id":{"type":"string"},"dsp_store_name":{"type":"string"},"status":{"type":"string","enum":["APPROVED","pending","needs_reconnection","waiting_for_deprovision","deprovisioned"]}},"required":["_id","dsp_store_name","status"]},"BindOnboardingLocationResponseDto":{"type":"object","properties":{"locations":{"type":"array","items":{"$ref":"#/components/schemas/BindOnboardingResponseLocation"}}},"required":["locations"]},"CreateUserOrgUser":{"type":"object","properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"}},"required":["email"]},"CreateUserOrgDto":{"type":"object","properties":{"name":{"type":"string"},"provider_id":{"type":"string"},"user":{"$ref":"#/components/schemas/CreateUserOrgUser"}},"required":["name","provider_id","user"]},"CreateUserOrgResponseDto":{"type":"object","properties":{"org_id":{"type":"string"},"user_id":{"type":"string"}},"required":["org_id","user_id"]},"GetOrgLocationDsp":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"status":{"type":"string","enum":["APPROVED","pending","needs_reconnection","waiting_for_deprovision","deprovisioned"]},"change_time":{"type":"number"}},"required":["_id","name","source","status","change_time"]},"GetOrgLocation":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"status":{"type":"string","enum":["active","pending","waiting_for_deprovision","deprovisioned"]},"address":{"$ref":"#/components/schemas/Address"},"dsps":{"type":"array","items":{"$ref":"#/components/schemas/GetOrgLocationDsp"}}},"required":["_id","name","source","status","address","dsps"]},"GetOrgLocationsResponseDto":{"type":"object","properties":{"locations":{"type":"array","items":{"$ref":"#/components/schemas/GetOrgLocation"}}},"required":["locations"]},"PartnerBillingReport":{"type":"object","properties":{"reportMonth":{"type":"string"},"partnerId":{"type":"string"},"locations":{"type":"array","items":{"type":"object"}},"metrics":{"type":"object","properties":{"activeLocations":{"required":true,"type":"number"},"newActivations":{"required":true,"type":"number"},"newOnboardings":{"required":true,"type":"number"}}}},"required":["reportMonth","partnerId","locations","metrics"]},"ListFlagsResponseDto":{"type":"object","properties":{"flags":{"description":"List of feature flags","type":"array","items":{"type":"object"}}},"required":["flags"]},"GetFlagResponseDto":{"type":"object","properties":{"flag":{"type":"object","description":"Feature flag details"}},"required":["flag"]},"ListFlagContextsResponseDto":{"type":"object","properties":{"targets":{"type":"object","description":"Flag targets by context kind"}},"required":["targets"]},"ContextDto":{"type":"object","properties":{"key":{"type":"string","description":"Context key (user ID or entity ID)"},"kind":{"type":"string","description":"Context kind"}},"required":["key","kind"]},"AddContextsToFlagDto":{"type":"object","properties":{"contexts":{"description":"Contexts to add","type":"array","items":{"$ref":"#/components/schemas/ContextDto"}}},"required":["contexts"]},"RemoveContextsFromFlagDto":{"type":"object","properties":{"contexts":{"description":"Contexts to remove","type":"array","items":{"$ref":"#/components/schemas/ContextDto"}}},"required":["contexts"]},"ListSegmentsResponseDto":{"type":"object","properties":{"segments":{"description":"List of segments","type":"array","items":{"type":"object"}}},"required":["segments"]},"GetSegmentResponseDto":{"type":"object","properties":{"segment":{"type":"object","description":"Segment details"}},"required":["segment"]},"ListSegmentContextsResponseDto":{"type":"object","properties":{"contexts":{"description":"Contexts in segment","type":"array","items":{"type":"object"}}},"required":["contexts"]},"AddContextsToSegmentDto":{"type":"object","properties":{"contexts":{"description":"Contexts to add","type":"array","items":{"$ref":"#/components/schemas/ContextDto"}}},"required":["contexts"]},"RemoveContextsFromSegmentDto":{"type":"object","properties":{"contexts":{"description":"Contexts to remove","type":"array","items":{"$ref":"#/components/schemas/ContextDto"}}},"required":["contexts"]},"SearchContextsResponseDto":{"type":"object","properties":{"contexts":{"description":"Matching contexts","type":"array","items":{"type":"object"}}},"required":["contexts"]},"EvaluateFlagForContextDto":{"type":"object","properties":{"key":{"type":"string","description":"Context key (e.g., user or entity id)"},"kind":{"type":"string","description":"Context kind","default":"user"}},"required":["key"]},"EvaluateFlagForContextResponseDto":{"type":"object","properties":{"flagKey":{"type":"string","description":"Flag key"},"value":{"type":"object","description":"Resolved variation value"},"enabled":{"type":"boolean","description":"Whether the flag is truthy for this context"}},"required":["flagKey","value","enabled"]}}}}