{"openapi":"3.1.0","info":{"title":"Hive API","version":"1.0.0"},"paths":{"/campaigns/ads/":{"get":{"operationId":"campaigns_adsRetrieve","summary":"List ad campaigns","description":"Published Meta ad campaigns for the authorized brand, most recently created first. All performance figures are Meta-reported, served from Hive's cached stats. `stats` is only present when requested with `stats=true`; compare `stats_refreshed_at` to avoid re-fetching unchanged stats.","tags":["campaigns"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":500,"default":50}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"stats","in":"query","required":false,"schema":{"type":"boolean","default":false}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedAdsCampaigns"}}}},"422":{"description":"The request was rejected on its query parameters. Field errors are keyed by parameter name, rejections on the parameter values (e.g. an unknown ID) use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"security":[{"oauth2":[]}]}},"/campaigns/ads/{campaign_id}/stats/":{"get":{"operationId":"campaigns_adsStatsRetrieve","summary":"Get ad campaign stats","description":"Lifetime performance stats for a single Meta ad campaign. All figures are Meta-reported, served from Hive's cached stats. `stats` is null when insights have never been cached for the campaign.","tags":["campaigns"],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdsCampaignStatsResponse"}}}},"404":{"description":"Campaign not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}},"security":[{"oauth2":[]}]}},"/campaigns/ads/stats/":{"get":{"operationId":"campaigns_adsAggregateStatsRetrieve","summary":"Get aggregate ad campaign stats","description":"One set of stats totalled across published ad campaigns. Spend and counts are summed; derived metrics (cost per click, CTR, frequency, ROAS) are recalculated from the sums. Reach is a sum of per-campaign reach, so audience overlap across campaigns is counted once per campaign. `created_after` is inclusive and `created_before` exclusive.","tags":["campaigns"],"parameters":[{"name":"campaign_ids","in":"query","description":"Comma-separated campaign IDs, max 100.","required":false,"schema":{"type":"string","minLength":1}},{"name":"created_after","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"created_before","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregateAdsCampaignStatsResponse"}}}},"422":{"description":"The request was rejected on its query parameters. Field errors are keyed by parameter name, rejections on the parameter values (e.g. an unknown ID) use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"security":[{"oauth2":[]}]}},"/campaigns/email/":{"get":{"operationId":"campaigns_emailRetrieve","summary":"List email campaigns","description":"Sent email campaigns for the authorized brand, most recently sent first. `stats` is only present when requested with `stats=true`; compare `stats_refreshed_at` to avoid re-fetching unchanged stats.","tags":["campaigns"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":500,"default":50}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"stats","in":"query","required":false,"schema":{"type":"boolean","default":false}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedCampaigns"}}}},"422":{"description":"The request was rejected on its query parameters. Field errors are keyed by parameter name, rejections on the parameter values (e.g. an unknown ID) use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"security":[{"oauth2":[]}]}},"/campaigns/email/{campaign_id}/stats/":{"get":{"operationId":"campaigns_emailStatsRetrieve","summary":"Get campaign stats","description":"Engagement and revenue stats for a single email campaign. `stats` is null when no stats are available, and `counts`, `rates` and `revenue` are each null until that section is computed.","tags":["campaigns"],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignStatsResponse"}}}},"404":{"description":"Campaign not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}},"security":[{"oauth2":[]}]}},"/campaigns/email/stats/":{"get":{"operationId":"campaigns_emailAggregateStatsRetrieve","summary":"Get aggregate campaign stats","description":"One set of stats totalled across campaigns. Counts and revenue are summed; rates are recalculated from the summed counts. `sent_after` is inclusive and `sent_before` exclusive.","tags":["campaigns"],"parameters":[{"name":"campaign_ids","in":"query","description":"Comma-separated campaign IDs, max 100.","required":false,"schema":{"type":"string","minLength":1}},{"name":"sent_after","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sent_before","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregateCampaignStatsResponse"}}}},"422":{"description":"The request was rejected on its query parameters. Field errors are keyed by parameter name, rejections on the parameter values (e.g. an unknown ID) use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"security":[{"oauth2":[]}]}},"/campaigns/sms/":{"get":{"operationId":"campaigns_smsRetrieve","summary":"List SMS campaigns","description":"Sent SMS campaigns for the authorized brand, most recently sent first. `stats` is only present when requested with `stats=true`; compare `stats_refreshed_at` to avoid re-fetching unchanged stats.","tags":["campaigns"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":500,"default":50}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"stats","in":"query","required":false,"schema":{"type":"boolean","default":false}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedSMSCampaigns"}}}},"422":{"description":"The request was rejected on its query parameters. Field errors are keyed by parameter name, rejections on the parameter values (e.g. an unknown ID) use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"security":[{"oauth2":[]}]}},"/campaigns/sms/{campaign_id}/stats/":{"get":{"operationId":"campaigns_smsStatsRetrieve","summary":"Get SMS campaign stats","description":"Engagement and revenue stats for a single SMS campaign. `stats` is null until the campaign's cached stats have been computed. SMS has no open tracking, so clicks are the engagement signal.","tags":["campaigns"],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SMSCampaignStatsResponse"}}}},"404":{"description":"Campaign not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}},"security":[{"oauth2":[]}]}},"/campaigns/sms/stats/":{"get":{"operationId":"campaigns_smsAggregateStatsRetrieve","summary":"Get aggregate SMS campaign stats","description":"One set of stats totalled across SMS campaigns. Counts and revenue are summed; rates are recalculated from the summed counts. `sent_after` is inclusive and `sent_before` exclusive.","tags":["campaigns"],"parameters":[{"name":"campaign_ids","in":"query","description":"Comma-separated campaign IDs, max 100.","required":false,"schema":{"type":"string","minLength":1}},{"name":"sent_after","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sent_before","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregateSMSCampaignStatsResponse"}}}},"422":{"description":"The request was rejected on its query parameters. Field errors are keyed by parameter name, rejections on the parameter values (e.g. an unknown ID) use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"security":[{"oauth2":[]}]}},"/contacts/":{"post":{"operationId":"contacts_create","summary":"Create or update contacts","description":"Push contact data to Hive. Contacts are matched by `email` or `phone_number`; re-sending the same identifier updates the existing contact rather than duplicating it.","tags":["contacts"],"parameters":[{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Received and queued for background processing. Not yet applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contacts_create_Response_202"}}}},"422":{"description":"Validation failed. For a batch write this is all-or-nothing. Field errors are keyed by resource name, then item index, then field path, query-parameter errors are keyed by parameter name, service-level rejections use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveContactsRequest"}}}},"security":[{"oauth2":[]}]}},"/contacts/custom-properties/delete/":{"post":{"operationId":"customProperties_contacts_custom_properties_delete_create","summary":"Delete custom properties from contacts","description":"Remove specific custom property keys from one or more contacts.","tags":["customProperties"],"parameters":[{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Received and queued for background processing. Not yet applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Custom_Properties_contacts_custom_properties_delete_create_Response_202"}}}},"422":{"description":"Validation failed. For a batch write this is all-or-nothing. Field errors are keyed by resource name, then item index, then field path, query-parameter errors are keyed by parameter name, service-level rejections use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteCustomPropertiesRequest"}}}},"security":[{"oauth2":[]}]}},"/events/":{"post":{"operationId":"events_create","summary":"Create or update events","tags":["events"],"parameters":[{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Received and queued for background processing. Not yet applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Events_create_Response_202"}}}},"422":{"description":"Validation failed. For a batch write this is all-or-nothing. Field errors are keyed by resource name, then item index, then field path, query-parameter errors are keyed by parameter name, service-level rejections use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveEventsRequest"}}}},"security":[{"oauth2":[]}]}},"/events/{event_id}/":{"patch":{"operationId":"events_partialUpdate","summary":"Partially update an event","description":"Update individual fields on an event that already exists in Hive. Send only the fields that changed — at least one is required. The event is identified by `event_id` in the path, and the update time is server-stamped.","tags":["events"],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Received and queued for background processing. Not yet applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Events_partialUpdate_Response_202"}}}},"404":{"description":"No event exists with that `event_id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Detail"}}}},"409":{"description":"The event cannot be partially updated. Re-send the full event via POST /events instead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Detail"}}}},"422":{"description":"Validation failed. For a batch write this is all-or-nothing. Field errors are keyed by resource name, then item index, then field path, query-parameter errors are keyed by parameter name, service-level rejections use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEvent"}}}},"security":[{"oauth2":[]}]}},"/events/custom-properties/":{"get":{"operationId":"customEventProperties_events_custom_properties_retrieve","summary":"List custom event properties","tags":["customEventProperties"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":500,"default":500}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedCustomEventProperties"}}}},"422":{"description":"The request was rejected on its query parameters. Field errors are keyed by parameter name, rejections on the parameter values (e.g. an unknown ID) use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"security":[{"oauth2":[]}]},"post":{"operationId":"customEventProperties_events_custom_properties_create","summary":"Create custom event property","tags":["customEventProperties"],"parameters":[{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomEventProperty"}}}},"409":{"description":"A property with this name already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"422":{"description":"Validation failed. For a batch write this is all-or-nothing. Field errors are keyed by resource name, then item index, then field path, query-parameter errors are keyed by parameter name, service-level rejections use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomEventPropertyWriteRequest"}}}},"security":[{"oauth2":[]}]}},"/events/custom-properties/{property_id}/":{"get":{"operationId":"customEventProperties_events_custom_property_retrieve","summary":"Get custom event property","tags":["customEventProperties"],"parameters":[{"name":"property_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomEventProperty"}}}},"404":{"description":"Custom event property not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}},"security":[{"oauth2":[]}]},"put":{"operationId":"customEventProperties_events_custom_properties_update","summary":"Update custom event property","description":"Full replacement — send both fields even when only one changes. A property's `value_type` is locked once any event has a value for it.","tags":["customEventProperties"],"parameters":[{"name":"property_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomEventProperty"}}}},"404":{"description":"Custom event property not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"The name is taken, or the property has values so its type is locked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"422":{"description":"Validation failed. For a batch write this is all-or-nothing. Field errors are keyed by resource name, then item index, then field path, query-parameter errors are keyed by parameter name, service-level rejections use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomEventPropertyWriteRequest"}}}},"security":[{"oauth2":[]}]},"delete":{"operationId":"customEventProperties_events_custom_properties_destroy","summary":"Delete custom event property","description":"Deleting a property also deletes all of its values from your events.","tags":["customEventProperties"],"parameters":[{"name":"property_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Property deleted.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"404":{"description":"Custom event property not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"409":{"description":"The property has values and `force` was not set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"422":{"description":"The request was rejected on its query parameters. Field errors are keyed by parameter name, rejections on the parameter values (e.g. an unknown ID) use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"security":[{"oauth2":[]}]}},"/orders/":{"post":{"operationId":"orders_create","summary":"Create or update orders","description":"Push order/ticket data to Hive. An order is scoped to a single event; split a multi-event purchase into one order per `event_id`.","tags":["orders"],"parameters":[{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Received and queued for background processing. Not yet applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Orders_create_Response_202"}}}},"422":{"description":"Validation failed. For a batch write this is all-or-nothing. Field errors are keyed by resource name, then item index, then field path, query-parameter errors are keyed by parameter name, service-level rejections use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveOrdersRequest"}}}},"security":[{"oauth2":[]}]}},"/segments/":{"get":{"operationId":"segments_retrieve","summary":"List segments","description":"Retrieve the segments available for the authorized brand.","tags":["segments"],"parameters":[{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentList"}}}}},"security":[{"oauth2":[]}]},"post":{"operationId":"segments_create","summary":"Create segment","description":"Create a new segment for the authorized brand. Segment names must be unique within the brand.","tags":["segments"],"parameters":[{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"409":{"description":"A segment with this name already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"422":{"description":"Validation failed. For a batch write this is all-or-nothing. Field errors are keyed by resource name, then item index, then field path, query-parameter errors are keyed by parameter name, service-level rejections use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSegmentRequest"}}}},"security":[{"oauth2":[]}]}},"/segments/{segment_id}/":{"delete":{"operationId":"segments_destroy","summary":"Delete segment","description":"Delete an existing segment. Only segments the brand is allowed to delete can be removed.","tags":["segments"],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Segment deleted.","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"404":{"description":"Segment not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"422":{"description":"The segment cannot be deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}}},"security":[{"oauth2":[]}]}},"/segments/{segment_id}/users/":{"get":{"operationId":"segments_usersRetrieve","summary":"List segment users","tags":["segments"],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":500,"default":500}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedSegmentContacts"}}}},"404":{"description":"Segment not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"422":{"description":"The request was rejected on its query parameters. Field errors are keyed by parameter name, rejections on the parameter values (e.g. an unknown ID) use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"security":[{"oauth2":[]}]},"post":{"operationId":"segments_usersCreate","summary":"Add users to segment","description":"Only static segments can be modified through the API.","tags":["segments"],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Received and queued for background processing. Not yet applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segments_usersCreate_Response_202"}}}},"404":{"description":"Segment not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"422":{"description":"Validation failed. For a batch write this is all-or-nothing. Field errors are keyed by resource name, then item index, then field path, query-parameter errors are keyed by parameter name, service-level rejections use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentContactListRequest"}}}},"security":[{"oauth2":[]}]}},"/segments/{segment_id}/users/remove/":{"post":{"operationId":"segments_usersRemoveCreate","summary":"Remove users from segment","description":"Only static segments can be modified through the API.","tags":["segments"],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Partner-Id","in":"header","description":"Your OAuth application client ID.","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Received and queued for background processing. Not yet applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segments_usersRemoveCreate_Response_202"}}}},"404":{"description":"Segment not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Errors"}}}},"422":{"description":"Validation failed. For a batch write this is all-or-nothing. Field errors are keyed by resource name, then item index, then field path, query-parameter errors are keyed by parameter name, service-level rejections use a flat `errors` list.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentContactListRequest"}}}},"security":[{"oauth2":[]}]}}},"tags":[{"name":"campaigns"},{"name":"contacts"},{"name":"customProperties"},{"name":"events"},{"name":"customEventProperties"},{"name":"orders"},{"name":"segments"}],"servers":[{"url":"https://api.hive.co/v2","description":"https://api.hive.co/v2"}],"components":{"schemas":{"AdsCampaignStats":{"type":"object","properties":{"spend":{"type":"number","format":"double","default":0},"impressions":{"type":"integer","default":0},"reach":{"type":"integer","default":0},"frequency":{"type":"number","format":"double"},"clicks":{"type":"integer","default":0},"unique_clicks":{"type":"integer","default":0},"cost_per_click":{"type":"number","format":"double"},"cost_per_unique_click":{"type":"number","format":"double"},"click_through_rate":{"type":"number","format":"double"},"results":{"type":"integer"},"cost_per_result":{"type":"number","format":"double"},"meta_purchase_value":{"type":"number","format":"double"},"meta_purchase_roas":{"type":"number","format":"double"}},"description":"Versioned view over the cached Meta lifetime insights — the raw insights\nblob is never passed through. All figures are Meta-reported; ads have no\nHive-attributed revenue sections (unlike email and SMS).","title":"AdsCampaignStats"},"AdsCampaignWithStats":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"objective":{"type":"string"},"start_time":{"type":["string","null"],"format":"date-time"},"stop_time":{"type":["string","null"],"format":"date-time"},"budget_cents":{"type":["integer","null"]},"budget_type":{"type":["string","null"]},"stats_refreshed_at":{"type":["string","null"],"format":"date-time"},"stats":{"oneOf":[{"$ref":"#/components/schemas/AdsCampaignStats"},{"type":"null"}]}},"required":["id","name","status","objective","start_time","stop_time","budget_cents","budget_type","stats_refreshed_at"],"title":"AdsCampaignWithStats"},"PaginatedAdsCampaigns":{"type":"object","properties":{"offset":{"type":"integer"},"limit":{"type":"integer"},"total_items":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/AdsCampaignWithStats"}}},"required":["offset","limit","total_items","items"],"title":"PaginatedAdsCampaigns"},"AdsCampaignStatsResponse":{"type":"object","properties":{"campaign_id":{"type":"string"},"stats_refreshed_at":{"type":["string","null"],"format":"date-time"},"stats":{"oneOf":[{"$ref":"#/components/schemas/AdsCampaignStats"},{"type":"null"}]}},"required":["campaign_id","stats_refreshed_at","stats"],"title":"AdsCampaignStatsResponse"},"Errors":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"],"description":"The ``{\"errors\": [...]}`` body returned by the service-level failures.","title":"Errors"},"AggregateAdsCampaignStatsResponse":{"type":"object","properties":{"campaigns_included":{"type":"integer"},"stats_refreshed_at":{"type":["string","null"],"format":"date-time"},"stats":{"oneOf":[{"$ref":"#/components/schemas/AdsCampaignStats"},{"type":"null"}]}},"required":["campaigns_included","stats_refreshed_at","stats"],"title":"AggregateAdsCampaignStatsResponse"},"CampaignEngagementCounts":{"type":"object","properties":{"sent":{"type":"integer","default":0},"delivered":{"type":"integer","default":0},"opened":{"type":"integer","default":0},"clicked":{"type":"integer","default":0},"bounced":{"type":"integer","default":0},"soft_bounced":{"type":"integer","default":0},"spam_complained":{"type":"integer","default":0},"unsubscribed":{"type":"integer","default":0}},"title":"CampaignEngagementCounts"},"CampaignEngagementRates":{"type":"object","properties":{"delivery_rate":{"type":"number","format":"double"},"open_rate":{"type":"number","format":"double"},"click_rate":{"type":"number","format":"double"},"bounce_rate":{"type":"number","format":"double"},"spam_complaint_rate":{"type":"number","format":"double"},"unsubscribe_rate":{"type":"number","format":"double"},"estimated_non_prefetched_open_rate":{"type":"number","format":"double"}},"title":"CampaignEngagementRates"},"CampaignChannelRevenue":{"type":"object","properties":{"num_orders":{"type":"integer","default":0},"total_revenue":{"type":"number","format":"double","default":0}},"title":"CampaignChannelRevenue"},"CampaignRevenue":{"type":"object","properties":{"ecommerce":{"oneOf":[{"$ref":"#/components/schemas/CampaignChannelRevenue"},{"type":"null"}]},"ticketing":{"oneOf":[{"$ref":"#/components/schemas/CampaignChannelRevenue"},{"type":"null"}]},"total":{"oneOf":[{"$ref":"#/components/schemas/CampaignChannelRevenue"},{"type":"null"}]}},"title":"CampaignRevenue"},"CampaignStats":{"type":"object","properties":{"counts":{"oneOf":[{"$ref":"#/components/schemas/CampaignEngagementCounts"},{"type":"null"}]},"rates":{"oneOf":[{"$ref":"#/components/schemas/CampaignEngagementRates"},{"type":"null"}]},"revenue":{"oneOf":[{"$ref":"#/components/schemas/CampaignRevenue"},{"type":"null"}]}},"required":["revenue"],"description":"Explicit, versioned view over the cached stats blob — the raw blob is\nnever passed through, so internal key changes can't break API consumers.\nSections the campaign has no cached data for serialize as null.","title":"CampaignStats"},"CampaignWithStats":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subject":{"type":["string","null"]},"time_sent":{"type":["string","null"],"format":"date-time"},"num_recipients":{"type":"integer"},"stats_refreshed_at":{"type":["string","null"],"format":"date-time"},"stats":{"oneOf":[{"$ref":"#/components/schemas/CampaignStats"},{"type":"null"}]}},"required":["id","name","subject","time_sent","num_recipients","stats_refreshed_at"],"title":"CampaignWithStats"},"PaginatedCampaigns":{"type":"object","properties":{"offset":{"type":"integer"},"limit":{"type":"integer"},"total_items":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/CampaignWithStats"}}},"required":["offset","limit","total_items","items"],"title":"PaginatedCampaigns"},"CampaignStatsResponse":{"type":"object","properties":{"campaign_id":{"type":"string"},"stats_refreshed_at":{"type":["string","null"],"format":"date-time"},"stats":{"oneOf":[{"$ref":"#/components/schemas/CampaignStats"},{"type":"null"}]}},"required":["campaign_id","stats_refreshed_at","stats"],"title":"CampaignStatsResponse"},"AggregateCampaignStatsResponse":{"type":"object","properties":{"campaigns_included":{"type":"integer"},"stats_refreshed_at":{"type":["string","null"],"format":"date-time"},"stats":{"oneOf":[{"$ref":"#/components/schemas/CampaignStats"},{"type":"null"}]}},"required":["campaigns_included","stats_refreshed_at","stats"],"title":"AggregateCampaignStatsResponse"},"SMSCampaignEngagementCounts":{"type":"object","properties":{"sent":{"type":"integer","default":0},"delivered":{"type":"integer","default":0},"clicked":{"type":"integer","default":0},"failed":{"type":"integer","default":0},"opted_out":{"type":"integer","default":0},"opted_in":{"type":"integer","default":0},"undeliverable":{"type":"integer","default":0}},"title":"SMSCampaignEngagementCounts"},"SMSCampaignEngagementRates":{"type":"object","properties":{"delivery_rate":{"type":"number","format":"double"},"click_rate":{"type":"number","format":"double"},"opt_out_rate":{"type":"number","format":"double"},"failed_rate":{"type":"number","format":"double"}},"title":"SMSCampaignEngagementRates"},"SMSCampaignRevenue":{"type":"object","properties":{"ecommerce":{"$ref":"#/components/schemas/CampaignChannelRevenue"},"ticketing":{"$ref":"#/components/schemas/CampaignChannelRevenue"},"total":{"$ref":"#/components/schemas/CampaignChannelRevenue"}},"title":"SMSCampaignRevenue"},"SMSCampaignStats":{"type":"object","properties":{"counts":{"$ref":"#/components/schemas/SMSCampaignEngagementCounts"},"rates":{"$ref":"#/components/schemas/SMSCampaignEngagementRates"},"revenue":{"$ref":"#/components/schemas/SMSCampaignRevenue"}},"description":"Explicit, versioned view over the stats dict assembled by\nSMSCampaignsService. The cached subdocuments are never passed through,\nso internal key changes can't break API consumers.","title":"SMSCampaignStats"},"SMSCampaignWithStats":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"time_sent":{"type":["string","null"],"format":"date-time"},"num_recipients":{"type":["integer","null"]},"stats_refreshed_at":{"type":["string","null"],"format":"date-time"},"stats":{"oneOf":[{"$ref":"#/components/schemas/SMSCampaignStats"},{"type":"null"}]}},"required":["id","name","time_sent","num_recipients","stats_refreshed_at"],"title":"SMSCampaignWithStats"},"PaginatedSMSCampaigns":{"type":"object","properties":{"offset":{"type":"integer"},"limit":{"type":"integer"},"total_items":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/SMSCampaignWithStats"}}},"required":["offset","limit","total_items","items"],"title":"PaginatedSMSCampaigns"},"SMSCampaignStatsResponse":{"type":"object","properties":{"campaign_id":{"type":"string"},"stats_refreshed_at":{"type":["string","null"],"format":"date-time"},"stats":{"oneOf":[{"$ref":"#/components/schemas/SMSCampaignStats"},{"type":"null"}]}},"required":["campaign_id","stats_refreshed_at","stats"],"title":"SMSCampaignStatsResponse"},"AggregateSMSCampaignStatsResponse":{"type":"object","properties":{"campaigns_included":{"type":"integer"},"stats_refreshed_at":{"type":["string","null"],"format":"date-time"},"stats":{"oneOf":[{"$ref":"#/components/schemas/SMSCampaignStats"},{"type":"null"}]}},"required":["campaigns_included","stats_refreshed_at","stats"],"title":"AggregateSMSCampaignStatsResponse"},"GenderEnum":{"type":"string","enum":["male","female","non_binary","unknown"],"title":"GenderEnum"},"AddressRequest":{"type":"object","properties":{"address":{"type":"string","minLength":1,"maxLength":255},"city":{"type":"string","minLength":1,"maxLength":120},"state":{"type":"string","minLength":1,"maxLength":120},"country":{"type":"string","minLength":1,"maxLength":120},"zip":{"type":"string","minLength":1,"maxLength":20}},"title":"AddressRequest"},"ContactToSaveRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":75},"phone_number":{"type":"string"},"first_name":{"type":"string","minLength":1,"maxLength":120},"last_name":{"type":"string","minLength":1,"maxLength":120},"gender":{"$ref":"#/components/schemas/GenderEnum"},"birthday":{"type":"string","format":"date-time"},"address":{"$ref":"#/components/schemas/AddressRequest"},"is_email_opt_in":{"type":"boolean"},"is_sms_opt_in":{"type":"boolean"},"custom_properties":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":1000}},"updated_at":{"type":"string","format":"date-time"}},"required":["updated_at"],"title":"ContactToSaveRequest"},"SaveContactsRequest":{"type":"object","properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/ContactToSaveRequest"}}},"required":["contacts"],"title":"SaveContactsRequest"},"Contacts_create_Response_202":{"type":"object","properties":{},"description":"Empty response body","title":"Contacts_create_Response_202"},"DeleteContactCustomPropertiesRequest":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"property_names":{"type":"array","items":{"type":"string","minLength":1,"maxLength":255}}},"required":["identifier","property_names"],"title":"DeleteContactCustomPropertiesRequest"},"DeleteCustomPropertiesRequest":{"type":"object","properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/DeleteContactCustomPropertiesRequest"}}},"required":["contacts"],"title":"DeleteCustomPropertiesRequest"},"Custom_Properties_contacts_custom_properties_delete_create_Response_202":{"type":"object","properties":{},"description":"Empty response body","title":"Custom Properties_contacts_custom_properties_delete_create_Response_202"},"VenueRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1},"address":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"state":{"type":"string","minLength":1},"country":{"type":"string","minLength":1},"zip":{"type":"string","minLength":1}},"required":["name"],"title":"VenueRequest"},"TierRequest":{"type":"object","properties":{"tier_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"price":{"type":"number","format":"double","minimum":0}},"required":["tier_id","name","price"],"title":"TierRequest"},"PropertyValue":{"oneOf":[{"type":"string"},{"type":"integer"},{"type":"number","format":"double"}],"title":"PropertyValue"},"EventRequest":{"type":"object","properties":{"primary_performer_names":{"type":"array","items":{"type":"string","minLength":1}},"supporting_performer_names":{"type":"array","items":{"type":"string","minLength":1}},"description":{"type":"string"},"end_at":{"type":"string","format":"date-time"},"presale_start_at":{"type":"string","format":"date-time"},"onsale_start_at":{"type":"string","format":"date-time"},"doors_open_at":{"type":"string","format":"date-time"},"thumbnail_url":{"type":"string","format":"uri"},"genres":{"type":"array","items":{"type":"string","minLength":1}},"tags":{"type":"array","items":{"type":"string","minLength":1}},"has_tickets_available":{"type":"boolean"},"total_tickets":{"type":"integer","minimum":0},"timezone":{"type":"string","minLength":1},"venue":{"$ref":"#/components/schemas/VenueRequest"},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/TierRequest"}},"properties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PropertyValue"}},"event_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"start_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"event_url":{"type":"string","format":"uri"}},"required":["event_id","name","start_at","updated_at","event_url"],"title":"EventRequest"},"SaveEventsRequest":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/EventRequest"}}},"required":["events"],"title":"SaveEventsRequest"},"Events_create_Response_202":{"type":"object","properties":{},"description":"Empty response body","title":"Events_create_Response_202"},"UpdateEvent":{"type":"object","properties":{"primary_performer_names":{"type":"array","items":{"type":"string","minLength":1}},"supporting_performer_names":{"type":"array","items":{"type":"string","minLength":1}},"description":{"type":"string"},"end_at":{"type":"string","format":"date-time"},"presale_start_at":{"type":"string","format":"date-time"},"onsale_start_at":{"type":"string","format":"date-time"},"doors_open_at":{"type":"string","format":"date-time"},"thumbnail_url":{"type":"string","format":"uri"},"genres":{"type":"array","items":{"type":"string","minLength":1}},"tags":{"type":"array","items":{"type":"string","minLength":1}},"has_tickets_available":{"type":"boolean"},"total_tickets":{"type":"integer","minimum":0},"timezone":{"type":"string","minLength":1},"venue":{"$ref":"#/components/schemas/VenueRequest"},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/TierRequest"}},"properties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PropertyValue"}},"name":{"type":"string","minLength":1},"start_at":{"type":"string","format":"date-time"},"event_url":{"type":"string","format":"uri"}},"description":"Partial update for one event: :class:`EventSchema` with every field\noptional, no ``event_id`` (rides in the URL path), and no ``updated_at``\n(server-stamped at merge time). Absent keys mean \"leave untouched\".","title":"UpdateEvent"},"Events_partialUpdate_Response_202":{"type":"object","properties":{},"description":"Empty response body","title":"Events_partialUpdate_Response_202"},"Detail":{"type":"object","properties":{"detail":{"type":"string"}},"required":["detail"],"description":"DRF's ``{\"detail\": ...}`` body, raised by ``APIException`` subclasses.","title":"Detail"},"CustomEventProperty":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"value_type":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"value_count":{"type":"integer"}},"required":["id","name","value_type","created_at","value_count"],"description":"Every route's definition response. Reads off `PropertyWithValueCount`.","title":"CustomEventProperty"},"PaginatedCustomEventProperties":{"type":"object","properties":{"offset":{"type":"integer"},"limit":{"type":"integer"},"total_items":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/CustomEventProperty"}}},"required":["offset","limit","total_items","items"],"title":"PaginatedCustomEventProperties"},"CustomEventPropertyType":{"type":"string","enum":["text","number"],"description":"Declared value type of a CustomEventProperty.\n\nLowercase because these values travel through the public API\n(`value_type` on the custom-properties routes).","title":"CustomEventPropertyType"},"CustomEventPropertyWriteRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"value_type":{"$ref":"#/components/schemas/CustomEventPropertyType"}},"required":["name","value_type"],"title":"CustomEventPropertyWriteRequest"},"OrderStatusEnum":{"type":"string","enum":["started","completed","partial_payment","cancelled","pending"],"title":"OrderStatusEnum"},"OrderItemStatusEnum":{"type":"string","enum":["started","completed","cancelled","transferred","resold"],"title":"OrderItemStatusEnum"},"OrderItemRequest":{"type":"object","properties":{"item_id":{"type":"string","minLength":1},"price":{"type":"number","format":"double","minimum":0},"quantity":{"type":"integer","minimum":1},"status":{"$ref":"#/components/schemas/OrderItemStatusEnum"},"tier_id":{"type":"string","minLength":1},"tier_name":{"type":"string","minLength":1}},"required":["item_id","price","quantity"],"title":"OrderItemRequest"},"UserRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":75},"phone_number":{"type":"string"},"first_name":{"type":"string","minLength":1,"maxLength":120},"last_name":{"type":"string","minLength":1,"maxLength":120},"gender":{"$ref":"#/components/schemas/GenderEnum"},"birthday":{"type":"string","format":"date-time"},"address":{"$ref":"#/components/schemas/AddressRequest"},"is_email_opt_in":{"type":"boolean"},"is_sms_opt_in":{"type":"boolean"},"custom_properties":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":1000}}},"title":"UserRequest"},"OrderRequest":{"type":"object","properties":{"order_id":{"type":"string","minLength":1},"event_id":{"type":"string","minLength":1},"status":{"$ref":"#/components/schemas/OrderStatusEnum"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemRequest"}},"user":{"$ref":"#/components/schemas/UserRequest"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"purchased_at":{"type":"string","format":"date-time"}},"required":["order_id","event_id","status","items","user","created_at","updated_at"],"title":"OrderRequest"},"SaveOrdersRequest":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/OrderRequest"}}},"required":["orders"],"title":"SaveOrdersRequest"},"Orders_create_Response_202":{"type":"object","properties":{},"description":"Empty response body","title":"Orders_create_Response_202"},"Segment":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"time_created":{"type":"string","format":"date-time"}},"required":["id","name","time_created"],"title":"Segment"},"SegmentList":{"type":"object","properties":{"segments":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}}},"required":["segments"],"title":"SegmentList"},"CreateSegmentRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":["string","null"],"minLength":1,"default":null}},"required":["name"],"title":"CreateSegmentRequest"},"SegmentContact":{"type":"object","properties":{"phone":{"type":"string"},"email":{"type":"string","format":"email"}},"title":"SegmentContact"},"PaginatedSegmentContacts":{"type":"object","properties":{"offset":{"type":"integer"},"limit":{"type":"integer"},"total_items":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/SegmentContact"}}},"required":["offset","limit","total_items","items"],"title":"PaginatedSegmentContacts"},"SegmentContactRequest":{"type":"object","properties":{"email":{"type":["string","null"],"format":"email","maxLength":75,"default":null},"phone":{"type":["string","null"],"minLength":1,"default":null}},"title":"SegmentContactRequest"},"SegmentContactListRequest":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/SegmentContactRequest"}}},"required":["users"],"title":"SegmentContactListRequest"},"Segments_usersCreate_Response_202":{"type":"object","properties":{},"description":"Empty response body","title":"Segments_usersCreate_Response_202"},"Segments_usersRemoveCreate_Response_202":{"type":"object","properties":{},"description":"Empty response body","title":"Segments_usersRemoveCreate_Response_202"}},"securitySchemes":{"oauth2":{"type":"http","scheme":"bearer"}}}}