openapi: 3.2.0 info: title: Scrunch Data Collections API version: 0.1.0 servers: - url: /v1 tags: - name: Collections paths: /{brand_id}/collections: post: summary: Create Collection Request description: 'Triggers on-demand collection for a prompt across the specified AI platforms. Each platform will be queried and the response evaluated independently. Requires the `configure` scope. The prompt must already exist and have active variants for the requested platforms.' operationId: createCollection security: - HTTPBearer: - configure parameters: - name: brand_id in: path required: true schema: type: integer description: The unique identifier for the brand title: Brand Id description: The unique identifier for the brand requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CollectionRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/CollectionCreateResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' tags: - Collections components: schemas: CollectionRequest: properties: prompt_id: type: integer title: Prompt Id description: The ID of the prompt to collect platforms: items: type: string enum: - chatgpt - claude - google_ai_overviews - perplexity - meta - google_ai_mode - google_gemini - copilot - grok type: array minItems: 1 title: Platforms description: 'AI platforms to trigger collection on. **Supported platforms:** - `chatgpt` - OpenAI ChatGPT - `claude` - Anthropic Claude - `google_ai_overviews` - Google AI Overviews (Search) - `perplexity` - Perplexity AI - `meta` - Meta AI - `google_ai_mode` - Google AI Mode - `google_gemini` - Google Gemini - `copilot` - Microsoft Copilot' type: object required: - prompt_id - platforms title: CollectionRequest description: Request to trigger on-demand collection for a prompt across specified platforms. HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError CollectionCreateResponse: properties: prompt_id: type: integer title: Prompt Id description: The prompt ID that collection was triggered for events: items: $ref: '#/components/schemas/CollectionEventResult' type: array title: Events description: List of triggered collection events, one per platform type: object required: - prompt_id - events title: CollectionCreateResponse description: Response from triggering on-demand collection. ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError CollectionEventResult: properties: platform: type: string title: Platform description: The platform collection was triggered for inngest_event_id: type: string title: Inngest Event Id description: The Inngest event ID for tracking type: object required: - platform - inngest_event_id title: CollectionEventResult description: Result of a triggered collection event. securitySchemes: HTTPBearer: type: http scheme: bearer