> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognizo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Enqueue a per-brand opportunity recompute



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/brands/{brand_id}/opportunities/compute
openapi: 3.0.1
info:
  title: Cognizo Public API
  version: v1
  description: >-
    Public REST API for Cognizo. Authenticate with an API key via the
    `X-API-KEY` header.
servers:
  - url: https://core.cognizo.ai
security:
  - apiKey: []
paths:
  /api/v2/brands/{brand_id}/opportunities/compute:
    parameters:
      - name: brand_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
    post:
      tags:
        - Opportunities
      summary: Enqueue a per-brand opportunity recompute
      operationId: create_brand_ad_opportunities_compute
      responses:
        '202':
          description: compute enqueued (returns current status + remaining quota)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/opportunity_compute_status'
        '404':
          description: unknown brand_id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '429':
          description: daily recompute quota exhausted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    opportunity_compute_status:
      type: object
      properties:
        data:
          type: object
          properties:
            status:
              type: string
              enum:
                - idle
                - enqueued
                - running
                - completed
                - failed
            started_at:
              type: string
              format: date-time
              nullable: true
            completed_at:
              type: string
              format: date-time
              nullable: true
            duration_ms:
              type: integer
              nullable: true
            error:
              type: object
              nullable: true
              properties:
                class:
                  type: string
                message:
                  type: string
            quota:
              type: object
              properties:
                limit:
                  type: integer
                used:
                  type: integer
                remaining:
                  type: integer
                resets_at:
                  type: string
                  format: date-time
              required:
                - limit
                - used
                - remaining
                - resets_at
          required:
            - status
            - quota
      required:
        - data
    error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                $ref: '#/components/schemas/error_detail'
          required:
            - code
            - message
      required:
        - error
    error_detail:
      type: object
      properties:
        field:
          type: string
          nullable: true
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
        - field
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````