Skip to main content
Requests

Cancel a queued request

Cancel a request that has not started processing. A successful response has no body.

#Endpoint

POST https://api.higgsfield.ai/requests/{request_id}/cancel

#Authorization

Pass your API key ID and secret in the Authorization header:

Authorization: Key {api_key_id}:{api_key_secret}

#Parameters

Name Location Type Required Description
request_id path string Yes

#Example request

cURL
curl --request POST \
  --url https://api.higgsfield.ai/requests/{request_id}/cancel \
  --header "Authorization: Key ${HF_API_KEY_ID}:${HF_API_KEY_SECRET}"

#Responses

Status Description
202 The request was canceled.
400 The request has already started and can no longer be canceled.
401 Missing or invalid API credentials.
404 The request does not exist or belongs to another account.
Complete OpenAPI specification
yaml
openapi: 3.1.0
info:
  title: Higgsfield API
  version: 2.0.0
  description: Submit generation requests and retrieve their status and outputs.
servers:
  - url: https://api.higgsfield.ai
security:
  - authKey: []
paths:
  /requests/{request_id}/cancel:
    post:
      tags:
        - Requests
      summary: Cancel a queued request
      description: >-
        Cancel a request that has not started processing. A successful response
        has no body.
      operationId: cancel_request
      parameters:
        - name: request_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Request Id
      responses:
        '202':
          description: The request was canceled.
        '400':
          description: The request has already started and can no longer be canceled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: The request does not exist or belongs to another account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      title: Error response
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
  securitySchemes:
    authKey:
      type: apiKey
      in: header
      name: Authorization
      description: Use `Key {api_key_id}:{api_key_secret}`.
Was this page helpful?
Navigation