Zoca Tasks API

The Zoca tasks and automation service. 785 paths and 855 operations under /tasks/api/v1 covering the AI content queue and content planning, FrontDesk voice and SMS agent onboarding on Retell and Twilio, the embeddable FrontDesk booking widget, local-SEO grid scans, WIN conversion triggers, and 25 inbound webhook receivers for Zoca's own vendors. Served publicly and unauthenticated as an OpenAPI 3.0.0 document at https://tasks.zoca.ai/swagger.json. Auth is a bearer JWT.

OpenAPI Specification

zoca-tasks-openapi.yml Raw ↑
openapi: 3.0.0
paths:
  /tasks/api/v1/content-queue/{entityId}/items:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
    post:
      operationId: t_value
      parameters: []
      responses:
        '201':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/items/{itemId}:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
    patch:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
    delete:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/items/{itemId}/post:
    patch:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/items/{itemId}/reschedule:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/items/{itemId}/link-content:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/items/{itemId}/generate:
    post:
      operationId: t_value
      parameters: []
      responses:
        '202':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/items/{itemId}/force-publish:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/items/bulk-reschedule:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/items/bulk-delete:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/items/bulk-force-publish:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/items/force-all-category-pages:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/generate-all:
    post:
      operationId: t_value
      parameters: []
      responses:
        '202':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/stats:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/calendar:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/plan:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
    delete:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/plan/summary:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/plan/services:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/plan/generate:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/status:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/activate:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/deactivate:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/rollback-to-v2:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-queue/{entityId}/schedule-preferences:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
    put:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Queue
  /tasks/api/v1/content-keywords/{entityId}:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Keywords
  /tasks/api/v1/content-keywords/{entityId}/counts:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Keywords
  /tasks/api/v1/content-keywords/{entityId}/items:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
      tags:
      - Content Keywords
  /tasks/api/v1/local-seo/keywords/flat:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/e'
      summary: Flat paginated keyword list for the By keyword tab
      tags:
      - Local SEO Map Grid
  /tasks/api/v1/local-seo/map/keyword-options:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/e'
      summary: Keyword dropdown options for the Map view
      tags:
      - Local SEO Map Grid
  /tasks/api/v1/local-seo/map/heatmap:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/e'
      summary: 5-point heatmap + hero metrics + trend
      tags:
      - Local SEO Map Grid
  /tasks/api/v1/local-seo/map/competitors:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/e'
      summary: Top competitors per point for the Map view
      tags:
      - Local SEO Map Grid
  /tasks/api/v1/local-seo/grid/request:
    post:
      operationId: t_value
      parameters: []
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/e'
        '400':
          description: Invalid keyword
        '429':
          description: Daily limit reached
      summary: Enqueue an on-demand 7×7 grid scan
      tags:
      - Local SEO Map Grid
  /tasks/api/v1/local-seo/grid/requests:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/e'
      summary: List 7×7 grid scans for an entity + daily cap state
      tags:
      - Local SEO Map Grid
  /tasks/api/v1/local-seo/grid/scan/{scanId}:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/e'
        '404':
          description: Not found
        '409':
          description: Scan still queued/running
      summary: 7×7 scan detail (49-point heatmap + hero metrics)
      tags:
      - Local SEO Map Grid
  /tasks/api/v1/image-generation/generate:
    post:
      operationId: t_value
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/t'
      responses:
        '200':
          description: Image generated successfully
          schema:
            properties:
              imageData:
                type: string
                format: binary
                description: Base64 encoded image data
              mimeType:
                type: string
                example: image/png
                description: MIME type of the generated image
              url:
                type: string
                example: https://example.com/image.png
                description: URL to the image if available
              metadata:
                type: object
                description: Additional metadata about the generated image
                example:
                  provider: openai
                  model: gpt-image-1
                  promptText: A futuristic city with flying cars
                  quality: high
                  format: png
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid request parameters
        '500':
          description: Error generating image
      summary: Generate an image from a text prompt
      tags:
      - Image Generation
  /tasks/api/v1/image-generation/edit:
    post:
      operationId: t_value
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/t'
      responses:
        '200':
          description: Image edited successfully
          schema:
            properties:
              imageData:
                type: string
                format: binary
                description: Base64 encoded edited image data
              mimeType:
                type: string
                example: image/png
                description: MIME type of the edited image
              url:
                type: string
                example: https://example.com/edited-image.png
                description: URL to the image if available
              metadata:
                type: object
                description: Additional metadata about the edited image
                example:
                  provider: openai
                  model: gpt-image-1
                  promptText: Add snow to the mountains
                  editOperation: true
                  quality: high
                  format: png
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid request parameters
        '404':
          description: Media not found
        '500':
          description: Error editing image
      summary: Edit an existing image using a text prompt
      tags:
      - Image Generation
  /tasks/api/v1/image-generation/supported-models:
    post:
      operationId: t_value
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/e'
      responses:
        '200':
          description: Model information retrieved successfully
          content:
            application/json:
              schema:
                example:
                  gpt-image-1:
                    sizes:
                    - 1024x1024
                    - 1536x1024
                    - 1024x1536
                    qualities:
                    - low
                    - medium
                    - high
                    - auto
                    formats:
                    - png
                    - jpeg
                    - webp
                    supportsEdit: true
                    supportsVariation: false
                    supportsTransparency: true
                  dall-e-3:
                    sizes:
                    - 1024x1024
                    - 1792x1024
                    - 1024x1792
                    supportsEdit: false
                    supportsVariation: false
                  dall-e-2:
                    sizes:
                    - 256x256
                    - 512x512
                    - 1024x1024
                    supportsEdit: true
                    supportsVariation: true
        '400':
          description: Invalid provider
        '500':
          description: Error retrieving model information
      summary: Get supported models for a specific AI provider
      tags:
      - Image Generation
  /tasks/api/v1/image-generation/generate-and-save:
    post:
      operationId: t_value
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/t'
      responses:
        '200':
          description: Image generated and saved successfully
          content:
            application/json:
              schema:
                properties:
                  mediaId:
                    type: number
                    example: 12345
                    description: ID of the created media entry
                  url:
                    type: string
                    example: https://zoca-media-bank.s3.amazonaws.com/generated/abc123.png
                    description: URL to the saved image
                  metadata:
                    type: object
                    description: Additional metadata about the saved image
                    example:
                      provider: openai
                      model: gpt-image-1
                      promptText: A mountain landscape
                      quality: high
                      format: png
                      batchId: 678
        '400':
          description: Invalid request parameters
        '500':
          description: Error generating or saving image
      summary: Generate an image and save it to the media library
      tags:
      - Image Generation
  /tasks/api/v1/image-generation/generate-variation:
    post:
      operationId: t_value
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/t'
      responses:
        '200':
          description: Image variation generated and saved successfully
          content:
            application/json:
              schema:
                properties:
                  mediaId:
                    type: number
                    example: 12346
                    description: ID of the created media variation
                  url:
                    type: string
                    example: https://zoca-media-bank.s3.amazonaws.com/generated/variation-def456.png
                    description: URL to the saved variation
                  metadata:
                    type: object
                    description: Additional metadata about the saved variation
                    example:
                      provider: openai
                      model: gpt-image-1
                      quality: high
                      format: png
                      batchId: 679
                      originalMediaId: 12345
        '400':
          description: Invalid request parameters
        '404':
          description: Original media not found
        '500':
          description: Error generating variation
      summary: Generate a variation of an existing image
      tags:
      - Image Generation
  /tasks/api/v1/image-generation/upscale-from-directory:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: Images upscaled successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  properties:
                    originalPath:
                      type: string
                      example: /input/edit/image1.jpg
                      description: Path to original image
                    upscaledPath:
                      type: string
                      example: /outputs/edit/image1-upscaled-123abc.png
                      description: Path to upscaled image if saved locally
                    url:
                      type: string
                      example: https://zoca-media-bank.s3.amazonaws.com/upscaled/image1-upscaled-123abc.png
                      description: S3 URL of the upscaled image
                    mediaId:
                      type: number
                      example: 12345
                      description: ID of the created media entry
                    metadata:
                      type: object
                      description: Additional metadata about the upscaled image
                      example:
                        originalFilename: image1.jpg
                        batchId: 789
                        provider: openai
                        model: gpt-image-1
        '400':
          description: Invalid request parameters
        '500':
          description: Error upscaling images
      summary: Upscale all images from a directory
      tags:
      - Image Generation
  /tasks/api/v1/auth/google/url:
    get:
      description: Generates a Google OAuth authorization URL for employee authentication
      operationId: t_value
      parameters:
      - name: clientId
        required: false
        in: query
        description: Calling client application (e.g. raft). Defaults to `server` for callers that omit it.
        schema:
          example: raft
      - name: redirectUrl
        required: false
        in: query
        description: Optional redirect URL after authentication
        schema: {}
      responses:
        '200':
          description: Returns the Google OAuth URL
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    example: https://accounts.google.com/o/oauth2/v2/auth?...
      summary: Get Google OAuth URL
      tags:
      - Auth
  /tasks/api/v1/auth/google/callback:
    get:
      description: Handles the Google OAuth callback and creates a session. If redirectUrl was provided, redirects with tokens. Otherwise returns JSON response.
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: Returns auth data as JSON (when no redirectUrl)
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: auth_success
                  entityId:
                    type: string
                  accessToken:
                    type: string
                  refreshToken:
                    type: string
        '302':
          description: Redirects after authentication (when redirectUrl provided)
      summary: Google OAuth callback
      tags:
      - Auth
  /tasks/api/v1/auth/me:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: Profile retrieved successfully
        '401':
          description: Unauthorized
      security:
      - bearer: []
      summary: Get current user profile
      tags:
      - Auth
  /tasks/api/v1/auth/refresh:
    post:
      description: Exchanges a refresh token for new access and refresh tokens. Implements token rotation.
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: Tokens refreshed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  accessToken:
                    type: string
                  refreshToken:
                    type: string
        '401':
          description: Invalid refresh token
      summary: Refresh authentication token
      tags:
      - Auth
  /tasks/api/v1/auth/logout:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: Logged out successfully
      security:
      - bearer: []
      summary: Logout and invalidate session
      tags:
      - Auth
  /tasks/api/v1/auth/sessions:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: Returns list of active sessions
      security:
      - bearer: []
      summary: Get all active sessions for the current user
      tags:
      - Auth
  /tasks/api/v1/auth/sessions/revoke-all:
    post:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: All sessions revoked
      security:
      - bearer: []
      summary: Revoke all sessions for the current user
      tags:
      - Auth
  /tasks/api/v1/auth/api-keys:
    post:
      description: Creates a new API key for the authenticated user. The full key is only shown once.
      operationId: t_value
      parameters: []
      responses:
        '201':
          description: API key created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/e'
        '400':
          description: Invalid request
      security:
      - bearer: []
      summary: Create a new API key
      tags:
      - API Keys
    get:
      description: Returns all API keys for the authenticated user. The actual key is not returned.
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: API keys retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/e'
      security:
      - bearer: []
      summary: List all API keys for the current user
      tags:
      - API Keys
  /tasks/api/v1/auth/api-keys/{id}/rotate:
    post:
      description: Generates a new key while keeping the old one valid for a grace period (default 24 hours)
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: API key rotated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  newKey:
                    type: string
        '404':
          description: API key not found
      security:
      - bearer: []
      summary: Rotate an API key
      tags:
      - API Keys
  /tasks/api/v1/auth/api-keys/{id}:
    delete:
      description: Permanently revokes an API key. This action cannot be undone.
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: API key revoked successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
        '404':
          description: API key not found
      security:
      - bearer: []
      summary: Revoke an API key
      tags:
      - API Keys
  /tasks/api/v1/chat/schedule-message:
    post:
      operationId: t_value
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/e'
      responses:
        '201':
          description: Message scheduled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/e'
        '400':
          description: Invalid request data
        '500':
          description: Internal server error
      summary: Schedule a message to be sent later
      tags:
      - Chat
  /tasks/api/v1/chat/scheduled-messages:
    get:
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: List of scheduled messages
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/e'
        '500':
          description: Internal server error
      summary: Get scheduled messages with optional filters
      tags:
      - Chat
  /tasks/api/v1/chat/process-scheduled-message:
    post:
      description: This endpoint is called by the worker to process scheduled messages. It will either send the message or abort it based on intervening messages.
      operationId: t_value
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/e'
      responses:
        '200':
          description: Message processed successfully
        '500':
          description: Internal server error
      summary: Process a scheduled message (called by worker)
      tags:
      - Chat
  /tasks/api/v1/chat/check-intervening-messages:
    post:
      description: Checks if there are any messages between the scheduled time and creation time
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: Returns whether intervening messages exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  hasInterveningMessages:
                    type: boolean
        '500':
          description: Internal server error
      summary: Check if there are intervening messages
      tags:
      - Chat
  /tasks/api/v1/chat/cancel-scheduled-message:
    post:
      description: Cancels a scheduled message that has not been sent yet (status PENDING)
      operationId: t_value
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/e'
      responses:
        '200':
          description: Message cancelled successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  messageId:
                    type: string
        '400':
          description: Message not found or already processed
        '500':
          description: Internal server error
      summary: Cancel a scheduled message
      tags:
      - Chat
  /tasks/api/v1/chat/message/bulk:
    post:
      operationId: t_value
      parameters: []
      requestBody:
        required: true
        description: Either provide an array of CreateMessageDto objects or a BulkCreateMessagesDto with s3Url
        content:
          application/json:
            schema:
              oneOf:
              - type: object
                properties:
                  s3Url:
                    type: string
                    description: S3 URL containing CSV file with bulk messages
                    example: s3://bucket-name/path/to/messages.csv
                required:
                - s3Url
              - type: array
                items:
                  type: object
                  properties:
                    conversationID:
                      type: string
                      format: uuid
                    text:
                      type: string
                    from:
                      type: string
                      format: uuid
                    parentMessageId:
                      type: string
                      format: uuid
                    attachments:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          url:
                            type: string
                          type:
                            type: string
                            enum:
                            - PDF
                            - AUDIO
                            - VIDEO
                            - GIFS
                            - OTHERS
                          metadata:
                            type: object
                  required:
                  - conversationID
                  - from
      responses:
        '201':
          description: Messages queued for processing
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  jobId:
                    type: string
        '400':
          description: Invalid message data
      summary: Create multiple messages in bulk
      tags:
      - Chat
  /tasks/api/v1/health:
    get:
      description: Retrieves application health status and environment information
      operationId: t_value
      parameters: []
      responses:
        '200':
          description: Health check and environment data retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  timestamp:
                    type: string
                    format: date-time
                  environment:
                    type: string
                  version:
                    type: string
                  uptime:
                    type: number
                  memoryUsage:
                    type: object
                    properties:
                      heapUsed:
                        type: number
                      heapTotal:
                        type: number
                      rss:
                        type: number
      security:
      - {}
      summary: Get Health and Environment Status
      tags:
      - Health
  /tasks/api/v1/jobs:
    get:
      description: Retrieves a filtered list of jobs across queues with pagination and sorting options
      operationId: t_value
      parameters:
      - name: sortOrder
        required: false
        in: query
        description: Sort order (asc or desc)
        schema:
          enum:
          - asc
          - desc
          type: string
      - name: sortBy
        required: false
        in: query
        description: Field to sort by (timestamp, finishedOn, or processedOn)
        schema:
          enum:
          - timestamp
          - finishedOn
          - processedOn
          type: string
      - name: search
        required: false
        in: query
        description: Search term for job name or data
        schema: {}
      - name: endDate
        required: false
        in: query
        description: Filter jobs before this date (ISO string)
        schema: {}
      - name: startDate
        required: false
        in: query
        description: Filter jobs after this date (ISO string)
        schema: {}
      - name: queues
        required: false
        in: query
        description: Comma-separ

# --- truncated at 32 KB (554 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/zoca/refs/heads/main/openapi/zoca-tasks-openapi.yml